Use it to prove backups work.
Restore Testing
Restore testing regularly restores backups into a separate environment and checks that the data and application work, proving RPO and RTO.
1. Pick the latest backup.
2. Restore to a test instance.
3. Integrity: DBCC CHECKDB / pg_amcheck / row counts.
4. App smoke test.
5. Record duration and result.
backup → restore → integrity checks → app test → report
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 How to verify Verify boundary
Confirm the test uses the off-site copy, not a local file. Review the restore time trend as data grows.
Step 2 Common failures Narrow the fault
Encryption keys stored only on the lost server make backups unusable. Backups that silently skip a database are only found during a restore. Restore time grows with data until it exceeds the RTO.
Automate it. Check integrity (row counts, checksums, DBCC CHECKDB, app smoke tests). Record time taken.
DBCC CHECKDB— first check for this topicpsql -c "SELECT now(), version();"— PostgreSQL reachable and versionmysql -e "SELECT NOW(), VERSION();"— MariaDB/MySQL reachable and versionsqlcmd -S <server> -Q "SELECT @@VERSION"— SQL Server reachable and version
ReferenceWhat it is1 section · depth on demand
How it works
Automated restore tests run the same steps a real recovery would need, including fetching from off-site storage and decrypting. They expose missing keys, wrong permissions and corrupt files early.
ReferenceImportant terms & boundaries3 sections · depth on demand
Restore test checklist
- Restore to a separate server regularly (monthly for critical databases).
- Check integrity:
pg_amcheck,mysqlcheck,DBCC CHECKDB. - Run application smoke tests or row-count comparisons.
- Measure restore time against RTO and data age against RPO.
- Test PITR, not just full restores.
- Document the results as evidence.
In depth
What a restore test must prove
| Question | Evidence |
|---|---|
| Can we get the backup at all? | Fetched from the off-site/immutable copy, decrypted with the escrowed key |
| Is it complete? | Every expected database, schema and table present; row counts compared with production |
| Is it intact? | Integrity check passes (below) |
| Is it current enough? | Newest transaction timestamp within the RPO |
| Is it fast enough? | Measured total time within the RTO |
| Does the application work? | Smoke test: log in, read and write a test record |
Integrity checks per engine
pg_amcheck --all -j 4 --heapallindexed # PostgreSQL 14+: heap and B-tree checks
mysqlcheck --all-databases --check # MySQL / MariaDB
DBCC CHECKDB (shop) WITH NO_INFOMSGS, ALL_ERRORMSGS; -- SQL Server
Automating it
A scheduled job (weekly for critical systems, at least monthly otherwise) that restores the latest backup to a throwaway server, runs the checks and a few known queries, records duration and result, and alerts on failure or on a restore time trend that approaches the RTO. Restore to a time a few minutes ago as well, to prove the log archive (PITR) works, not only the base backup.
Record the result
Keep a short log per test: backup ID, restore duration, data timestamp, checks run, outcome. A backup that has never been restored has unknown value; the record is what shows it does.
Common mistakes
- Restores never tested end to end.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.