Backup & Restore MariaDB with a staging path

In this approach Mariabackup is used to write backups into a staging path, then the staging path is backed up using Zmanda Pro to the Storage Vault.

Configure the staging path

  • Verify sufficient free space in the partition containing the staging path.

  • Remember to account for potential database growth.

mkdir /path/to/staging/area

Configure Files & Folders Protected Item

Items Tab

Include the path to the staging area configured and Click on Save

Commands Tab

Configure a Before Task to run mariabackup to the staging path

mariabackup --backup --extra-lsndir=/path/to/checkpoints/ --user=<backup-user>--password='<password>' --target-dir=/path/to/staging/area > /dev/null 2>&1
Configure mariabackup backup command as before task

Configure an After Task to cleanup the staging path after the backup

rm -rf /path/to/staging/area
Configure staging area clean up as after task

Save the Configuration

After saving the configuration you should see a Files and Folders protected item ready for your first backup.

Run Backup for Mariabackup using Files and folders Protected Item

You can configure schedules and retention periods similar to any other protected item.

Restore & Recovery

The Restore process involves retrieving the backed-up data from the backup storage (in this case, Zmanda Pro) and placing it in a specified location on the target system.

The Recovery process takes the restored data and prepares it for use by MariaDB. This involves several important steps to ensure data consistency and make it ready for the MariaDB server to use. This is a manual process

Restore

This process is similar to a Files and Folders restore.

  1. Navigate to the Devices Tab of the MariaDB server's Zmanda Pro user

  2. Click on the Actions and select Restore

  3. Select the appropriate Storage Vault to restore from

  4. Expand the Device name and Select the Protected Item name

  5. Make sure All items is selected for restore

  6. Select Restore as - Files and Folders

  7. Select Output directory to any path within the target system

  8. Click on Restore

Recovery

  1. Navigate to Output Directory

cd /path/to/output/directory
  1. Prepare the MariaDB target directory

mariabackup --prepare --target-dir=/path/to/output/directory
  1. Remove MariaDB data directory

  2. Recovering the restored files back

mariabackup --copy-back --datadir=/path/to/data/directory --target-dir=/path/to/output/directory
  1. Update the ownership of Data Directory to mysql

chown mysql:mysql /path/to/data/directory

Last updated