Point-in-Time Recovery Techniques
Point-in-time recovery restores a database to its state immediately before a chosen moment. It combines an earlier backup with a continuous record of later changes, then replays those changes only as far as the selected recovery target.
itDatabases and data storage | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Point-in-Time Recovery Techniques
Point-in-time recovery, or PITR, is what you use when a database was correct at lunch and deeply unhelpful shortly afterward. It rebuilds an earlier state, then replays the recorded changes until a chosen boundary. This is not a time machine in the theatrical sense. It is a careful reconstruction with receipts.
The two pieces that matter are the baseline backup, a saved database state, and the change log, the ordered journal of later changes. PostgreSQL calls its journal WAL, while other engines have their own names. Together they form a recovery chain. A backup without its later journal cannot reach the interesting bit. A journal without its baseline is an excellent record of a journey with no starting point.
The surprising part is that choosing the target is often harder than replaying to it. A timestamp can be misleading when clocks, time zones, and close commits disagree. A transaction identifier, log position, or named restore point can give a sharper boundary when the evidence exists. The target must also sit inside the recovery window, where the baseline, every required log, keys, and compatible software are still available.
Restore somewhere separate from the source. That keeps the original evidence intact and gives you room to test a nearby target without making the incident larger, which is a kindness to everyone involved. When the restored database opens, the job has only reached its first checkpoint. Check rows, constraints, permissions, critical queries, and the services that depend on them.
PITR rewinds the protected database scope, not the rest of reality. Email, payments, webhooks, and valid work after the target do not politely reverse themselves. The later valid work needs reconciliation from the original system or its records. The source also explains the chain, which is another reason not to overwrite it in a hurry.
Read the Intro for the recovery path and its limits. Use the Slides for the moving parts and decision points. Keep the Cheatsheet nearby during an incident or rehearsal. The Practice reference and exercise turn the mental model into an isolated PostgreSQL restore drill. The Quiz checks whether the chain, target, and validation steps are still in the right order after the coffee has worn off.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-34r1.pdf
Supports
- Recovery point and recovery time objectives
- Recovery testing, validation, reconstitution, and dependency planning
- https://www.postgresql.org/docs/current/continuous-archiving.html
Supports
- Baseline backup plus archived WAL recovery pattern
- Continuous WAL requirements, recovery targets, replay, and timelines
- PostgreSQL target types and recovery-chain failure behavior
- https://dev.mysql.com/doc/refman/8.4/en/point-in-time-recovery-binlog.html
Supports
- Full backup plus binary-log recovery pattern
- Time and event-position recovery choices
- https://dev.mysql.com/doc/refman/8.4/en/point-in-time-recovery-positions.html
Supports
- Binary-log event-position targeting around an unwanted statement
- https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/restore-a-sql-server-database-to-a-point-in-time-full-recovery-model?view=sql-server-ver17
Supports
- Full or differential backup followed by ordered log restores
- STOPAT behavior and full or bulk-logged recovery-model limits
- https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/apply-transaction-log-backups-sql-server?view=sql-server-ver17
Supports
- Chronological log application and the consequence of a missing log backup
- https://docs.oracle.com/en/database/oracle/oracle-database/26/bradv/rman-performing-flashback-dbpitr.html
Supports
- Backup, incremental backup, and redo application for database PITR
- Time, SCN, log sequence, and restore-point targets
- PITR use cases and Oracle incarnation behavior
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html
Supports
- Custom and latest-restorable-time recovery to a new RDS instance
- Retention-window and destination configuration behavior
- https://learn.microsoft.com/en-us/azure/azure-sql/database/recovery-using-backups?view=azuresql
Supports
- Azure SQL point-in-time restore within retention to a new database
- Managed backup access and destination constraints
- https://cloud.google.com/sql/docs/postgres/backup-recovery/pitr
Supports
- Cloud SQL for PostgreSQL point-in-time recovery operations and destinations
- https://www.mongodb.com/docs/atlas/backup/cloud-backup/configure-backup-policy/
Supports
- Oplog replay for point-in-time restore within an Atlas restore window
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the Database Tools and PostgreSQL awesome lists
- https://github.com/mgramin/awesome-db-tools
Supports
- Discovery of Barman, pgBackRest, and other database backup tools
- https://github.com/dhamaniasad/awesome-postgres
Supports
- Discovery of Barman, pgBackRest, WAL-G, and pitrery in the PostgreSQL backup ecosystem
- https://pgbackrest.org/user-guide.html
Supports
- pgBackRest baseline, WAL archive, target selection, restore, and validation workflow
- https://docs.pgbarman.org/release/3.12.1/user_guide/recovery.html
Supports
- Barman time, transaction, LSN, and named targets plus recovery actions
- https://wal-g.readthedocs.io/
Supports
- WAL-G archival and restore scope across PostgreSQL, MySQL, and SQL Server
- https://dalibo.github.io/pitrery/
Supports
- pitrery management of PostgreSQL PITR backups and WAL archives
- https://www.postgresql.org/
Supports
- PostgreSQL product identity and licensing
- https://www.mysql.com/
Supports
- MySQL product identity and Community and commercial editions
- https://www.microsoft.com/en-us/sql-server/
Supports
- SQL Server product identity and commercial positioning
- https://www.oracle.com/database/
Supports
- Oracle Database product identity and commercial positioning
- https://aws.amazon.com/rds/
Supports
- Amazon RDS managed database identity and engine coverage
- https://azure.microsoft.com/en-us/products/azure-sql/database
Supports
- Azure SQL Database managed-service identity
- https://cloud.google.com/sql
Supports
- Cloud SQL managed-service identity and engine coverage
- https://www.mongodb.com/atlas
Supports
- MongoDB Atlas managed-service identity and cloud backup context
