Emergency CheatsheetCODE: 013-DATABASE-BACKUP-RESTORE⏱️ ~7 min read
PostgreSQL Backup & Disaster Recovery: pg_dump, WAL Archiving & PITR
Zero-data-loss database disaster recovery runbook: logical backups, continuous WAL archiving, and point-in-time recovery testing.
Authored by: Vibe DevOps · Published: 10/21/2026
A database backup policy is only as reliable as its tested restore process. Best practices for PostgreSQL physical and logical backups using pg_dump and Point-In-Time Recovery.
1. Logical Backup with pg_dump
pg_dump -U postgres -h localhost -Fc -f backup_$(date +%Y%m%d_%H%M%S).dump <dbname>
2. Safe Database Restoration
pg_restore -U postgres -h localhost -d <dbname> --clean --if-exists backup.dump
💡 Team Storage & Usage Tips
Store the vector PDF in your internal team repository (Notion, Confluence) or print it out in A4 format next to your workstation for rapid troubleshooting during midnight production outages.