SolarWinds Backup Help

MySQL restore through the command line

  1. Start your terminal emulator and move to the Backup Manager installation directory.

    cd /opt/MXB/bin

  2. Initiate the recovery of your MySQL server.

    ./ClientTool control.restore.start -datasource MySql -selection mysqldb

    Here are some options:

    • By default, the databases are restored to the original directory (in-place restore). To perform a restore to an intermediate directory, specify the -restore-to parameter, for example -restore-to /tmp.
    • You can specify the backup session that you want to restore (by default the most recent session is selected). This is done using the -time parameter – for example -time "2016-09-02 14:44:39".

    You can check the current status of the restore session using the control.session.list command.

  3. (if applicable)

    If you recovered MySQL to an intermediate directory, you will need to copy the recovered files to the appropriate data directory for the recovered instance, for example /var/lib/mysql on Linux or C:\ProgramData\MySQL\MySQL Server 5.5\data on Windows.

  4. (if applicable)

    When MySQL recovery is performed under the root user account, all the files are normally recovered with their original permissions. If another account is used, the original permissions can get overwritten. In that case you will need to set the user which is used for MySQL database management as the owner of the copied folder.

    chown -R mysql:mysql /var/lib/mysql

  5. Restart the MySQL server to apply the changes.

    /etc/init.d/mysqld restart

Important

To get details on a particular command (output structure, required arguments and optional arguments), enter the following string to your terminal emulator:

./ClientTool help -c <command>