The Disaster Recovery (DR) procedure is defined as the series of manual steps that you need to take to recover your HM installation and your HM-managed Postgres clusters.
Warning
You must constantly test and update your organization's DR procedure for it to remain valid.
Before you start
Before starting the DR procedure, ensure you have made yourself familiar with:
Prerequisites
A new HM instance deployed and running. It must be running the same version as the old instance that failed or became unavailable.
The container images used to build the clusters in the old, unavailable HM instance are available to the new one.
Required tools
Ensure the following tools are available on your workstation environment or Bastion host:
edbctl(EDB Hybrid Manager CLI - see the documentation)jq(Command-line JSON processor)yq(Command-line YAML processor)
1. Make backups available in the new HM instance
The first step ensures the backups of the unavailable HM instance (“old backups”) are reachable from the new HM instance by copying the backups of the damaged HM instance to the linked storage (new bucket) of the new HM instance.
Obtain the bucket names, the backup ID, and the region of the new bucket. Store these as environment variables to be used in the commands throughout this guide:
Important
These variables are session-specific. If you open a new terminal tab or your session times out, the variables will be lost, and subsequent commands will fail. To avoid re-typing these values, you could save these export commands into a small shell script (e.g.,
dr-env.sh). You can then "source" that file in any new terminal window to instantly reload your environmentexport OLD_BUCKET=<old-bucket-name> export OLD_BACKUP_ID=<old-environment-internal-backup-id> export NEW_BUCKET=<new-bucket-name> export NEW_REGION=<region-of-the-new-bucket>
How do I obtain the old bucket values?
To obtain the old bucket values:
- Go to the console/dashboard of your CSP > buckets.
- Find and select the bucket linked to the backups of your old HM instance.
- Browse through to the
edb-internal-backupsfolder. Inside that folder you will find a subfolder with the backup ID, e.g. 4be7a1c8c9f0.
EKS Example
This is an example for setting the environment variables for an HM instance deployed on EKS:
export OLD_BUCKET=eks-1105143903-2511-edb-postgres export OLD_BACKUP_ID=a7462dbc7106 export NEW_BUCKET=eks-1105155418-2511-edb-postgres export NEW_REGION=eu-west-3
To copy the data from the old bucket to the new bucket, you first need to locate and note the names of the source and target folders. You need to copy the following folders and their content:
Internal EDB backups folder — The internal backups folder in the old bucket
edb-internal-backups/<random-string>is different in the new HM instance, as it will have a different<random-string>.Postgres clusters backups folder —
customer-pg-backups.Folder corresponding to any defined custom storage locations — If you utilize Managed Storage Locations in the HM console (e.g., for offloading Postgres queries), you must ensure the corresponding folders are copied from the old S3-compatible bucket to the new one. While the definitions are restored via Velero, the actual data inside those custom folders must be manually migrated to the new target bucket.
Copy the old backups to the new bucket using your preferred tools. Here are some examples using cloud service provider CLIs to move data between buckets:
aws s3 cp --recursive s3://${OLD_BUCKET}/edb-internal-backups/${OLD_BACKUP_ID} s3://${NEW_BUCKET}/edb-internal-backups aws s3 cp --recursive s3://${OLD_BUCKET}/customer-pg-backups s3://${NEW_BUCKET}/customer-pg-backups
If you have configured additional Managed Storage Locations, use the same method to copy those folders.
gcloud storage cp gs://${OLD_BUCKET}/edb-internal-backups/${OLD_BACKUP_ID} gs://${NEW_BUCKET}/edb-internal-backups --recursive gcloud storage cp gs://${OLD_BUCKET}/customer-pg-backups gs://${NEW_BUCKET}/customer-pg-backups --recursive
If you have configured additional Managed Storage Locations, use the same method to copy those folders.
Load the backups you just copied to your new HM instance by creating a new custom resource definition and applying it to the new HM instance: