Skip to content

Backup and Recovery

Aaron W Morris edited this page Aug 23, 2024 · 23 revisions

Overview

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

  1. Database
  2. Database migrations
  3. Flask config
  4. indi-allsky environment (optional)
  5. Dark frames
  6. 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

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/indi-allsky/flask.json

indi-allsky environment

Service environment variables are located at /etc/indi-allsky/indi-allsky.env. This is an optional file.

Images and videos

Images and videos are normally located at /var/www/html/allsky/images/

Clone this wiki locally