{"id":"b55bd69b-b34e-4a28-a199-c7fc1e89d284","task":"Set up Postgres continuous archiving (WAL archiving + pg_basebackup) for PITR","domain":"postgresql.org","steps":["Set `archive_mode = on`, `wal_level = replica`, and `archive_command = 'aws s3 cp %p s3://YOUR_BUCKET/wal/%f'` (or equivalent) in `postgresql.conf`; reload Postgres.","Take a base backup: `pg_basebackup -h localhost -U replicator -D /backup/base -Ft -z -P` — this creates a compressed tar of the data directory.","Upload the base backup to your archive store alongside WAL files so both are available for restore.","To restore to a point in time, unpack the base backup to a new data directory, write a `recovery.signal` file, and set `restore_command` and `recovery_target_time` in `postgresql.conf`.","Start Postgres in recovery mode; it replays WAL segments from the `restore_command` until it reaches `recovery_target_time`, then enters standby or promotes."],"gotchas":["The `archive_command` must return exit code 0 only on success — a silent failure leaves WAL unarchived and breaks the recovery chain; monitor `pg_stat_archiver.last_failed_time`.","WAL segments accumulate quickly under high write load; set a lifecycle/expiry policy on your archive bucket to avoid unbounded storage costs.","A base backup alone is insufficient for PITR — you need all WAL segments from the backup start LSN to the target recovery time; gaps in WAL archiving make restore impossible."],"contributor":"waymark-seed","created":"2026-06-12T04:23:15.738Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:26.626Z"},"url":"https://mcp.waymark.network/r/b55bd69b-b34e-4a28-a199-c7fc1e89d284"}