Skip to content

Backup and restore

Back up PostgreSQL, uploads, deployment configuration/secrets, Caddy certificate state, and custom mounted configuration together. Database-only backups leave media metadata without files.

Pause writes during collection. Use the same Compose project/configuration throughout. Store encrypted backups outside Git with restricted access, including source-encryption keys.

Substitute your actual database/user. Create the dump inside the container before copying out to avoid PowerShell binary-redirection problems.

docker compose stop api web
docker compose exec -T postgres pg_dump -U postgres -d insightboard -Fc -f /tmp/insightboard.dump
docker compose cp postgres:/tmp/insightboard.dump ./insightboard.dump

Check every command. Archive matching uploads/configuration before restarting api/web. These commands cover only the database portion.

Use an isolated host/project. Restore matching database, uploads, secrets, configuration, and certificate state. Start the matching app version. Verify health, login, source decryption/refresh, media access, and pairing/playback.

Back up at least daily and before upgrades. Monitor failures and rehearse restoration. Prevent restored tests from connecting to production devices or performing unintended actions on production sources.