The edbctl disaster-recovery command manages disaster recovery (DR) operations for HM-internal database clusters. Use it to create restore ObjectStore custom resources and prepare cluster configurations for DR bootstrap. You can also use the edbctl dr alias for this command.
Commands
edbctl disaster-recovery command has the following options:
- edbctl disaster-recovery create-restore-objectstores — Create the restore ObjectStore CRs for disaster recovery, for the HM-internal database clusters.
- edbctl disaster-recovery prepare-cluster-configs — Prepare cluster configs for disaster recovery, for the HM-internal database clusters.
edbctl disaster-recovery create-restore-objectstores
For each CloudNativePG (CNPG) cluster that uses the Barman plugin, creates an ObjectStore custom resource (with a name ending in -restore) with a transformed destination path for disaster recovery. Clusters with an inline barmanObjectStore config are skipped.
Only HM-internal clusters are included. Customer clusters with names starting with p- and the stats-collector-db cluster are excluded.
Run this command before running prepare-cluster-configs.
edbctl disaster-recovery create-restore-objectstores [options]
Where options are:
--dry-run Preview the ObjectStore CRs that would be created without applying them. -y, --yes Auto-confirm all confirmations. -h, --help Help for create-restore-objectstores.
These examples show how to create restore ObjectStore CRs:
edbctl dr create-restore-objectstores edbctl dr create-restore-objectstores --dry-run
edbctl disaster-recovery prepare-cluster-configs
Downloads CNPG Cluster custom resources from the current Kubernetes context and prepares modified configurations for disaster recovery bootstrap. Original configs are saved as backups, and new configs are written with recovery bootstrap settings.
This command does not apply any changes to the cluster. Run create-restore-objectstores first to create the restore ObjectStore CRs before running this command.
Only HM-internal clusters are included. Customer clusters with names starting with p- and the stats-collector-db cluster are excluded.
edbctl disaster-recovery prepare-cluster-configs --old-backup-id <backup-id> [options]
Where options are:
--old-backup-id string The backup ID from the old system (required). -o, --output-dir string Base output directory for generated configs (default "."). -h, --help Help for prepare-cluster-configs.
This example shows how to prepare cluster configs for disaster recovery:
edbctl dr prepare-cluster-configs --old-backup-id abc123