---
title: "Back up and restore YugabyteDB Anywhere"
url: "https://docs.yugabyte.com/stable/yugabyte-platform/administer-yugabyte-platform/back-up-restore-k8s/"
---

# Back up and restore YugabyteDB Anywhere

Use a script to back up and restore YugabyteDB Anywhere on Kubernetes.

Back up your YugabyteDB Anywhere installation

- [Automated](/stable/yugabyte-platform/administer-yugabyte-platform/back-up-restore-yba/)
- [Manual](/stable/yugabyte-platform/administer-yugabyte-platform/back-up-restore-installer/)

<!--THE END-->

- [YBA Installer](/stable/yugabyte-platform/administer-yugabyte-platform/back-up-restore-installer/)
- [Kubernetes](/stable/yugabyte-platform/administer-yugabyte-platform/back-up-restore-k8s/)

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.

Note

You cannot back up and restore Prometheus metrics data.

## 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 2026.1.2.0, you can copy the `yb_platform_backup.sh` script from the `yugabyte-db` repository using the following `wget` command:

```sh
wget https://raw.githubusercontent.com/yugabyte/yugabyte-db/v2026.1.2.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 YugabyteDB Anywhere

You can back up the YugabyteDB Anywhere server as follows:

1. Verify that the computer performing the backup operation can access the YugabyteDB Anywhere Kubernetes pod instance by executing the following command:
   
   ```sh
   kubectl exec --namespace <k8s_namespace> -it <k8s_pod> -c yugaware -- cat /opt/yugabyte/yugaware/README.md
   ```
   
   *k8s\_namespace* specifies the Kubernetes namespace where the YugabyteDB Anywhere pod is running.
   
   *k8s\_pod* specifies the name of the YugabyteDB Anywhere Kubernetes pod.
2. Run the `yb_platform_backup.sh` script using the `create` command, as follows:
   
   ```sh
   ./yb_platform_backup.sh create --output <output_path> --k8s_namespace <k8s_namespace> --k8s_pod <k8s_pod> [--exclude_releases --verbose]
   ```
   
   *create* is the command to run the backup of the YugabyteDB Anywhere server.
   
   *output\_path* specifies the location for the output backup archive.
   
   *k8s\_namespace* specifies the Kubernetes namespace in which the YugabyteDB Anywhere pod is running.
   
   *k8s\_pod* specifies the name of the YugabyteDB Anywhere Kubernetes pod.
   
   *exclude\_releases* excludes YugabyteDB releases from the backup archive.
   
   *verbose* prints debug output.
3. Verify that the backup `.tar.gz` file, with the correct timestamp, is in the specified output directory.
4. Upload the backup file to your preferred storage location, and delete it from the local disk.

## Restore YugabyteDB Anywhere

To restore the YugabyteDB Anywhere content from your saved backup, do the following:

1. Execute the following command to verify that the computer performing the backup operation can access the YugabyteDB Anywhere Kubernetes pod instance:
   
   ```sh
   kubectl exec --namespace <k8s_namespace> -it <k8s_pod> -c yugaware -- cat /opt/yugabyte/yugaware/README.md
   ```
   
   *k8s\_namespace* specifies the Kubernetes namespace where the YugabyteDB Anywhere pod is running.
   
   *k8s\_pod* specifies the name of the YugabyteDB Anywhere Kubernetes pod.
2. Run the `yb_platform_backup.sh` script using the `restore` command:
   
   ```sh
   ./yb_platform_backup.sh restore --input <input_path> --k8s_namespace <k8s_namespace> --k8s_pod <k8s_pod> [--verbose]
   ```
   
   *restore* restores the YugabyteDB Anywhere server content.
   
   *input\_path* is the path to the `.tar.gz` backup file to restore.
   
   *k8s\_namespace* specifies the Kubernetes namespace where the YugabyteDB Anywhere pod is running.
   
   *k8s\_pod* specifies the name of the YugabyteDB Anywhere Kubernetes pod.
   
   *verbose* prints debug output.

When finished, the restored YugabyteDB Anywhere is ready to continue managing your universes and clusters.
