Databases and messaging ยท Practice and architecture
PostgreSQL and MySQL: how to test a backup restore
A successful backup job does not prove the application can return to service. A recovery exercise must cover backup completeness, dependent credentials, data behavior and elapsed time.
Define acceptable loss and downtime
RPO describes tolerable data loss, and RTO describes tolerable recovery time. Agree objectives with the service owner before choosing backup frequency and recovery method. Do not assume every database needs the same objectives.
Rehearse recovery outside production
Choose a specific backup and restore it in an isolated environment with agreed access. If the recovery plan includes a point in time, test that all required logs are available and record the point restored.
Verify the application can connect, read expected data and perform a controlled write. The exercise ends when the service works, not when a backup utility exits.
Record evidence of actual recovery capacity
Note elapsed time, missing steps and gaps against the target. Assign someone to repeat the exercise following migrations, backup changes or substantial data growth.