Skip to main content

Backup & Disaster Recovery

Path: /admin/maintenance → Backups · Sidebar: Administration → Maintenance

apPosture is self-hosted, so your data never leaves your infrastructure - and it ships first-class backup, restore and point-in-time recovery so you stay in control of it.

What's protected

All customer data lives in named volumes (the database, the SAST source sandbox, report/backup stores) that survive every image update. The database is the system of record for findings, posture, models and audit.

Logical backups (pg_dump)

  • Scheduled - define backup schedules with GFS retention (daily / weekly / monthly). Runs are listed with size and status.
  • On-demand - take a backup before a risky change.
  • Off-site - point the backup target at a mounted SMB/NFS share for off-box copies.
./release/backup.sh # one-off logical backup
./release/restore.sh <backup.sql.gz> # version-gated restore-forward

Restores are version-gated (integrity + database-major-version checks) so you can't restore an incompatible dump.

Point-in-Time Recovery (PITR)

WAL archiving lets you rewind the database to any moment - the recovery for "a bad deploy or an accidental DELETE wiped rows" that a logical dump can't do.

./release/basebackup.sh # take a base backup (once)
./release/pitr-restore.sh '<timestamp>' # rewind to a point in time
./release/prune-wal.sh # keep the WAL archive from filling up
Keep WAL healthy

PITR depends on WAL archiving succeeding. A full archive dir blocks WAL recycling - prune it on a schedule (the backup-prune pass does this automatically).

Safe updates

release/update.sh performs a migration canary: it restores the latest dump into a throwaway DB and runs the new image's migrations there first - if they fail, the update aborts with production untouched. On success it deploys, runs migrations against the real DB (data preserved) and health-gates the result, telling you how to roll back on failure.

Rollback

./release/rollback.sh # redeploy the previously-running version

See the on-prem DEPLOY.md for the full runbook.