Back Up and Restore Yugabyte Platform on Kubernetes
Yugabyte Platform installations include configuration settings, certificates and keys, and other components required for orchestrating and managing YugabyteDB universes.
You can use the Yugabyte Platform backup script to back up an existing Yugabyte Platform server and restore it, when needed, for disaster recovery or migrating to a new server.
Note
You cannot back up and restore Prometheus metrics data.The Yugabyte Platform console is used in a highly available mode and orchestrates and manages YugabyteDB universes, or clusters, on one or more regions (across public cloud and private on-premises data centers). For details, see Yugabyte Platform overview.
Back Up a Yugabyte Platform Server
You can back up the Yugabyte Platform server as follows:
-
Copy the Yugabyte Platform backup script
yb_platform_backup.sh
from the yugabyte-db repository to your local workstation using the following wget command:wget https://raw.githubusercontent.com/yugabyte/yugabyte-db/master/managed/devops/bin/yb_platform_backup.sh
-
Verify that the computer performing the backup operation can access the Yugabyte Platform kubernetes pod instance by executing the following command:
kubectl exec --namespace <k8s_namespace> -it <k8s_pod> -c yugaware -- cat /opt/yugabyte/yugaware/README.md
k8s_namespace specifies the kubernetes namespace where the Yugabyte Platform pod is running.
k8s_pod specifies the name of the Yugabyte Platform kubernetes pod. -
Run the
yb_platform_backup.sh
script using thecreate
command, as follows:./yb_platform_backup.sh create --output <output_path> --k8s_namespace <k8s_namespace> --k8s_pod <k8s_pod> [--exclude_releases --verbose]
backup is the command to run the backup of the Yugabyte Platform server.
output_path specifies the location for the output backup archive.
k8s_namespace specifies the Kubernetes namespace in which the Yugabyte Platform pod is running.
k8s_pod specifies the name of the Yugabyte Platform Kubernetes pod.
exclude_releases excludes Yugabyte releases from the backup archive.
verbose prints debug output.
-
Verify that the backup
.tar.gz
file, with the correct timestamp, is in the specified output directory. -
Upload the backup file to your preferred storage location, and delete it from the local disk.
Restore a Yugabyte Platform Server
To restore the Yugabyte Platform content from your saved backup, perform the following:
-
Copy the Yugabyte Platform backup script yb_platform_backup.sh` from the yugabyte-db repository to your local workstation using the following wget command:
wget https://raw.githubusercontent.com/yugabyte/yugabyte-db/master/managed/devops/bin/yb_platform_backup.sh
-
Execute the following command to verify that the computer performing the backup operation can access the Yugabyte Platform kubernetes pod instance:
kubectl exec --namespace <k8s_namespace> -it <k8s_pod> -c yugaware -- cat /opt/yugabyte/yugaware/README.md
k8s_namespace specifies the kubernetes namespace where the Yugabyte Platform pod is running.
k8s_pod specifies the name of the Yugabyte Platform kubernetes pod.
-
Run the
yb_platform_backup.sh
script using therestore
command:./yb_platform_backup.sh restore --input <input_path> --k8s_namespace <k8s_namespace> --k8s_pod <k8s_pod> [--verbose]
restore restores the Yugabyte Platform server content.
input_path is the path to the
.tar.gz
backup file to restore.k8s_namespace specifies the kubernetes namespace where the Yugabyte Platform pod is running.
k8s_pod specifies the name of the Yugabyte Platform Kubernetes pod.
verbose prints debug output.
Upon completion of the preceding steps, the restored Yugabyte Platform is ready to continue orchestrating and managing your universes and clusters.