Backup testing restores a PostgreSQL backup in a fresh testing environment to verify both the backup and the recovery procedure. A successful backup command alone does not prove that recovery will work. section 9.4
A practical restore test checks the following:
- Copy the base backup into the test PGDATA directory. section 9.4
- Verify the base backup with pg_verifybackup. section 9.4
- Copy subsequent WAL files into the test PGDATA directory and check that they are parsable with pg_waldump. section 9.4
- Start PostgreSQL, confirm recovery reaches a consistent state, and optionally inspect every relation page with pageinspect. section 9.4
The failed restore nobody tested
A company discovers that its restore command fails after its production database is lost. The backup may have been unusable, corrupted in storage, deleted, or accompanied by an unworkable recovery procedure. A restore drill exposes these failures before an emergency. section 9.4
