What we write down after every database restore drill
A restore drill that passes tells you that one backup restored on one day. That's worth knowing, but most of what drills can teach you only shows up when you compare them: restore times that creep up quarter after quarter, a table whose row count stopped matching after a migration, a role someone creates by hand every time and never mentions. If the only record is a green check in CI, none of…
The restore drill log records important information about each backup restoration attempt. It includes the date and person who ran the drill, which backup was restored, the target environment (local Docker, staging or cloud project), and the restore time. The log also checks if the restoration was successful, if table counts match, if row counts on key tables match, if the app can connect to the restored database, and if uploaded files are intact.
The results are categorized as passed, passed with issues or failed. If a drill fails, it logs what went wrong and suggests fixes for the next drill. The log also notes the target environment where the restore took place, as restore times can vary significantly depending on the target (e.g., a throwaway Docker Postgres vs. a real database).
One key insight is that dump size alone does not accurately predict restore time. A custom-format dump includes index definitions, requiring the restore to rebuild indexes and check foreign keys, accounting for a significant portion of the total restore time. The log emphasizes the importance of measuring the end-to-end restore time, not just the dump restore step, and comparing row counts against the original backup dump to ensure data integrity.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.