-
Notifications
You must be signed in to change notification settings - Fork 47
Backup and Recovery
Aaron W Morris edited this page Aug 8, 2024
·
23 revisions
Backup and recovery of indi-allsky involves backing up several areas
- Database
- Database migrations
- Flask config
- indi-allsky environment (optional)
- Dark frames
- Images and videos
# Backup
sqlite3 "/var/lib/indi-allsky/indi-allsky.sqlite" .dump | gzip -c > "backup_indi-allsky_sqlite_$(date +%Y%m%d_%H%M%S).sql.gz"
# Restore
gunzip -c backup_indi-allsky_sqlite_00000000.sql.gz | sqlite3 /var/lib/indi-allsky/indi-allsky.sqlite
Note: You can backup the binary sqlite database file itself, but it is NOT portable between platforms (eg ARM -> Intel)
# Backup
mysqldump --host localhost --user indi_allsky_own -p indi_allsky | gzip -c > "backup_indi-allsky_mysql_$(date +%Y%m%d_%H%M%S).sql.gz"
## add --ssl for remote connections
# Restore (create database first)
gunzip -c backup_indi-allsky_mysql_00000000.sql.gz | mysql --host localhost --user indi_allsky_own indi_allsky
- Mysql database creation: https://github.com/aaronwmorris/indi-allsky/wiki/MySQL-MariaDB-Information
# Backup
tar -C /var/lib/indi-allsky/migrations --exclude="*.py[oc]" -cvf - . | gzip -c > "backup_indi-allsky_migrations_$(date +%Y%m%d_%H%M%S).tgz"
# Restore
tar -C /var/lib/indi-allsky/migrations -xvfz backup_indi-allsky_migrations_00000000.tgz
The flask config is at /etc/flask.json
Service environment variables are located at /etc/indi-allsky/indi-allsky.env
. This is an optional file.
Images and videos are normally located at /var/www/html/allsky/images/