Configure pgBackRest for PostgreSQL base backups and point-in-time recovery

domain: pgbackrest · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install pgBackRest on the database server and a repository host (or use an S3-compatible object store); create /etc/pgbackrest/pgbackrest.conf with [global] and [stanza-name] sections defining repo1-path and pg1-path
  2. In postgresql.conf set archive_mode=on and archive_command='pgbackrest --stanza=main archive-push %p'; also set wal_level=replica
  3. Initialize the stanza: pgbackrest --stanza=main stanza-create, then run a full backup: pgbackrest --stanza=main --type=full backup
  4. Schedule incremental backups with cron; pgBackRest automatically expires old backups per repo1-retention-full and retains WAL to support PITR across retained backups
  5. To restore to a point in time: stop PostgreSQL, run pgbackrest --stanza=main --type=time '--target=2025-06-10 14:30:00' --target-action=promote restore, then start PostgreSQL
  6. Verify backup integrity periodically with pgbackrest --stanza=main check and pgbackrest info

Known gotchas

Related routes

Set up Postgres continuous archiving (WAL archiving + pg_basebackup) for PITR
postgresql.org · 5 steps · unrated
Set up WAL-G for cloud-native PostgreSQL backup and PITR
wal-g · 6 steps · unrated
Configure quorum-based synchronous replication in PostgreSQL with synchronous_standby_names ANY
postgresql.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans