WarehousePG Disaster Recovery (whpg-dr) is a command-line tool for protecting WarehousePG (WHPG) clusters against data loss and extended outages. It takes physical backups of your cluster's coordinator and segment data directories, ships write-ahead log (WAL) files to a secondary storage repository, and lets you restore the cluster to any restore point on the same infrastructure or different infrastructure.
Key capabilities
- Three DR modes:
- Cold DR for on-demand restore at failover time
- Warm DR for a continuously current standby with low RTO
- Point-in-time recovery for restoring to a specific past state
- Back up the entire cluster in parallel to a POSIX-compliant filesystem such as NFS, or S3-compatible storage
- Restore to any point in time, whether to recover from data loss or inspect historical cluster state
- Advance an already-restored cluster to a later restore point without a full re-restore, enabling warm DR with low RTO
- Promote a restored cluster to a writable primary in a single command
How WarehousePG Disaster Recovery works
WarehousePG Disaster Recovery wraps Barman as its backup and restore engine, giving you a purpose-built CLI for WarehousePG while Barman handles the low-level mechanics. Each segment has its own Barman process, so backups and restores run in parallel across all segments automatically.
The storage repository, an NFS share or an S3-compatible object store, connects the primary and DR sites. whpg-dr requires no persistent link between the two clusters other than shared access to the repository. See Understanding disaster recovery for a deeper explanation of how these pieces fit together.
DR modes
WarehousePG Disaster Recovery supports three operational modes:
- Cold DR: The DR cluster doesn't need to exist until a failure occurs. Backups and WAL sit in storage, and you restore on demand. Recovery Time Objective (RTO) is higher than warm DR because provisioning and a full restore are required at failover time, but infrastructure cost is lower.
- PITR (point-in-time recovery): Restores the cluster to any restore point in storage, regardless of whether a DR cluster currently exists. Use it to recover from data corruption or to inspect the database as it was at a specific past point.
- Warm DR: A pre-provisioned DR cluster keeps pace with the primary by replaying WAL at a regular interval. The cluster remains in recovery mode (not queryable) until you promote it. RTO is low because the data is mostly current.
Release notes
Release notes provide information on what's new in each release of WarehousePG Disaster Recovery.
Overview
Learn about the architecture, DR modes, and key concepts for WarehousePG Disaster Recovery.
Setting up the primary cluster
Set up the storage repository and install and configure whpg-dr on the primary WarehousePG cluster.
Setting up the DR cluster
Create a restore configuration YAML file and run whpg-dr configure restore to prepare the DR cluster for WAL replay.
Choosing a recovery method
Choose a recovery scenario — cold DR, point-in-time recovery, or warm DR — and follow the end-to-end procedure.
Troubleshooting
Diagnose and resolve common issues with whpg-dr backup, restore, and configuration.
Reference
Reference documentation for whpg-dr commands and configuration schemas.