Backup and Recovery - aaronwmorris/indi-allsky GitHub Wiki
Overview
Backup and recovery of indi-allsky involves backing up 4 areas
- Database
- Database migrations
- Flask config
- indi-allsky environment (optional)
- Dark frames
- Images and videos
Database
SQLite database
# 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)
Mysql database
# 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
Database migrations
# 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
Flask config
The flask config is at /etc/flask.json
indi-allsky environment
Service environment variables are located at /etc/indi-allsky/indi-allsky.env
. This is an optional file.
Dark frames
The dark frames are located at /var/www/html/allsky/images/darks/
Images and videos
Images and videos are normally located at /var/www/html/allsky/images/