A successful backup job is a reassuring green tick. It is not evidence that you can get the database back. Restore drills are how you turn that tick into a measured RTO and RPO: pick a backup, restore it onto a scratch host, prove the data starts and answers queries, and write down how long it took and how much data you would have lost.
This is a working procedure for MySQL or MariaDB (logical dumps and physical copies such as XtraBackup) and for PostgreSQL (base backups plus WAL, commonly with pgBackRest). The same discipline applies to a three-node lab and to a fleet.
Why "the backup ran" is not enough
The failures that show up only at restore time are ordinary:
- The backup user could not read every table, so the dump is silently incomplete.
- A physical backup finished, but the encryption key,
xtrabackup_checkpoints, or therecovery.conf/standalone.signalequivalent never made it into the artifact. - PostgreSQL WAL has a gap, or
archive_commandhas been failing for a week while the base backups still uploaded happily. - The backup is from a newer major version than the scratch host, or the plugin and
wsrep/shared_preload_librarieslist does not match. - Credentials, S3 paths, or bucket permissions work for the writer and not for the reader you will be at 03:00.
- The backup is consistent, but restoring it takes fourteen hours, and your documented RTO was one.
A drill is the cheapest way to discover all of those without an incident.
What a drill actually is
A restore drill is not a failover test, and it is not a snapshot of the production host. It is:
- A scratch machine or VM that is allowed to be destroyed, with enough disk for the data directory plus logs.
- One specific backup, identified by time, tool, and storage path — not "whatever is latest" unless that is the object of the test.
- A restore that uses the same tool and credentials you would use in an incident, not a shortcut that only works in the lab.
- A go/no-go check: the instance starts, accepts connections, and passes a small, known set of queries or checksums (row counts on critical tables, a known application login, a replica of a recent transaction you recorded before the backup).
- A written result: start time, end time, backup timestamp, observed RPO (backup time minus last known transaction), observed RTO (wall clock to "accepts traffic"), and any manual steps you had to invent.
Then you throw the scratch instance away. Do not leave a restored copy running on the same network as production with the same names, IPs, or replication settings.
MySQL and MariaDB
Decide which class of backup you are proving.
Logical dumps (mysqldump, mariadb-dump, or mydumper-style tools) are portable and easy to inspect. A drill looks like: provision an empty instance of the same major version, restore the dump, run mysql_upgrade or the vendor equivalent if needed, then run your go/no-go queries. Time both the download and the replay. Logical restores often miss the RTO you assumed, especially once the data no longer fits in a coffee break.
Physical backups (XtraBackup and vendor cousins, or a cold copy of the data directory) restore faster but are pickier. The drill should include: fetch the full backup plus any incremental chain you would need, prepare / apply-log, move the files into a clean data directory, start the server with the same options that production uses for paths and InnoDB settings, and only then run queries. If the cluster is Galera, restore to a standalone node first. Do not join the restored copy back to the live cluster as part of the drill.
If you rely on binlogs for point-in-time recovery, the drill is not finished until you have also applied WAL-equivalent binlogs up to a chosen position and confirmed that a transaction from just before that position is present, and one from just after is not.
PostgreSQL
A PostgreSQL backup is a base backup plus the WAL required to reach a consistent state, and usually more WAL if you want a point in time. With pgBackRest, a typical drill is: create a new stanza directory on the scratch host, restore a known backup set, verify that postgresql.conf and pg_hba.conf are what you expect (especially restore_command or the pgBackRest recover settings), start the instance, let recovery finish, confirm the instance is not still in recovery unless you meant it to be a standby, then run your checks.
Pay attention to:
- Timelines and
recovery_target(time, name, or XID). A drill that only does "restore latest and start" never proves you can stop at a specific moment. - Tablespaces and the exact directory layout. Missing symlink targets fail late.
- Replication slots and archive status on the restored copy. Disable streaming to production.
- Extensions and
shared_preload_libraries. A missing library is a common "it restored but it will not start" failure.
If you run Patroni, still restore onto a host that is not in the live DCS (etcd, Consul, or ZooKeeper) namespace. A restored node that registers itself as a cluster member can start a fight you did not plan to test.
How often, and what to record
For a small production fleet, a full drill every month, and an extra drill whenever the backup path changes (new bucket, new tool version, new encryption, new major version), is a reasonable floor. After a failed drill, run another one as soon as the fix is in, not "next month."
Keep a short log: date, cluster, tool and version, backup identifier, target time if any, RTO, RPO, pass/fail, and the single most surprising manual step. That log is what you bring to capacity planning when someone asks whether the RTO in the runbook is real.
Automate as much of the scratch-host provision and the restore command as you can, but leave a human to look at the go/no-go queries. The point is to catch the surprise, not to produce another green tick that nobody reads.
Jarwis ClusterOps schedules backups to S3-compatible storage on the free Lite plan (up to three nodes). Pro adds automated restore drills that actually restore a backup onto a throwaway target and report whether it started. If you want to see backups and cluster health in a running console, there is a read-only demo at demo.jarwis.com. Setup and retention details are in the docs.