Skip to content

Implement backup, restore and reset of app data via API#940

Open
tlindi wants to merge 7 commits into
mynodebtc:masterfrom
tlindi:Implement-API-Backup-n-Restore-App-Data
Open

Implement backup, restore and reset of app data via API#940
tlindi wants to merge 7 commits into
mynodebtc:masterfrom
tlindi:Implement-API-Backup-n-Restore-App-Data

Conversation

@tlindi

@tlindi tlindi commented May 26, 2025

Copy link
Copy Markdown
Contributor

Application Data Management

Many applications data would be nice to have backup initiation possibility. And also restore and "Remove" (aka Factory reset) in case of some miss hap.

Instead of creating such routines separately for each App, should one API based functions be likely better way.

Checklist

List of test device(s)

  • [ + ] tested successfully on local MyNode, if yes, list the device(s) below
  • VM - MyNodeBTC 0.3.37 + Fixes

@tehelsper - mind to comment if functions are planned to proper files, and if you like idea / way to do this?

@tehelsper

Copy link
Copy Markdown
Collaborator

I like the concept.

@tlindi

tlindi commented May 29, 2025

Copy link
Copy Markdown
Contributor Author

I like the concept.

Looking forward to first implement and test Data Removal in few coming days.

@tlindi tlindi force-pushed the Implement-API-Backup-n-Restore-App-Data branch 19 times, most recently from 1246ff2 to 1f2b478 Compare May 29, 2025 19:49
@tlindi tlindi changed the title Implement backup, restore and removal of app data via API Implement backup, restore and reset of app data via API May 29, 2025
@tlindi tlindi force-pushed the Implement-API-Backup-n-Restore-App-Data branch 5 times, most recently from 23c13e6 to c9ca2e2 Compare May 29, 2025 21:59
@tlindi tlindi force-pushed the Implement-API-Backup-n-Restore-App-Data branch 2 times, most recently from 4e52864 to 21ab5a7 Compare June 13, 2025 13:39
Comment thread rootfs/standard/var/pynode/application_info.py
Comment thread rootfs/standard/var/pynode/application_info.py
Comment thread rootfs/standard/var/www/mynode/static/js/manage_apps.js Outdated
Comment thread rootfs/standard/var/www/mynode/static/js/manage_apps.js Outdated
Comment thread rootfs/standard/var/www/mynode/static/js/manage_apps.js Outdated
@tlindi tlindi force-pushed the Implement-API-Backup-n-Restore-App-Data branch from 6dc9f9a to 911f437 Compare June 28, 2025 19:38
@tehelsper

Copy link
Copy Markdown
Collaborator

Can this be closed now that PR #945 was merged?

@tlindi

tlindi commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

Can this be closed now that PR #945 was merged?

Sir, unfor not - I think.

I have not yet fould time to fix issue mentioned here:
#940 (comment)

And backup & restore are still to be implement.

@tlindi

tlindi commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

I had an idea to make backups version dependant, like here:
https://github.com/tlindi/mynode-phoenixd/blob/main/scripts/uninstall_phoenixd.sh

(And restore on install_phoenixd)

But as If your #945 does both I'm just happy with it.

(And willing to test as soon as I get my rig online ✌🏻🙏🏻👍🏻 )

@tehelsper

Copy link
Copy Markdown
Collaborator

This is getting complex - I'm leaning towards not merging, especially with versioned backups. That means there's tracking, displaying in the UI, potential for old backups not working with new app versions, etc... An option to download a tar.gz file for each app data folder may be better.

@tehelsper

Copy link
Copy Markdown
Collaborator

I'm fine with the simple reset part that is mostly done as of now.

@tlindi

tlindi commented Jul 12, 2025

Copy link
Copy Markdown
Contributor Author

This is getting complex - I'm leaning towards not merging, especially with versioned backups. That means there's tracking, displaying in the UI, potential for old backups not working with new app versions, etc... An option to download a tar.gz file for each app data folder may be better.

Possibility to download tgz of data would be clean and simple.

@tlindi

tlindi commented Jul 12, 2025

Copy link
Copy Markdown
Contributor Author

I'm fine with the simple reset part that is mostly done as of now.

I'll fix app->short_name and remove references to backup and restore.

@tlindi tlindi force-pushed the Implement-API-Backup-n-Restore-App-Data branch from 2910238 to 5ce9d22 Compare July 13, 2025 08:11
@tlindi

tlindi commented Jul 13, 2025

Copy link
Copy Markdown
Contributor Author

Reset works now after this commit on master.

And as this PR has much of hazzle - I'm okay for this to be Closed without merge.

If download storage_folder as tar.gz button appears onto Apps info pages someday, I'll be grateful.

@tlindi

tlindi commented Jul 13, 2025

Copy link
Copy Markdown
Contributor Author

Small issue to re-test.
Alby Hub custom configuration with phoenixd and reset worked flawlessly.
But configuration (default) with LDK and reset caused App Deactivation in log and restart tries to install docker version "latest" which fails.

Log attached here albyhub.log

@tlindi

tlindi commented Jul 13, 2025

Copy link
Copy Markdown
Contributor Author

Small issue to re-test.

Re-tested - Uninstalled and then reinstalled. Afterwards reset works. Hickup maybe caused concurrently ongoing BTCPay Server re install and not rebooted.

I'd say Work's for me :D

@tehelsper

Copy link
Copy Markdown
Collaborator

OK, I'll try the reset on AlbyHub once I get to working on the automated setup. That error makes it seem like it's trying to re-install the docker container after clearing data for some reason.

Actually, now that I think about it, several apps probably can't be reset entirely. Some installations place specific files in the data folder and may not properly set those files up in the pre-startup scripts. For example, the mempool clear only deletes a subset of the data folders within its data folder. Just a thought that the "reset" would need to be tested on each app it gets enabled on.

@tlindi

tlindi commented Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

Just a thought that the "reset" would need to be tested on each app it gets enabled on.

Yes, sure testing is need.
Test must be done by devs before enabling reset button onto "info page" by adding add data_manageable=true to Dynamic App .json file.

@tlindi

tlindi commented Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

OK, I'll try the reset on AlbyHub once I get to working on the automated setup. That error makes it seem like it's trying to re-install the docker container after clearing data for some reason.

Could you please also make switch to disable automated config to LND, for advanced users to be able to manually config custom setup? (like me, for manually setup Alby Hub to connect phoenixd Community App by me)?

@tlindi

tlindi commented Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

That error makes it seem like it's trying to re-install the docker container after clearing data for some reason.

I re-tested issue, and I could not replicate. Non-starting Alby Hub after reset from Default setup could have been caused by the fact that I was reinstalling BTCPay same time as i did reset. But more tests never do harm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants