Skip to content

Back Up and Restore CIS SecureSuite Platform Database with Mariabackup


Introduction

When uninstalling the CIS SecureSuite Platform, we recommend backing up your database for quick restoration later if needed.

This guide explains how Windows users can use Mariabackup to back up and restore their CIS SecureSuite Platform database:

Mariabackup installation and location

During the installation and setup of the CIS SecureSuite Platform, Mariabackup is installed. You can find the command in the CIS SecureSuite Platform destination directory, under C:\...\SecureSuite\mariaDB\windows_unzip\mariadb-11.4.3-win64x\bin.

Requirements

You will need your MariaDB admin's password, which is set during the installation of the CIS SecureSuite Platform:

Back Up Database

To create a backup, run Mariabackup with the –backup option to perform the full backup and the –target-dir option to specify the location of the backup directory.

For full backups, the backup directory must be empty or must not exist. If the target directory doesn't exist, then it will be created. If the target directory exists and contains files, then Mariabackup raises an error and aborts.

  • To back up the database, run Mariadb-backup with the following command:
mariabackup --backup ^
    --target-dir="C:<\path\to\backup>" ^
    --user=root ^
    --password=<databaseadminpassword>
$ mariabackup --backup \
    --target-dir=</path/to/backup/> \
    --user=root 
    --password=<databaseadminpassword>

Note

The backup process does not modify the original database, so you can cancel the command at any time if needed.

Back Up Incremental Changes

Once you have created a full backup on your system, you can also back up incremental changes as often as desired.

To perform an incremental backup, run Mariabackup with the --backup option perform a backup, the --target-dir option to define where to place the incremental changes, and the --incremental-basedir option to define the path to the full backup.

The target directory must be empty or must not exist. If the target directory does not exist, then it will be created. If the target directory exists and contains files, then Mariabackup raises an error and aborts.

  • To back up incremental changes, run Mariabackup with the following command:
mariabackup --backup ^
    --target-dir="C:<\path\to\changes>" ^
    --incremental-basedir="C:</path/to/backup/>" ^
    --user=root ^
    --password=<databaseadminpassword>
$ mariabackup --backup \
    --target-dir=</path/to/changes/> \
    --incremental-basedir=</path/to/backup/> \
    --user=root \ 
    --password=<databaseadminpassword>

Prepare Backup for Restoration

The created backup files are not point-in-time consistent as they are copied at different times during the backup process. If you restore these backup files as is, InnoDB will detect the inconsistencies and crash to prevent corruption.

  • To make the files consistent, run Mariabackup with the prepare option:
mariabackup --prepare ^
    --target-dir="C:<\path\to\backup>"
$ mariabackup --prepare \
    --target-dir=</path/to/backup/>

Restore Backup

Once the you have created and prepared the backup, restore it using one of these options:

  • --copy-back: Allows you to keep the original backup files.
  • --move-back: Moves the backup files to the datadir, so the original backup files are lost.

1. Stop the MariaDB service.
2. (If using `--moveback) Ensure the datadir is empty.
3. Run Mariabackup with the --copy-back or --move-back option:

mariabackup --copy-back ^
    --target-dir="C:<\path\to\backup>"
$ mariabackup --copy-back \
    --target-dir=</path/to/backup/>

4. Restart the MariaDB service.