Back Up and Restore MySQL Snapshots
Use the existing MySQL snapshot on your source Virtual Appliance to back up and restore on the destination Virtual Appliance.
Back Up a MySQL Snapshot
- Log in to your source Virtual Appliance and create a MySQL snapshot.
- Create a new MySQL snapshot.
Note: Use this command to create a new snapshot or if the source Virtual Appliance has no snapshots.
-
dumpInstance -
CODE
appdcli run mysql_backup create-snapshot <snapshot-name> -
xtrabackup -
CODE
# Trigger a full backup appdcli backup mysql full [--pod appd-mysql-0] #incremental MySQL backups appdcli backup mysql incr [--pod <pod>]
The backup job takes some time to complete.
-
- View the backup file:
CODE
# List XtraBackup CRs appdcli backup mysql list # List all backup chains with size and incremental appdcli backup mysql list-chainsA default folder is created at /mnt/nfs_share on the NFS server.
- Create a new MySQL snapshot.
- Log in to the NFS server and view the backup files.
CODE
/mnt/nfs_share# ls -ltrSample Output:
CODEdrwx------ 5 27 sudo 4096 Oct 8 16:10 mysql-mysql-backup-pvc-pvc-545f88bb-62b4-4bc1-820c-eda07a3db15eTo view the contents in the backup file, run this command:CODEls -ltr <Backup-of-MySQL-Folder-VA>Sample Output:CODEtotal 84 drwxr-x---. 2 27 27 61440 Oct 10 11:05 backup-20251017052203
Restore a MySQL Snapshot
- Log in to your destination Virtual Appliance and create a MySQL snapshot.
- Create a new MySQL snapshot.
-
dumpInstance -
CODE
appdcli run mysql_backup create-snapshot <snapshot-name>Sample Output
CODEcreate-snapshot started. Status='backup-20251017052203' -
xtrabackup -
CODE
# Trigger a full backup appdcli backup mysql full [--pod appd-mysql-0] #incremental MySQL backups appdcli backup mysql incr [--pod <pod>]
Sample Output:
The backup job takes some time to complete.
-
- View the backup file using the following command:
-
dumpInstance -
CODE
appdcli backup mysql list -
xtrabackup -
CODE
# List XtraBackup CRs appdcli backup mysql list # List all backup chains with size and incremental appdcli backup mysql list-chains
A default folder is created at /mnt/nfs_share on the NFS server.
-
- Create a new MySQL snapshot.
- Log in to NFS server to copy the backup file.
- View the backup files.
CODE
/mnt/nfs_share# ls -ltr - Copy the source Virtual Appliance backup file contents to destination Virtual Appliance.
CODE
cp -r <Backup-of-MySQL-Folder-Source-VA>/* <Backup-of-MySQL-Folder-Destination-VA>
- View the backup files.
- For MySQL
dumpInstance, log in to your destination Virtual Appliance server and clear the user-defined schema.CODEkubectl exec -it appd-mysqlsh-0 -n mysql bash cd /mysqlsh bash drop-user-schemas.sh exit - Restore the MySQL snapshot.
-
dumpInstance -
CODE
appdcli backup mysql restore-snapshot <repo-name>Example:CODEappdcli backup mysql restore-snapshot repo3 backup-20251017052203 -
xtrabackup -
CODE
# Latest chain and all incremental backups appdcli backup mysql restore # Selected chain and all incremental backups appdcli backup mysql restore --from-chain <timestamp> # Selected chain through an incremental backup, inclusively appdcli backup mysql restore --from-chain <timestamp> --from-incr <timestamp> # Full backup only appdcli backup mysql restore --from-chain <timestamp> --from-incr full
Note: You must manually restore the MySQL cluster. -
- Verify the progress of MySQL restoration using the following command:
CODE
NAME READY STATUS RESTARTS AGE appd-mysql-0 2/2 Running 0 5d12h appd-mysql-1 2/2 Running 0 5d12h appd-mysql-2 2/2 Running 0 5d12h appd-mysql-router-7b956f54c8-2xgpg 1/1 Running 0 5d12h appd-mysql-router-7b956f54c8-2zqdq 1/1 Running 0 5d12h appd-mysql-router-7b956f54c8-46wjh 1/1 Running 0 5d12h appd-mysqlsh-0 1/1 Running 0 5d12h appd-mysqlsh-1 1/1 Running 0 5d12h appd-mysqlsh-2 1/1 Running 0 5d12h backup-20251017052203-2q8jn 0/1 Completed 0 7m24s restore-20251017052907-sncvm 1/1 Running 0 20s restore-dump-nh52z 0/1 Completed 0 5d12h
Note: After restoring MySQL on the destination Virtual Appliance, the Controller UI will display the data from that Virtual Appliance. Log in to the Controller UI to verify that it displays the correct data.
Once the destination Virtual Appliance is ready, redirect the traffic from the source Virtual Appliance to this destination Virtual Appliance.