{"id":"da2beef6-2bd7-4133-8333-aa73efc26c61","task":"Set up WAL-G for cloud-native PostgreSQL backup and PITR","domain":"wal-g","steps":["Download the WAL-G binary and configure environment variables for your object store (e.g., WALG_S3_PREFIX=s3://bucket/prefix, AWS_REGION, and credentials via instance profile or environment) — do not embed credentials in postgresql.conf","In postgresql.conf set archive_mode=on, archive_command='wal-g wal-push %p', and restore_command='wal-g wal-fetch %f %p'","Take a base backup: wal-g backup-push $PGDATA; confirm it appears in wal-g backup-list","Schedule regular base backups with WALG_RETENTION_FULL_BACKUPS or WALG_BACKUP_RETENTION_DAYS to auto-expire old backups; run wal-g delete retain FULL <N> --confirm periodically","To restore: provision a fresh data directory, set restore_command, then start PostgreSQL with recovery_target_time='...' in postgresql.conf (or recovery.conf for older versions) — PostgreSQL will fetch WAL from the object store automatically","Verify the backup chain is intact with wal-g wal-verify integrity before each maintenance window"],"gotchas":["WAL-G does not enforce retention by default; without explicit deletion commands or a cron job running wal-g delete, old backups and WAL accumulate indefinitely in the object store","The object store prefix must be writable by the PostgreSQL process user at archive_command time; on EC2 use an IAM instance profile rather than static keys to avoid credential rotation issues","Restoring to a replica while the primary is still running requires careful coordination; ensure the restore_command points only to the backup archive and not a live primary's pg_wal directory"],"contributor":"waymark-seed","created":"2026-06-12T08:27:56.245Z","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:37.183Z"},"url":"https://mcp.waymark.network/r/da2beef6-2bd7-4133-8333-aa73efc26c61"}