Back up and restore YugabyteDB Anywhere
This page documents the preview version (v2.21). Preview includes features under active development and is for development and testing only. For production, use the stable version (v2024.1). To learn more, see Versioning.
YugabyteDB Anywhere installations include configuration settings, certificates and keys, and other components required for creating and managing YugabyteDB universes.
You can use the YugabyteDB Anywhere yb_platform_backup.sh script to back up an existing YugabyteDB Anywhere server and restore it, when needed, for disaster recovery or migrating to a new server.
Prerequisites
To perform backups and restores in a Replicated environment, you must have a permission to run docker commands. This means that on systems with the default docker configuration, the yb_platform_backup.sh backup and restore script must be run using sudo or run as the root user (or another member of the docker group).
Download the script
Download the version of the backup script that corresponds to the version of YugabyteDB Anywhere that you are backing up and restoring.
For example, if you are running version 2.21.1.0, you can copy the yb_platform_backup.sh script from the yugabyte-db repository using the following wget command:
wget https://raw.githubusercontent.com/yugabyte/yugabyte-db/v2.21.1.0/managed/devops/bin/yb_platform_backup.sh
If you are running a different version of YugabyteDB Anywhere, replace the version number in the command with the correct version number.
Back up a YugabyteDB Anywhere server
To back up a YugabyteDB Anywhere server, perform the following:
-
Run the
yb_platform_backup.shscript using thebackupcommand, as follows:./yb_platform_backup.sh create --output <output_path> [--data_dir <data_dir>] [--exclude_prometheus]The
createcommand runs the backup of the YugabyteDB Anywhere server.--outputspecifies the location (absolute path) for the.taroutput file.--data_dirspecifies the data directory to be backed up. Default is/opt/yugabyte. Use this flag if YugabyteDB Anywhere is not installed in the default location.--exclude_prometheusexcludes Prometheus metrics from the backup. Optional.Note
If you are using versions 2.18.9, 2.20.6, or 2024.1.2 or earlier, add the--disable_version_checkflag if you are specifying a custom data directory (that is, you are not using/opt/yugabyte). -
Verify that the backup
.tarfile, 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 YugabyteDB Anywhere server
To restore the YugabyteDB Anywhere content from your saved backup, perform the following:
-
Copy the backup
.tarfile from your storage location. -
Run the
yb_platform_backup.shscript using therestorecommand:./yb_platform_backup.sh restore --input <input_path> [--destination <destination>]The
restorecommand restores the YugabyteDB Anywhere content.input_pathis the path to the input.tarfile.destinationis optional. It specifies the output location for data. Default is/opt/yugabyte.
Upon completion of the preceding steps, the restored YugabyteDB Anywhere is ready to continue managing your universes and clusters.