MariaDB Restore

Before Restoring MariaDB Database

There are two methods to recover MariaDB database, Override Original Database and Redirect Restore to New Path.

For Override Original Database restore, MariaDB database needs to be shutdown. For example:

systemctl stop mariadb

And an empty temporary directory needs to be created and should be granted with mysql user permission for storing cache data during restoration process. For example:

mkdir /data
chown -R mysql:mysql /data

All data in the original data directory (datadir) needs to be cleared before restoration, it’s recommended to rename the original data directory and create a new directory with the original data directory name, and it needs to be granted with mysql user permission, for example:

cd /var/lib/
mv mysql mysql.bk
mkdir mysql
chown -R mysql:mysql mysql

Notice

  1. The above operations should be done by the MariaDB database admin.
  2. The temporary directory is recommended to be created on the same partition as original data directory.
  3. For the datadir, it’s configured in the my.cnf file, database admin should perform the above operations according to the actual environment.

For Redirect Restore to New Path, a temporary directory and a new data directory need to be created and need to be granted with mysql user permissions, for example:

mkdir /data
chown -R mysql:mysql /data
mkdir /data1
chown -R mysql:mysql /data1

Notice

  1. Redirect Restore to New Path does not require shutdown MariaDB database services.
  2. The restored data will be saved in the new data directory, database admin can use the restored data to create new database or modify the my.cnf file to start MariaDB database from the new data directory

Create MariaDB Restore Job

To restore MariaDB database from its backup restore points, please go to Physical Backup > Database Backup > Restore page. There are 4 steps to restore databases from the database backup restore points.

Step 1: Restore Point

In the Restore Point dropdown list, select a backup node which stores the desired restore points. Select a target database restore point under your database which you want to restore.

You can quickly find the target restore point by searching the job name, database name or the date of the restore point. One restore job only can select one restore point.

Step 2: Restore Destination

After selecting restore point, select Target Instance to restore to.

Step 3: Restore Strategy

For Override Original Database restore, fill in the temporary directory path.

Notice

If you use log backup point to override original database, MariaDB service will auto restart, no need to manually start MariaDB service. The [Start Command] is ‘mysql’ by default. It will be used to restart database service. You need to change it to the service name of your environment instance.

For example: this is a MariaDB, fill in the service name as ‘mariadb’. Then the command ‘service mariadb restart’ will execute.

For Redirect Restore the New Path restore, fill in the temporary directory path and the new data directory path.

Rollback time: if you had selected log backup restore point, you are able to rollback MariaDB database state within the given time range.

Same as database backup, while restoring databases, you can configure Transmission Strategy to encrypt the data transmission channel and set the transmission network. You can also configure Throttling Policy to limit the database restore speed accordingly.

Step 4: Review & Confirm

After completing the above-mentioned settings, you are able to review and confirm the settings in one screen.

Once the job has been created, you’ll be redirected to the Monitor Center > Jobs page.

As the database restore job is by default to be executed right after the creation of the job, so it will run automatically, when you see it in the current job list, it should be in running status already, and once completed, the job will be automatically deleted from the current job list.

After this you can browse the restored job from History Jobs. Your restored data will be found in the path you configured during creating the restore job.

results matching ""

    No results matching ""