---
schema_version: "1"
id: 86af5d888975401e38a53b09f2fa7b317c5ca6b0dea579b69e2f07ffad32a129
title: Configure Backup and Restore for Anypoint Platform PCE
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/private-cloud/3.2/backup-and-disaster-recovery.md
canonical_url: https://docs.mulesoft.com/private-cloud/3.2/backup-and-disaster-recovery
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1ca2dbcac482e8c2bd828516c48c2b9cb3d9902b65427991f04518ceb7454816
description: MuleSoft Documentation Site
release: "3.2"
latest: false
---
---
product: Anypoint Platform Private Cloud Edition
version: 3.2
---

# Configure Backup and Restore for Anypoint Platform PCE

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

To preserve your data in case of system failure or problems with other operations, such as patching
or performing upgrades, ensure that your system is automatically backed up. Regular backups are
extremely important for disaster recovery procedures. Configure your backup to run at least once per
day; or more often depending on your requirements. Store your backup archive on external storage
outside the Anypoint Platform cluster.

Anypoint Platform Private Cloud Edition (Anypoint Platform PCE) requires you to install, configure,
and manage an NFS server. Ensure that you configure and perform frequent backups of this server.

> [!IMPORTANT] Backup and restore for Anypoint Monitoring and Anypoint Visualizer are perfored
> outside the normal Gravity backup and restore mechanism, and require a separate procedure.

## Create a Backup

To create a backup, run the following command on any node in the cluster:

gravity backup /var/lib/gravity/planet/share/backup.tar.gz

This command creates an archive of the current system state in:
`/var/lib/gravity/planet/share/backup.tar.gz`. You can pass the following optional parameters to the
gravity backup command:

- `--follow`

  Outputs the backup job logs to stdout. In the following example, `tee` enables you to output to
  stdout and file at the same time:

gravity backup /var/lib/gravity/planet/share/backup.tar.gz --follow | tee -a
/var/lib/gravity/planet/share/backup.log

- `--timeout`

  Specifies the deadline for the backup job, for example, 30s or 5m. Default is 20m.

Backup contents:

<table><caption>Table 1. Backup Contents</caption> <colgroup><col> <col></colgroup><thead><tr><th>Information</th><th>Included in PCE Backup</th></tr></thead><tbody><tr><td><p>Databases</p></td><td><p>Y</p></td></tr><tr><td><p>Configurations</p></td><td><p>Y</p></td></tr><tr><td><p>Secrets</p></td><td><p>Y</p></td></tr><tr><td><p>Object Store</p></td><td><p>Y</p></td></tr><tr><td><p>Disclaimer settings</p></td><td><p>Y</p></td></tr><tr><td><p>SMTP settings</p></td><td><p>Y</p></td></tr><tr><td><p>DNS settings</p></td><td><p>N</p></td></tr><tr><td><p>Platform certificate</p></td><td><p>N</p></td></tr><tr><td><p>Ops Center certificate</p></td><td><p>N</p></td></tr><tr><td><p>NFS settings</p></td><td><p>N</p></td></tr><tr><td><p>NFS files</p></td><td><p>N</p></td></tr><tr><td><p>Drives</p></td><td><p>N</p></td></tr><tr><td><p>Runtimes*</p></td><td><p>N</p></td></tr><tr><td><p>Anypoint Monitoring metrics</p></td><td><p>N</p></td></tr></tbody></table>

\*Anypoint Platform PCE has information only about runtimes, such as their names and status.

## Perform a System Restore

To restore a system from your backup archive, use the original cluster or create a new cluster.

> [!WARNING] Some settings, including NFS, certificates, and DNS, are not backed up and must be
> configured for the environment in which the restore will be performed before running the restore.

> [!WARNING] You cannot perform a backup between different versions of Anypoint Platform PCE. The
> new installation you create must use the same version of Anypoint Platform PCE as your backup.

1.  Log in to one of the nodes in your cluster.

2.  Move the compressed backup archive file to a folder on any main node in the environment to be
    restored. You can transfer this file securely by using the following command:

    scp /backup-path/to-restore.tar.gz your\_username@remotehost.edu:/var/lib/gravity/planet/share

3.  Restore the cluster from the backup archive:

    sudo gravity restore /var/lib/gravity/planet/share/to-restore.tar.gz

    You can pass the following optional parameters:

    - `--follow`

      Outputs the restore job logs to stdout.

    - `--timeout`

      Specifies the maximum time allowed for the restore operation, for example, 30s, 5m, and so on.
      The default value is `80m`. If you have a very large number of applications and files, use a
      minimum of `160m` as the `--timeout` value.

4.  Wait for the operation to complete, which is typically 40 to 60 minutes.

5.  Manually restore the NFS files if you are not reusing the original NFS.

## Anypoint Monitoring and Anypoint Visualizer

If Anypoint Monitoring and Anypoint Visualizer are enabled, follow these procedures to back up and
restore them.

Anypoint Monitoring and Anypoint Visualizer backup and restore are outside the normal Gravity backup
and restore mechanism, and require additional procedures. These components store metrics and other
information, but they do not store platform configuration. Platform configuration information is
handled by the system backup and restore procedures.

Anypoint Monitoring and Anypoint Visualizer must back up the data of the component InfluxDB
(`dias-prov-k8s-am-influxdb-comp`). Anypoint Monitoring and Anypoint Visualizer both store their
configuration data in a Postgres database. The default Gravity mechanism backs up and restores this
database.

Anypoint Monitoring and Anypoint Visualizer requires 4 TB volumes for `amv` nodes. A full InfluxDB
backup can be up to 8 TB of data. (Only two data nodes are operative.) You must provide enough free
space on the target directory for the entire backup.

Restore time is proportional to the size of the backup. During restore, existing data on the target
cluster will be backed up and erased upon user approval.

The backup and restore script must be run on a main node and must have `sudo` access because it uses
`kubectl`. The script validates the restore disk size, databases, measurements, retention policies,
and series cardinality for all measurements in each database.

### Procedure

The InfluxDB backup and restore script is in the Anypoint Platform PCE environment:
`/var/lib/gravity/site/packages/unpacked/gravitational.io/anypoint/3.2.0*/resources/kubernetes/amv-backup-restore/amv-backup-restore.sh`

The script has these parameters:

-a : (Required) action to perform : backup or restore. \[string\]. Default NO DEFAULT ACTION. -va :
(optional) verbose output. Default non-verbose. -f : (Required) name of the tar file. Default for
backup : dias-prov-k8s-am-influxdb-comp\_YYYYMMD. \[string\]. Default for restore :
/var/lib/data/influxdb/backup/dias-prov-k8s-am-influxdb-comp\_YYYYMMDD.tar.gz. \[Full Path\]. -d :
(Required for backup) full path to location where backup tar file is stored. Default for backup :
/var/lib/data/influxdb/backup. \[Full Path\]. Default for restore : same as tar file path. \[Full
Path\]. -s : (optional) Optional sub-component filter, use only for backup of only meta or only
data. -h : Print HELP.

### Examples

Verbose backup:
`sudo bash amv-backup-restore.sh -va backup -f 2020-01-01-influxdb-backup -d path/to/backup/dir`

Non-verbose restore:
`sudo bash amv-backup-restore.sh -a restore -f /var/lib/data/influxdb/backup/dias-prov-k8s-am-influxdb-comp_YYYYMMDD.tar.gz`

## See Also

- [Install Anypoint Platform Private Cloud](https://docs.mulesoft.com/private-cloud/3.2/install-workflow)

- [Upgrade Anypoint Platform Private Cloud](https://docs.mulesoft.com/private-cloud/3.2/upgrade)
