Skip to content

Backup and Recovery

Aaron W Morris edited this page Jun 27, 2023 · 23 revisions

Overview

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

  1. Database
  2. Database migrations
  3. Flask config
  4. Images and videos

Database

SQLite database

# Backup
sqlite3 "/var/lib/indi-allsky/indi-allsky.sqlite" .dump | gzip -c > "backup_indi-allsky_$(date +%Y%m%d_%H%M%S).sql.gz"

# Restore
gunzip -c backup_indi-allsky_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 (ARM -> Intel)

Database migrations

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"
Clone this wiki locally