Restore a MySQL backup from Acronis

Modified on Sun, 17 Oct 2021 at 04:54 PM

For this article, it is important that you have created a backup using the described method here. If you did not, you can still try to recover the data. However, due to the way how MySQL works, chances are that you are unable to recover the data. 

Step 1 - Restore the data

Before you begin, make sure that no directory called /mysql or /tmp_mysql exist.

  1. Go to https://cloud.acronis.com and log in.
  2. Go to Backups -> Select the storage method -> Select the machine -> Click on Show backups
  3. Select the backup where you want to recover from.
  4. Click Recover... -> Files/folders.
  5. Navigate the the MySQL data directory, but do not enter the directory. Usually, this directory is /var/lib/mysql, so you navigate to /var/lib.
  6. Select the mysql data directory and click recover.
  7. Select with Recover to the machine where you want to recover the database files to.
  8. Click Custom location and click Browse.
  9. Select the location and click Done.
  10. Click Start recovery.
  11. Select Do not overwrite existing files.
  12. Uncheck Automatically restart the machine, if required.
  13. Click Proceed.

Step 2 - Restore the data

  1. SSH to the server as root
  2. Move the MySQL directory
    mv /mysql /tmp_mysql
  3. Run (replace DATABASE_NAME with your databasename) /var/lib/Acronis/mysql/dump.sh -d DATABASE_NAME
  4. A database dump is created in /tmp_mysql/DATABASE_NAME.sql
  5. Restore the database to your MySQL cluster.
  6. Once done, delete /tmp_mysql 
  7. Once done, delete /tmp_mysql :
    rm -rf /tmp_mysql

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article