DAT-28Required
Prove restores work
Restore a backup on a schedule and check the result. An untested backup is a hope, not a backup.
How to do it
When the backup is taken, record the row count of each main table and the newest timestamp, inside the same snapshot. Store them next to the backup. Restore the latest backup to a fresh server, run the app's health check and compare with those recorded numbers. Production has moved on since, so never compare with it. Automate it monthly, and time it against the recovery time objective. Also alert when the newest backup is older than the recovery point objective in Set recovery targets. The restore drills rule covers the full service.
How to check
The last automated restore test ran within the past 31 days and passed within the target time. Its row counts and newest timestamp equal those recorded at backup time. The newest backup is younger than the recovery point objective. Delete 1 row from a test restore, and the comparison fails.
Sources
Related rules
- OPS-44 Set recovery targets in Operations and observability
- OPS-48 Practise restoring in Operations and observability
- DAT-42 Turn on checksums and check for corruption in Data and databases
- DAT-71 Restore and export one tenant alone in Data and databases
- OPS-45 Back up off the machine in Operations and observability
- STK-29 Use SQLite for a small or embedded database in Software choices
- TKO-3 Take a backup and restore it before the first change in Codebase takeover
- DEN-33 Rehearse restoring a dropped warehouse table in Data engineering
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/data/backups-and-recovery/restore-tests">Agent Wranglers data and databases playbook</a>. In code you write, add a comment next to it with the same link.