A database restore is the process of rebuilding a database from backup copies, and often from archived transaction logs, so that it returns to a known, transactionally consistent state. In Backup & recovery for databases, the restore is the step that turns stored backups into a working system again after hardware failure, corruption, accidental deletion, ransomware or a request for a historical copy.
A backup has value only if it can be restored within the time the business can tolerate. For that reason, experienced administrators treat the restore, not the backup, as the real deliverable, and they measure it against two targets: the recovery time objective (RTO) and the recovery point objective (RPO).
How a database restore works
A database restore usually runs in three phases: copy, roll forward and recover. First, the engine or a backup tool copies data files or replays a logical dump onto the target storage. Second, it applies archived logs to move the data forward in time. Third, it rolls back transactions that were not committed at the chosen point, then opens the database for use.
The roll-forward phase depends on the write-ahead log, called the WAL in PostgreSQL, the binary log in MySQL, the transaction log in SQL Server and redo logs in Oracle. Every committed change is written to this log before it reaches the data files, so replaying the log over an older base backup reconstructs every later commit. Stopping the replay at a chosen timestamp or log position is what makes point-in-time recovery possible.
The table below shows what each phase does and what typically limits its speed.
| Phase | What happens | Main speed limit |
|---|---|---|
| Copy or reload | Base backup files are written to disk or a dump is replayed | Storage and network throughput |
| Roll forward | Archived logs are applied in sequence | Volume of log since the base backup |
| Undo | Uncommitted transactions are rolled back | Size of open transactions |
| Validation | Consistency checks and application tests | Database size and test depth |
Restore types and their scope
Restores differ by what source they start from and how much they bring back. The type available is decided at backup time: a restore cannot recover a point in time for which neither a base backup nor a continuous log chain exists.
| Restore type | Source | Granularity | Typical use |
|---|---|---|---|
| Full restore | Full physical backup | Whole instance at backup time | Server loss or rebuild |
| Point-in-time restore | Base backup plus log chain | Any moment in the log range | Undoing a harmful change |
| Logical restore | Dump from pg_dump or mysqldump | Database, schema or table | Migration or selective recovery |
| Differential or incremental restore | Full backup plus change sets | Time of the last change set | Shorter backup windows |
| Snapshot restore | Storage or cloud volume snapshot | Moment of the snapshot | Fast rollback of large volumes |
| Page or file restore | Physical backup plus logs | Damaged pages or files | Localized corruption |
A logical restore replays SQL statements or rows and rebuilds indexes, so it is portable across versions and platforms but much slower for large databases. A physical restore copies data files block by block, which is fast but generally requires the same major engine version and a compatible platform.
Restore compared with related recovery processes
A database restore is often confused with neighboring mechanisms that also bring data back. The key difference is that a restore starts from a stored backup, while the others work from a running system or its own logs.
| Mechanism | Starting point | Triggered by | Protects against |
|---|---|---|---|
| Database restore | Backup files and archived logs | Administrator or automation | Loss, corruption, human error |
| Crash recovery | Data files and the live log | Engine at startup | Power loss and process crashes |
| Failover | Running replica | Cluster manager or operator | Primary server outage |
| Log shipping | Continuously applied log copies | Scheduled jobs | Site or server loss |
Replication is not a substitute for a restore. A replica faithfully copies a mistaken DROP TABLE or encrypted ransomware data within seconds, so only an independent backup with a log chain can return the database to the moment before the damage.
Planning a reliable restore
A reliable restore is designed backward from the RTO and RPO. If the business accepts at most fifteen minutes of lost data, logs must be archived at least that often; if the system must be back within one hour, the restore path must be fast enough for the full data volume, including roll forward.
- Test restores regularly on separate hardware, ideally automated weekly or monthly, and record the measured duration.
- Verify the full log chain, because one missing log segment stops point-in-time recovery at the gap.
- Keep an offline or immutable copy so that ransomware or a compromised administrator account cannot delete every backup.
- Document the runbook, including encryption keys, credentials, target versions and the order of dependent databases.
- Restore to a separate instance first when recovering a single table, then copy the needed rows back.
Restore speed is dominated by data volume and log volume. As a rough guide, a physical restore runs at the throughput of the slowest link in the storage and network path, while a logical restore of hundreds of gigabytes can take many hours because every index is rebuilt.
Common restore failures and fixes
Most failed restores trace back to untested assumptions made at backup time. The table below lists frequent symptoms seen during real incidents.
| Symptom | Likely cause | Remedy |
|---|---|---|
| Recovery stops early | Missing or corrupted log file | Monitor archive continuity and checksums |
| Restore takes far longer than RTO | Logical dump of a large database | Use physical backups or snapshots |
| Backup cannot be decrypted | Lost encryption key or certificate | Store keys separately and test them |
| Application errors after restore | Related databases restored to different times | Restore dependent systems to one point |
| Version mismatch error | Target engine differs from source | Keep matching binaries for recovery |
The short version
A database restore is how a system gets its data back from a saved copy. Imagine a writer who saves a copy of a manuscript every night and also keeps a diary of every edit made during the day. If the laptop breaks at noon, the writer takes the nightly copy and repeats the morning edits from the diary.
Databases work the same way. The backup is the nightly copy, and the transaction log is the diary. The essential lesson is that a backup counts only once a restore has been tested.
Where it makes a difference
An online booking service runs a 900 GB PostgreSQL database with a nightly base backup and continuous WAL archiving to separate object storage. At 14:32 on a Tuesday, a developer runs a migration script against production by mistake and deletes the payments history for the current month. The replica copies the deletion immediately, so failover does not help.
The database team restores the previous night’s base backup to a new server, replays the archived WAL and sets the recovery target to 14:31. The physical copy takes about 70 minutes and roll forward about 25 minutes. They export the missing payment rows from the restored instance and load them back into production. The outcome is no lost payments and under two hours of partial disruption, well inside the agreed four-hour RTO.