A database backup is a copy of a database's data, and often its schema, stored separately so it can be restored after data loss. Backups may be logical (SQL dumps) or physical (copies of data files).
Why it matters
Backups are your last defense against mistakes, ransomware, and failed upgrades. Replicas do not replace them, since bad changes replicate instantly. Point-in-time recovery, which combines a base backup with archived transaction logs, lets you rewind to just before an incident. A backup you have never restored is only a hope, not a plan.
Example
# Logical dumps
mysqldump --single-transaction appdb > appdb.sql
pg_dump -Fc appdb > appdb.dump
# Restore test
pg_restore -d appdb_test appdb.dump
Common mistakes
- Never testing a restore, then finding the backups are incomplete or unusable.
- Storing backups on the same server or disk as the database.
- Keeping no retention schedule, so the corruption you notice on Monday has already overwritten every copy.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.