Take a physical base backup suitable for replication or disaster recovery.
Section: Cluster-wide Backup and Migration
Physical base backup
bash
bash
pg_basebackup -h primary-db -U replicator -D /backups/base -Fp -Xs -PExplanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Cluster-wide Backup and Migration
Run pg_upgrade check
Check whether an in-place major upgrade is feasible.
Analyze upgraded cluster
Collect statistics after a fresh restore or upgrade.