Backup, Restore & Recovery
Cheat sheet · https://pcornel.dk/topic.php?topic=6093
Answer
Backup, restore and recovery protect data: full, differential and log/WAL backups; logical dumps vs physical copies; point-in-time recovery; and regular restore tests.
Remember
Define RPO/RTO first. Keep backups off the server and immutable. A backup is proven only by restoring it.
First checks
SELECT database_name,MAX(backup_finish_date) FROM msdb.dbo.backupset GROUP BY database_name;— first check for this topicpsql -c "SELECT now(), version();"— PostgreSQL reachable and versionmysql -e "SELECT NOW(), VERSION();"— MariaDB/MySQL reachable and versionsqlcmd -S <server> -Q "SELECT @@VERSION"— SQL Server reachable and version
Verify in this order
full + incremental/log backups → stored off-host → restore + replay → verified
Where it usually breaks
Common failures are missing log segments, inconsistent filesystem-only copies, untested encryption keys/credentials, retention deleting a required base/log chain, backups stored on the same failure domain and assuming snapshot success equals application-consistent recovery.
Backup, Restore & Recovery verification boundary matrix
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Logical vs physical backup | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | Full/incremental/differential boundaries / Transaction/WAL/binlog recovery | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | Point-in-time recovery | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | RPO and RTO | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6093