PostgreSQL backup and restore

Prove that a base backup and archived WAL can recover to a chosen point.

Last updated

On this page (5)

PostgreSQL ยท Backup and restore

Before you start

  • Compatible isolated PostgreSQL instance; base backup and a continuous WAL archive covering the target.
  • Known transaction markers around the recovery target and sufficient restore space.

Procedure

  1. Select a base backup preceding the target and inventory the matching WAL and any timeline history needed.
  2. Run pg_verifybackup where the backup has a usable manifest, then restore to a fresh data directory and configure archive recovery and the intended target using version-matched docs.
  3. Replay on the isolated instance without pointing it to production clients or allowing writes to the production WAL archive.

Verify the result

  • Verify the expected pre-target transaction exists and the known post-target transaction does not; run an application read smoke test.
  • Record the recovered boundary and elapsed time; a passing manifest check by itself is not a restore.

Official documentation

Have Pilae operate PostgreSQL

We agree what to monitor, how to recover and who responds when something breaks. Bring your existing deployment or start with a new one.