Environment
- Yugabyte yb-anywhere - 2.15x
Issue
Sometimes customers want to migrate their existing yb-anywhere instance which manages one of more universes to a new yb-anywhere instance retaining all the functionality to manage their existing Universes.
We have scripts to carry out the backup and restore of the meta data which is documented.
https://docs.yugabyte.com/preview/yugabyte-platform/administer-yugabyte-platform/back-up-restore-yp/
However, there are gaps in the above documentation and certain manual steps need to be taken.
Resolution
Overview
An additional meta data file and files related to Prometheus targets and rules need to be copied over manually in order for the full migration to take place.
Steps
1. On the source yb-anywhere platform server, download the yb_platform_backup.sh script.
wget https://raw.githubusercontent.com/yugabyte/yugabyte-db/master/managed/devops/bin/yb_platform_backup.sh
2. Run the backup script, first make the script executable
chmod +x yb_platform_backup.sh
./yb_platform_backup.sh create --output <output_path> [--data_dir <data_dir>] [--exclude_prometheus]
create runs the backup of the YugabyteDB Anywhere server.
output_path specifies the location for the .tar
output file.
data_dir is optional. It specifies the data directory to be backed up. Default is /opt/yugabyte
.
--exclude_prometheus is optional. It excludes Prometheus metrics from the backup.
3. Copy the backup .tgz file and also the file version_metadata_backup.json file to a safe location from where they can be copied to the target yb-anywhere server.
Example files
-rw-r--r--. 1 root root 315 Jul 27 09:59 version_metadata_backup.json
-rw-r--r--. 1 root root 1033389021 Jul 27 10:03 backup_22-07-27-09-59.tgz
4. At this stage the the source (original) yb-anywhere server can be shut down.
5. On the target yb-anywhere server, you will need to get the yb_platform_backup.sh as in step 1 and make it executable.
wget https://raw.githubusercontent.com/yugabyte/yugabyte-db/master/managed/devops/bin/yb_platform_backup.sh
chmod +x yb_platform_backup.sh
6. Run the yb_platform_backup.sh script using the restore command after copying over the backup tgz and version_metadata_backup.json files to the target yb-anywhere server.
./yb_platform_backup.sh restore --input <input_path> [--destination <destination>]
input_path is the path to the input .tar
file.
destination is optional. It specifies the output location for data. Default is /opt/yugabyte
.
7. On the target yb-anwhere server, restart the yugaware container
sudo docker restart
8. In the target yb-anywhere UI you should now see the Universes and provider configs from the original source yb-anywhere.
Additional Information
Both yb-anywhere instances should be the same version, on restore you will be given an error if the versions do not match, however if they differ just by build numbers, its safe to do the restore using the the flag
--disable_version_check
Also the script has been updated to also copy over the Prometheus targets and rules files, in previous versions this had to be done manually.
Comments
0 comments
Please sign in to leave a comment.