Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request - Backup/Restore of settings #728

Open
vastmeridian opened this issue Apr 30, 2023 · 9 comments
Open

Enhancement Request - Backup/Restore of settings #728

vastmeridian opened this issue Apr 30, 2023 · 9 comments

Comments

@vastmeridian
Copy link

vastmeridian commented Apr 30, 2023

Having moved to a new (larger) ssd, I had to go through the pain of a database migration from an earlier build of indi-allsky to a newer build just to transfer all the settings from one instance of indi-alllsky to another.

**** Setup DB ****
**** Backup DB prior to migration ****
ERROR [flask_migrate] Error: Can't locate revision identified by 'ab5f1e700820'


The script exited abnormally, please try to run again...

Is there a way to add a indi-allsky settings backup or export to (say) the Utilities page that could then be used as an import on the new instance? Perhaps in a json format or similar?

Thinking this would simplify a number of tasks - particularly rebuilding an indi-allsky camera that's had a disk or storage failure. The ability to save this backup offsite using the file transfer side, or a simple copy to USB stick would pay for itself the first time it's used.

@aaronwmorris
Copy link
Owner

These are the flask database migrations.

You can try these steps from https://github.com/aaronwmorris/indi-allsky/wiki/Database-migrations#fixing-broken-migrations

sqlite3 /var/lib/indi-allsky/indi-allsky.sqlite "DELETE FROM alembic_version;"

# from the indi-allsky folder
rm /var/lib/indi-allsky/migrations/versions/*.py

# now rerun setup.sh

@vastmeridian
Copy link
Author

I got to the same point in a slightly different way. I reconnected the old disk, updated indi-allsky and re-run the export. That has now worked and I'm up and running. In retrospect, your method would have been slightly quicker. :)

Nevertheless, if you're interested, my request for the enhancement is still a valid one (he asked hopefully!)

@aaronwmorris
Copy link
Owner

Your method was going to be my next suggestion, which is the best way.

I will write up a backup/restore procedure.

@vastmeridian
Copy link
Author

vastmeridian commented May 3, 2023

I did run into the same Error: Can't locate revision error when I next updated the new system from the GIT master - even after updating using 'my method', so I still had to use the rm /var/lib/indi-allsky/migrations/versions/*.py to recover the system.
Hopefully that's it now ...

@aaronwmorris
Copy link
Owner

It is only a problem if the last database schema does not reflect what is in the DB. If you upgraded before moving systems, you should be fine.

@vastmeridian
Copy link
Author

Hi Aaron
I'm just being tidy. Have you written the backup/restore procedure. mentioned above? If so, I'll test then close this issue.

@aaronwmorris
Copy link
Owner

Not yet. I will get to it very soon.

@aaronwmorris
Copy link
Owner

This is my first pass at an informational page on backing up indi-allsky:

https://github.com/aaronwmorris/indi-allsky/wiki/Backup-and-Recovery

I am also planning on writing a script to create a unified tar file of all of the files necessary to backup.

@vastmeridian
Copy link
Author

That new page looks good, Aaron. Script would be good (and I'd be happy to test - at least to a VM and back)
One (small) point:

Backup and recovery of indi-allsky involves backing up 4 areas

Database
Database migrations
Flask config
indi-allsky environment (optional)
Images and videos

I count 5 areas, not 4 (OK - so one is optional) :)

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

No branches or pull requests

2 participants