Rehearse a restore

A backup you have never restored is a hope, not a backup. pgdba verify-restore verifies the repository is readable and — with --restore — runs a full restore into an empty scratch directory, measuring throughput and wall time against a recovery-time objective.

# read-only verification of the repository
pgdba verify-restore --target /var/backups/app --rto-minutes 60

# full restore rehearsal into an empty scratch directory
pgdba verify-restore --target /var/backups/app --scratch /srv/scratch/restore1 \
  --restore --rto-minutes 60

Done looks like

Exit 0 with the restore’s bytes, minutes, MB/s, and RTO verdict (inside/missed) — or exit 1 with the specific rehearsal issues. Either way, the DR plan has a measured number instead of a hope.

Fencing: production is never written

  • Directory targets must be empty or absent scratch paths.
  • DSN targets require --scratch and are refused if they match a run-config profile — production is never a rehearsal target.
  • Exit 0 verified, 1 rehearsal issues (report says which), 3 config/fencing errors.

Row-count baselines apply to directory restores; the DSN path verifies only.

Note

Pair this with backup-hygiene findings: the check flags missing archiving and stale backups; verify-restore proves the other half — that the archive actually restores inside your RTO.