Pcornel
Browse topics
Options
Recent
Favorites
Databases · Technical reference

Backup, Restore & Recovery

Direct 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.

When to use this

Use it to design backups or when you must restore.

First 30 seconds

1. Last successful backup per database (SELECT database_name,MAX(backup_finish_date) FROM msdb.dbo.backupset GROUP BY database_name; / backup tool report).

2. Log/WAL archiving working: SELECT * FROM pg_stat_archiver;?

3. Copies off-host?

4. Restore test date and duration.

5. Encryption and retention.

Operational verification

full + incremental/log backups → stored off-host → restore + replay → verified

Evidence · next step

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. Preserve the first divergent observation and repeat the same bounded verification after remediation.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
What not to infer

Databases owns engine-consistent backup/recovery procedures. Storage owns media/snapshot durability; Automation owns scheduling/orchestration; the recovery evidence belongs to the database outcome.

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 · Databases owns engine-consistent backup/recovery procedures. Storage owns media/snapshot durability; Automation owns scheduling/orchestration; the recovery proof belongs to the database outcome.
Scope / prerequisiteUse it to design backups or when you must restore.
What next?3 suggested next steps
Child topics (this level)3
Evidence1
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 Verification workflow Verify boundary

Record backup type, scope, timestamp/position and required log chain. Restore into an isolated target, run engine consistency checks where appropriate, verify representative data/application reads and measure elapsed recovery time. For PITR, show the exact target time/transaction boundary.

Step 2 Failure signatures and limits Narrow the fault

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.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

test · 1
Drill down

Subtopics

Go one level deeper into this subject.

Key points

Define RPO/RTO first. Keep backups off the server and immutable. A backup is proven only by restoring it.

Key checks
  • SELECT database_name,MAX(backup_finish_date) FROM msdb.dbo.backupset GROUP BY database_name; — 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

Operating model

Backup, Restore & Recovery defines how database state is captured and reconstructed. Logical exports, physical/base backups and log/WAL/binlog streams protect different recovery needs. A backup is only operationally useful when its dependencies are retained and a restore has been confirmed against the required RPO/RTO.

ReferenceHow it works1 section · depth on demand

In depth

Backup, restore and recovery protect databases against hardware failure, corruption, human error and ransomware. The goal is not backups but proven recovery within the agreed recovery point objective (RPO) and recovery time objective (RTO).

Backup typeCharacteristics
Logical (dump)Portable SQL/text; slower restore for large databases
Physical (file-level, hot)Fast restore of whole instance; same version/platform
Continuous log archiving (WAL, binlog, transaction log)Point-in-time recovery
Storage snapshotsFast, must be application-consistent

Recovery practice:

  • Test restores regularly into a separate environment and measure time.
  • Practise point-in-time recovery to just before a mistaken DELETE.
  • Keep copies off-site and immutable; databases are prime ransomware targets.
  • Verify backups with checksums and by restoring, not just by job status.
  • Back up configuration, users/roles and encryption keys too — a restore without TDE keys fails.
ReferenceImportant terms & boundaries1 section · depth on demand

Scope map

  • Logical vs physical backup
  • Full/incremental/differential boundaries
  • Transaction/WAL/binlog recovery
  • Point-in-time recovery
  • RPO and RTO
  • Restore verification
  • Consistency/application-aware backup boundaries
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

PostgreSQL PostgreSQL 14 or laterLogical backup and a test restore into a scratch database.

Assumptions: Run the restore test on a separate server or database; never over production.

pg_dump -h db1 -U backup -Fc -f app_$(date +%F).dump app
createdb -h restore1 app_restore_test
pg_restore -h restore1 -d app_restore_test --no-owner app_$(date +%F).dump
psql -h restore1 -d app_restore_test -c "SELECT count(*) FROM orders;"

Expected output

PostgreSQL PostgreSQL 14 or laterpg_restore --list app_2026-10-25.dump | head -5

Expected state: The dump file is readable and lists the expected archive header and objects.

;
; Archive created at 2026-10-25 02:00:01 UTC
;     dbname: app
;     TOC Entries: 214
;     Compression: gzip
A backup is only proven by a successful restore and a row-count or checksum comparison; a file that exists is not a backup. Illustrative authored output: field layout matches the tool, values will differ in your environment.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-29 · otherMariaDB / PostgreSQL / Microsoft SQL Server concepts PostgreSQL current documentation

Documentation verification: confirms the upstream model used by the Topic. It does not assert local production behavior.

Basis: https://www.postgresql.org/docs/current/backup.html · confidence 92%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
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
backup, restore & recoverydatabase backup restorepoint in time recoveryPITR databasedatabase RPO RTO
Embedded reference data

Quick lookup tables

Backup, Restore & Recovery verification boundary matrix

A compact lookup separating intent, owning component state, effective state and consumer-visible outcome for Backup, Restore & Recovery.

BoundaryInspectHealthy interpretationDo not infer
IntentLogical vs physical backupIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeFull/incremental/differential boundaries / Transaction/WAL/binlog recoveryOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective statePoint-in-time recoveryIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeRPO and RTOThe original bounded check succeeds in the same time windowProduction correctness outside this scope
Depth when you need it

Deep reference

Design & tradeoffs

Scope

Databases owns engine-consistent backup/recovery procedures. Storage owns media/snapshot durability; Automation owns scheduling/orchestration; the recovery evidence belongs to the database outcome.

Confirmation

Confirm action

Continue?