This knowledge article outlines the detailed procedure for backing up and restoring a MuleSoft Private Cloud Edition (PCE) with Anypoint Monitoring and Visualization (AMV) on PCE 3.2.x for testing purposes.
The process involves creating a new PCE cluster for backup, performing the backup, and then restoring the backup to another new PCE cluster.
The above ensures data integrity and operational continuity in the event of system failures or migrations within our internal infrastructure.
Please follow the below steps for the whole Backup Procedure of your PCE Cluster
Provision a new PCE cluster to serve as the source for the backup.
Within customer DNS platform( Example: AWS Route 53)
Create a new record:
Specify a descriptive name (e.g., pce325.pce.mulesoft.com).
Point the A-Record or CNAME alias to the load balancer associated with the new PCE cluster.
Ensure the DNS is resolving to the correct 3.2.5 PCE version.
Save the record.
Update the DNS configuration within the PCE Access Management UI to match the DNS record.
Verify successful login using the configured DNS (e.g., pce325.pce.mulesoft.com) and the appropriate credentials for the 3.2.5 version.
Configure any necessary hybrid servers required for your environment.
Create a sample API in Design Center.
Publish the API to Exchange.
Create a new API instance in API Manager, utilizing the API published from Exchange.
Deploy any required applications to the PCE environment.
Confirm that the API in API Manager transitions to the "Active" state.
Initiate traffic to the deployed API to generate runtime data.
Create custom dashboards in Anypoint Monitoring to visualize key metrics.
Configure alerts in Anypoint Monitoring to monitor critical system events.
Verify that alerts are triggered as expected.
This procedure focuses on two backup types:
Gravity Backup (for system state).
InfluxDB Backup (for monitoring data).
Log in to any node within the PCE cluster.
Execute the following command:
sudo gravity backup
/var/lib/gravity/planet/share/backup.tar.gz
InfluxDB data is crucial for monitoring. To back it up:
Log into a node that has the InfluxDB pod running.
Execute the following command to create a backup directory:
mkdir /var/lib/gravity/planet/share/influxdb_backup
sh /var/lib/gravity/site/packages/unpacked/gravitational.io/anypoint/3.2.0*/resources/kubernetes/amv-backup-restore/amv-backup-restore.sh -d /var/lib/data/influxdb/backup -a backup -f influxdb_backup.tar.gz
#(use sh -x if you want more debugging).
#The point release version should match your Anypoint PCE version.
#The file /var/lib/gravity/planet/share/influxdb_backup.tar.gz now contains the influxDB backup.
Please follow the below steps for the Restore Procedure of your PCE Cluster
New Cluster Creation: Provision a new PCE cluster for the restore operation.
Crucially, capture all necessary secrets from the source cluster before initiating the restore. Missing secrets can lead to failure.
#take backup of secrets for reference ( optional )
for SECRET in $(kubectl get secrets -n dias | awk '{print $1}')
do
kubectl get secret $SECRET -o yaml -n dias > /tmp/$SECRET.yaml
done
Update the DNS configuration in Route 53 and the Access Management UI to match the DNS used during the backup process (e.g., pce325.pce.mulesoft.com).
Transfer the backup.tar.gz and influxdb_backup.tar.gz files to a directory accessible by the target restore cluster (e.g., /var/lib/gravity/planet/share on an AMV Node). Use scp for secure transfer:
scp /backup-path/to-restore.tar.gz your_username@remotehost.edu:/var/lib/gravity/planet/share
scp /backup-path/influxdb_backup.tar.gz your_username@remotehost.edu:/var/lib/gravity/planet/share
To ensure new pods are created based on the restored state, delete the existing pods in the dias namespace
NOTE: This ensures that the correct platform certificate gets propagated to the Monitoring service ingestor.
kubectl get pods --no-headers -n dias | grep dias-prov-k8s-amr-ingestor-router-comp | xargs kubectl delete pod -n dias
#List pods (optional)
kubectl get pods -n dias
#Delete specific amr-ingestor-router-comp pods:
kubectl delete pod -n dias dias-prov-k8s-am-ingestor-comp-0 dias-prov-k8s-am-ingestor-comp-1 dias-prov-k8s-am-ingestor-comp-2 --force --grace-period=0
#verify the pod deletions :
kubectl get pods -n dias
Log into an AMV node that has the InfluxDB pod running.
Create a restore directory
mkdir /var/lib/gravity/planet/share/influxdb_restore
sudo tar -xzvf /var/lib/gravity/planet/share/influxdb_backup.tar.gz -C /var/lib/gravity/planet/share/influxdb_restore
sh /var/lib/gravity/site/packages/unpacked/gravitational.io/anypoint/3.2.0*/resources/kubernetes/amv-backup-restore/amv-backup-restore.sh -f /var/lib/data/influxdb/backup/influxdb_backup.tar.gz -va restore
#(use sh -x if you want more debugging)
#The point release version should match your Anypoint PCE version.
Log in to the node you copied the backup to in the restore target cluster.
Execute the restore command
sudo gravity restore /var/lib/gravity/planet/share/to-restore.tar.gz
#Note: The restore process typically takes 40-60 minutes.
Attaching Sample Screenshots during Restore job process
New secret files are generated, Upon restoration, the aforementioned secrets are deleted and subsequently recreated.
We can observe the above highlighted secrets will get deleted and get created in the process
If you are not reusing the original NFS, manually restore the NFS files.
NFS Mounting Example (AWS EFS):
mkdir nfs_mount_folder
#Replace ${NFS} with the appropriate NFS version, copy the backup files to the mounted directory.
sudo mount -t nfs4 -o rw,vers=${NFS}:/ /home/ec2-user/nfs_mount_folder
cp backup-3x-dd-mm-yy.tar.gz nfs_mount_folder/
Test the deployed applications to ensure they are functioning correctly.
Restart the mule server for restore to work correctly
Verify that the APIs in API Manager are in the "Active" state.
Restart the mule server for restore to work correctly
Confirm that custom dashboards and alerts are restored and functioning as expected.
Check for data consistency and completeness, especially InfluxDB data that we have merged.
For More Information on Anypoint PCE, refer to https://docs.mulesoft.com/private-cloud/latest/
004633482

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.