Backup and Recovery
Table of Contents
Introduction: The Backup I Never Made
Backup Strategies Overview
Strategy
Recovery Point
Recovery Time
Use Case
pg_dump: Logical Backups
Basic Usage
pg_dump Formats
Format
Flag
Notes
Selective Dumps
Dump All Databases
pg_basebackup: Physical Backups
Create a Replication Role for Backups
Continuous Archiving and PITR
Configure WAL Archiving
Full Backup + WAL Archive Workflow
Point-in-Time Recovery
Restoring from Backups
Restore from pg_dump
Restore Specific Tables (Emergency Recovery)
Verify Restored Data
Backup Automation and Scheduling
Shell Script for Daily Backups
Scheduling with Cron
Scheduling with pg_cron
Verifying Your Backups
Replication for High Availability
Setting Up a Standby Server
Failover
Cloud Backup Solutions
Service
Backup Type
PITR
Retention
Disaster Recovery Planning
Recovery Time Objective (RTO) and Recovery Point Objective (RPO)
RPO
RPO
Strategy
Runbook Template
What I Learned About Backups
Next Steps
Last updated