---
title: "Keep point-in-time recovery for busy · Agent Wranglers"
url: https://agentwranglers.se/playbook/data/backups-and-recovery/point-in-time-recovery
updated: 2026-10-20
licence: "All rights reserved"
---

# Keep point-in-time recovery for busy databases

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Backups and recovery](https://agentwranglers.se/playbook/data/backups-and-recovery)
- Rule: Where losing a day of writes is not acceptable, keep the database's change log, so you can restore to any moment.
- How: In PostgreSQL, archive the write-ahead log with a tool such as pgBackRest or WAL-G. In MySQL, keep the binary log. Managed databases offer it as a setting. It also undoes mistakes, such as a bad `DELETE`, by restoring to the minute before.
- Check: Restore a staging copy to a chosen time 10 minutes ago. A row written 5 minutes ago is missing, and one written 15 minutes ago is there.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers data playbook: https://agentwranglers.se/playbook/data/backups-and-recovery/point-in-time-recovery`.

- Previous: [Encrypt backups](https://agentwranglers.se/playbook/data/backups-and-recovery/encrypted-backups)
- Next: [Prove restores work](https://agentwranglers.se/playbook/data/backups-and-recovery/restore-tests)
- [Backups and recovery](https://agentwranglers.se/playbook/data/backups-and-recovery)
