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.
- Go to https://cloud.acronis.com and log in.
- Go to Backups -> Select the storage method -> Select the machine -> Click on Show backups
- Select the backup where you want to recover from.
- Click Recover... -> Files/folders.
- 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.
- Select the mysql data directory and click recover.
- Select with Recover to the machine where you want to recover the database files to.
- Click Custom location and click Browse.
- Select the location / and click Done.
- Click Start recovery.
- Select Do not overwrite existing files.
- Uncheck Automatically restart the machine, if required.
- Click Proceed.
Step 2 - Restore the data
- SSH to the server as root
- Move the MySQL directory
mv /mysql /tmp_mysql
- Run (replace DATABASE_NAME with your databasename)
/var/lib/Acronis/mysql/dump.sh -d DATABASE_NAME
- A database dump is created in /tmp_mysql/DATABASE_NAME.sql
- Restore the database to your MySQL cluster.
- Once done, delete /tmp_mysql
- Once done, delete /tmp_mysql :
rm -rf /tmp_mysql