Last updated: 2026-06-20
Backups protect the company server's source-of-truth data.
- PostgreSQL production database (full + incremental as configured)
- restaurant settings and configuration history
- audit logs
- Backups are encrypted.
- Backups and dumps are never committed to git (
.gitignoreenforces this). - Restores are tested periodically (restore drill).
- Every restore writes an audit log (who, when, which backup, why).
- Retention is configurable (
BACKUP_RETENTION_DAYS, default 14).
- Scheduled job dumps the company database to an encrypted artifact.
- Artifact is stored off-host (separate disk / object storage / offsite).
- Old artifacts beyond retention are pruned.
- Stop or quiesce writes (maintenance window) if doing a full restore.
- Restore the encrypted backup into PostgreSQL.
- Verify integrity (row counts, key business tables, last audit entries).
- Record a restore audit log.
- Resume operations; if the VPS buffer holds newer events, run sync-back.
deploy/vps/scripts/backup-db.sh and restore-db.sh provide the scaffold;
VPS_BACKUP_RESTORE.md covers the VPS-side details. The
PostgreSQL target uses pg_dump/pg_restore in place of the SQLite copy used in
the current local stack.