Pcornel
Browse topics
Options
Recent
Favorites
Databases · Technical reference

Restore Testing

Direct answer

Restore testing regularly restores backups into a separate environment and checks that the data and application work, proving RPO and RTO.

When to use this

Use it to prove backups work.

First 30 seconds

1. Pick the latest backup.

2. Restore to a test instance.

3. Integrity: DBCC CHECKDB / pg_amcheck / row counts.

4. App smoke test.

5. Record duration and result.

Operational verification

backup → restore → integrity checks → app test → report

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
MariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
Scope / prerequisiteUse it to prove backups work.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Confirm the test uses the off-site copy, not a local file. Review the restore time trend as data grows.

Step 2 Common failures Narrow the fault

Encryption keys stored only on the lost server make backups unusable. Backups that silently skip a database are only found during a restore. Restore time grows with data until it exceeds the RTO.

Key points

Automate it. Check integrity (row counts, checksums, DBCC CHECKDB, app smoke tests). Record time taken.

Key checks
  • DBCC CHECKDB — first check for this topic
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version
ReferenceWhat it is1 section · depth on demand

How it works

Automated restore tests run the same steps a real recovery would need, including fetching from off-site storage and decrypting. They expose missing keys, wrong permissions and corrupt files early.

ReferenceImportant terms & boundaries3 sections · depth on demand

Restore test checklist

  • Restore to a separate server regularly (monthly for critical databases).
  • Check integrity: pg_amcheck, mysqlcheck, DBCC CHECKDB.
  • Run application smoke tests or row-count comparisons.
  • Measure restore time against RTO and data age against RPO.
  • Test PITR, not just full restores.
  • Document the results as evidence.

In depth

What a restore test must prove

QuestionEvidence
Can we get the backup at all?Fetched from the off-site/immutable copy, decrypted with the escrowed key
Is it complete?Every expected database, schema and table present; row counts compared with production
Is it intact?Integrity check passes (below)
Is it current enough?Newest transaction timestamp within the RPO
Is it fast enough?Measured total time within the RTO
Does the application work?Smoke test: log in, read and write a test record

Integrity checks per engine

pg_amcheck --all -j 4 --heapallindexed            # PostgreSQL 14+: heap and B-tree checks
mysqlcheck --all-databases --check                  # MySQL / MariaDB
DBCC CHECKDB (shop) WITH NO_INFOMSGS, ALL_ERRORMSGS; -- SQL Server

Automating it

A scheduled job (weekly for critical systems, at least monthly otherwise) that restores the latest backup to a throwaway server, runs the checks and a few known queries, records duration and result, and alerts on failure or on a restore time trend that approaches the RTO. Restore to a time a few minutes ago as well, to prove the log archive (PITR) works, not only the base backup.

Record the result

Keep a short log per test: backup ID, restore duration, data timestamp, checks run, outcome. A backup that has never been restored has unknown value; the record is what shows it does.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Restores never tested end to end.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
restore testingbackup restore testrecovery time objective
Confirmation

Confirm action

Continue?