MySQL database backup
This article explains how to use backup scripts to create a MySQL database dump and include it in a backup plan.
General information
The MySQL database backup process in Xopero ONE consists of two steps:
Creating a database dump using backup scripts.
Backing up the database dump.
The first step is performed through Xopero ONE using the backup scripts feature. The second step is a standard file-level or image-level backup executed directly by Xopero ONE.
By using the mysqldump
tool, Xopero ONE supports all MySQL versions that are officially supported by Oracle.
Backup configuration
Log in to , go to the Backup tab (Plans > Backup) and click the + Add plan button in the top toolbar.

Select Devices from the platforms list.

In the next aside, select one of the available options and choose one or more devices for the plan to apply to (you can also select the plan to include all activated devices).

Define the name of the backup plan.
Configure your backup plan according to your needs (more information about the backup plan setup can be found in File-level backup and Image-level backup articles).
Go to the Advanced settings section and click Edit to customize additional options.

Scroll down to the Backup scripts section and click the Pre-task script toggle to turn it on.

Select one of the scripts dedicated to backing up the MySQL database environment (Windows or Linux).


Type your database username into the Database user field.
It is strongly recommended to create a dedicated user specifically for database backup operations.

Choose the user password by opening the Password Manager, where you can either add a new password or select an existing one.

Set up the script arguments — it should be entered in the Script arguments field as follows:
database output_dir mysqldump_dir port
database output_dir port
database
— the name of the database. To include multiple databases in one backup plan, enter their names in the following format:[database1 database2 database3]
. To back up all databases, use the--all
parameter instead of specifying a database name.output_dir
— the directory where the database dump will be saved. This directory must also be selected in the Data to protect section when creating a backup plan.mysqldump_dir
— the path to themysqldump
utility.port
— an optional parameter. Enter the port number only if a non-standard port is used. The default port is 3306.
When using the mysqldump
utility on Linux, connections to the host named 'localhost' are established through a socket file. If you do not specify a port in the configuration, the tool will connect correctly even when using a non-standard port. However, if you connect via 127.0.0.1, specifying a non-standard port is required.
For example, to back up all databases from the MySQL environment, use the following arguments:
--all C:\MySQLBackup\ "C:\Program Files\MySQL\MySQL Server 8.0\bin"
If you want to back up only selected databases from the MySQL environment (for example, two out of seven), use the following arguments:
database1 database2 C:\MySQLBackup\ "C:\Program Files\MySQL\MySQL Server 8.0\bin"
Important! The mysqldump
tool is part of the MySQL server and should be installed by default. If, for any reason, it is not available, you can download the MySQL Utilities package, which includes the mysqldump
tool.
Enable the two additional options using the checkboxes:
Wait for the script to continue the task — the application will wait until the dump is ready.
Fail the task if the script fails — if the script fails, the system will notify you of the backup error.

Double-check your settings and click Save to close the Advanced settings aside.
After completing the configuration, click the Save button. The protection plan will then automatically begin protecting your devices and databases according to the schedule you defined.
You can also click Save&Run button to immediately start the backup process, regardless of schedule.
That’s all you need to do to create the database dump — this file should now be included in the Data to protect section if you are performing a file-level backup (to back up only the database). Alternatively, you can run an image-level backup to protect the entire drive.
Useful links and items
Last updated