Your backup exists, but does it restore? Full recovery test
Published on 2026-11-14 by frfrand
Procedure to restore code, PostgreSQL, files, secrets, and services in an isolated environment, with RTO and RPO measurement.
# Your backup exists, but does it restore? Full recovery test
A file called backup.zip does not prove that a company can resume operations. To verify continuity, you must reconstruct a functional application, with coherent data, files, configuration, and permissions, without putting production at risk.
1. Define what recovery means
Determine RPO (maximum tolerable temporal data loss) and RTO (maximum target time to recover service). A nightly backup could imply up to almost a day of loss if no other techniques exist; an RTO of one hour is impossible to guarantee without testing. Inventory code, branches, images, database, upload volume, secrets, certificates, DNS, queues, cron, and external services.
2. Prepare an isolated test
Create separate VPS, containers, or networks. Do not connect cron, emails, or real payment integrations to the restored environment. Use test credentials and avoid public exposure of sensitive information. Record backup date, tool, size, checksum, PostgreSQL version, and dependencies.
3. Restore components in order
1. Provision compatible versions of system, runtime, and PostgreSQL. 2. Recover code and dependencies from an identified commit. 3. Import database and user files into consistent paths. 4. Load secrets via a secure mechanism, never inside the repository. 5. Apply migrations only if they correspond to the recovered point and verify compatibility. 6. Start services and validate dependencies and queues.
Example indicative for a correctly performed PostgreSQL custom dump:
createdb -h localhost -U app_restore app_restore
pg_restore -h localhost -U app_restore -d app_restore --exit-on-error backup.dump pg_restore does not work the same for all formats; check beforehand how the file was created. Execute only on a test database, not on production.
4. Verify business, not just processes
Confirm that authorized users log in, that a historical record is present, that images open, that searches return results, and that tasks can be processed in secure mode. Compare counts, referential integrity, and samples with source manifests. Test one read operation and one harmless write operation. Document errors and their causes.
5. Measure and learn
Time from incident declaration to verified restoration. Calculate the age of recovered data and compare it with RPO/RTO. Record manual steps and dependencies of the original administrator. Automate periodic checks, store copies outside the main server, and verify recovery access.
6. Resilience strategy
A backup on the same disk as the app does not protect against disk failures or server compromises. Use retention, credential separation, encryption, remote copies, and protection against malicious deletions when possible. Version infrastructure and document keys needed to decrypt.
Complement with pg_dump and pg_restore and database migrations.
Frequently asked questions
Does a correct backup prove that it restores? No. Should I restore over production? No for a routine test. What is the most important test? Recovering a complete business flow with valid data.