# Check your pgbackrest config
cat /etc/pgbackrest/pgbackrest.conf # List your current backup stanzas and their -weight: 500;">status
pgbackrest --stanza=your_db info # Check your repo type (local filesystem, S3, Azure, GCS?)
grep 'repo1-type' /etc/pgbackrest/pgbackrest.conf
# Check your pgbackrest config
cat /etc/pgbackrest/pgbackrest.conf # List your current backup stanzas and their -weight: 500;">status
pgbackrest --stanza=your_db info # Check your repo type (local filesystem, S3, Azure, GCS?)
grep 'repo1-type' /etc/pgbackrest/pgbackrest.conf
# Check your pgbackrest config
cat /etc/pgbackrest/pgbackrest.conf # List your current backup stanzas and their -weight: 500;">status
pgbackrest --stanza=your_db info # Check your repo type (local filesystem, S3, Azure, GCS?)
grep 'repo1-type' /etc/pgbackrest/pgbackrest.conf
# Install Barman
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install barman # Debian/Ubuntu
# or
-weight: 600;">sudo -weight: 500;">yum -weight: 500;">install barman # RHEL/CentOS # Create a Barman configuration for your server
-weight: 600;">sudo cat > /etc/barman.d/main-db.conf << 'EOF'
[main-db]
description = "Main Production Database"
ssh_command = ssh postgres@db-server
conninfo = host=db-server user=barman dbname=postgres
backup_method = postgres
# Use streaming for WAL archiving (replaces pgbackrest archive-push)
streaming_archiver = on
slot_name = barman
streaming_conninfo = host=db-server user=streaming_barman
# Retention: keep 4 full backups (adjust to match your pgbackrest policy)
retention_policy = RECOVERY WINDOW OF 14 DAYS
EOF
# Install Barman
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install barman # Debian/Ubuntu
# or
-weight: 600;">sudo -weight: 500;">yum -weight: 500;">install barman # RHEL/CentOS # Create a Barman configuration for your server
-weight: 600;">sudo cat > /etc/barman.d/main-db.conf << 'EOF'
[main-db]
description = "Main Production Database"
ssh_command = ssh postgres@db-server
conninfo = host=db-server user=barman dbname=postgres
backup_method = postgres
# Use streaming for WAL archiving (replaces pgbackrest archive-push)
streaming_archiver = on
slot_name = barman
streaming_conninfo = host=db-server user=streaming_barman
# Retention: keep 4 full backups (adjust to match your pgbackrest policy)
retention_policy = RECOVERY WINDOW OF 14 DAYS
EOF
# Install Barman
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install barman # Debian/Ubuntu
# or
-weight: 600;">sudo -weight: 500;">yum -weight: 500;">install barman # RHEL/CentOS # Create a Barman configuration for your server
-weight: 600;">sudo cat > /etc/barman.d/main-db.conf << 'EOF'
[main-db]
description = "Main Production Database"
ssh_command = ssh postgres@db-server
conninfo = host=db-server user=barman dbname=postgres
backup_method = postgres
# Use streaming for WAL archiving (replaces pgbackrest archive-push)
streaming_archiver = on
slot_name = barman
streaming_conninfo = host=db-server user=streaming_barman
# Retention: keep 4 full backups (adjust to match your pgbackrest policy)
retention_policy = RECOVERY WINDOW OF 14 DAYS
EOF
# On the PostgreSQL server, create the replication slot
psql -c "SELECT pg_create_physical_replication_slot('barman');" # Back on the Barman server, verify the connection
barman check main-db # Take your first backup
barman backup main-db # Verify it worked
barman list-backup main-db
# On the PostgreSQL server, create the replication slot
psql -c "SELECT pg_create_physical_replication_slot('barman');" # Back on the Barman server, verify the connection
barman check main-db # Take your first backup
barman backup main-db # Verify it worked
barman list-backup main-db
# On the PostgreSQL server, create the replication slot
psql -c "SELECT pg_create_physical_replication_slot('barman');" # Back on the Barman server, verify the connection
barman check main-db # Take your first backup
barman backup main-db # Verify it worked
barman list-backup main-db
# postgresql.conf — old pgbackrest config
# archive_command = 'pgbackrest --stanza=main-db archive-push %p' # Option A: Switch to barman-wal-archive
archive_command = 'barman-wal-archive barman-server main-db %p' # Option B: If using streaming replication with Barman,
# you can use a simple copy as fallback
archive_command = 'cp %p /var/lib/postgresql/wal_archive/%f'
# postgresql.conf — old pgbackrest config
# archive_command = 'pgbackrest --stanza=main-db archive-push %p' # Option A: Switch to barman-wal-archive
archive_command = 'barman-wal-archive barman-server main-db %p' # Option B: If using streaming replication with Barman,
# you can use a simple copy as fallback
archive_command = 'cp %p /var/lib/postgresql/wal_archive/%f'
# postgresql.conf — old pgbackrest config
# archive_command = 'pgbackrest --stanza=main-db archive-push %p' # Option A: Switch to barman-wal-archive
archive_command = 'barman-wal-archive barman-server main-db %p' # Option B: If using streaming replication with Barman,
# you can use a simple copy as fallback
archive_command = 'cp %p /var/lib/postgresql/wal_archive/%f'
-weight: 600;">sudo -weight: 500;">systemctl reload postgresql
-weight: 600;">sudo -weight: 500;">systemctl reload postgresql
-weight: 600;">sudo -weight: 500;">systemctl reload postgresql - Security patches -weight: 500;">stop. Any CVEs discovered going forward won't get fixed upstream.
- New PostgreSQL versions may break compatibility. PostgreSQL 17 and beyond might introduce changes pgbackrest can't handle.
- Bug fixes are on you. That edge case in differential backup you've been meaning to report? It's staying. - Are you using incremental or differential backups?
- What's your retention policy (how many full backups do you keep)?
- Are you backing up to object storage (S3, GCS, Azure) or local disk?
- Do you use encryption at rest?
- Are you using pgbackrest for PITR (point-in-time recovery)?
- Do you rely on parallel backup/restore? - Keep pgbackrest running on its existing schedule
- Run Barman alongside it
- Test a restore from Barman to a staging environment
- Only after a successful test restore, -weight: 500;">disable pgbackrest - Layer your backups. Use a tool like Barman or WAL-G for your primary backup pipeline, but also run periodic pg_dump exports as a secondary safety net. They're slower and larger, but they're format-independent.
- Test restores regularly. Set up a cron job or CI pipeline that restores your latest backup to a throwaway instance at least weekly. If you're not testing restores, you don't have backups.
- Monitor backup health. Whatever tool you use, set up alerts for failed backups, growing backup age, and WAL archive lag. The worst time to discover your backups aren't working is during a recovery.
- Document your recovery procedure. Write a runbook. Actually write it down. Include the exact commands, the expected timelines, and who has access to what. Future-you at 3 AM during an incident will be grateful.