
A backup job that reports success tells you one thing: a file was written. It does not tell you whether that file restores, whether the restored database has the data your application needs, or how long the whole process takes. The only way to answer those questions is to restore it.
This is the runbook I use for restore drills on PostgreSQL and MySQL. It is deliberately simple, so it can run every month without turning into a project.
Why untested backups fail
When I review backup setups, the failures I worry about are rarely the job itself. They sit around it:
- The dump completes, but a schema, a large table or the roles were left out of scope.
- WAL archiving or binary logs have gaps, so point-in-time recovery stops short.
- The backup restores, but only on an older server version or with an extension that is no longer installed.
- Nobody has the restore steps written down, so the first real restore happens during an incident.
- The restore works but takes far longer than the recovery time the business assumes.
None of these show up as a failed job. All of them show up in a drill.
Choosing what to restore
Restore the backup you would actually reach for in an incident: the latest one from the normal schedule, pulled from the same storage and with the same credentials. A fresh dump taken just for the test proves very little.
Rotate the type of drill:
- Logical backups (
pg_dump,mysqldump, MySQL Shell dump utilities): restore the full database. - Physical backups (
pg_basebackup, Percona XtraBackup or similar): restore the base backup and replay WAL or binary logs to a target time, so point-in-time recovery is tested too.
Before restoring, record the backup ID, its size, when it was taken and where it came from.
Restore to an isolated host
Restore on a separate host or VM that no application can reach. Block outbound mail, disable cron jobs and schedulers, and use credentials that do not exist in production. A restored copy should never be able to write to anything real.
For a PostgreSQL logical backup in custom format:
pg_restore --list /backups/app_2026-12-01.dump | head -20 # archive is readable
createdb drill_app
time pg_restore -d drill_app -j 4 --no-owner /backups/app_2026-12-01.dump
For a plain-format PostgreSQL base backup, check it against its manifest before you start recovery:
pg_verifybackup /backups/base/2026-12-01
For MySQL, restore a mysqldump file with the event scheduler off:
mysql -e "SET GLOBAL event_scheduler = OFF; CREATE DATABASE drill_app;"
time mysql drill_app < /backups/app_2026-12-01.sql
The PostgreSQL Backup and Restore chapter and the MySQL Backup and Recovery chapter cover every option for each method.
Verifying the restore
A restore that finishes without errors is a start, not a pass. I check three things.
1. Row counts on critical tables. Statistics such as n_live_tup or information_schema.TABLES.table_rows are estimates, so use exact counts, filtered to the backup time so the numbers are comparable with production:
-- Run on production and on the restored copy, then compare
SELECT 'orders' AS table_name, COUNT(*) AS row_count
FROM orders WHERE created_at < '2026-12-01 02:00:00'
UNION ALL
SELECT 'payments', COUNT(*)
FROM payments WHERE created_at < '2026-12-01 02:00:00';
2. Structural health. On PostgreSQL, run ANALYZE and look for invalid indexes left by the restore:
ANALYZE;
SELECT indexrelid::regclass AS index_name
FROM pg_index
WHERE NOT indisvalid;
On MySQL, check the restored tables:
mysqlcheck --check drill_app
3. Application checks. Point a test instance of the application, or a set of saved queries, at the restored database: log in, open a recent record, run the report that finance uses. If the latest data the business cares about is not there, the backup does not meet its purpose.
Recording time to restore
Time the drill from the moment you start the restore to the moment application checks pass. That number is your real recovery time. Write it down with the details:
| Field | Example entry |
|---|---|
| Backup ID and type | app_2026-12-01, logical |
| Backup size | from the backup log |
| Restore duration | from time output |
| Verification duration | row counts, checks, app tests |
| Total time to usable database | restore plus verification |
| Issues found | missing role, extension, step not documented |
Compare the total with the recovery time objective the business has agreed. If it is longer, you now know before an incident, and you can fix it with parallel restore jobs, faster storage or a different backup method.
Making it a schedule
One drill is an audit artefact. A schedule is what keeps backups honest:
- Run a drill monthly for critical databases and quarterly for the rest.
- Run an extra drill after a major version upgrade, a storage change or any change to backup tooling.
- Rotate who runs it, so the runbook works for someone other than its author.
- Script the restore and the checks, and alert if the drill fails, the same way you alert on a failed backup.
If you also want to keep the restored database healthy under load, read our guide on PostgreSQL autovacuum tuning.
Conclusion
A restore drill is four steps: pick a real backup, restore it somewhere isolated, verify the data and the application, and record how long it took. Do it on a schedule and after every significant change, and your backups stop being an assumption.
If you want help setting up restore drills, verification scripts and backup monitoring for PostgreSQL or MySQL, see how our team runs them under Database Managed Services and Remote DBA.