MySQL database restore from R1soft (by creating separate MySQL instance)

If R1soft backup is configured without ‘MySQL database Add-on’. We have to download database RAW data from R1Soft to alternate location and create database dump by starting a temporary instance for MySQL with non default port. Below you can find how we can do this,
1. We should restore/download database to an alternate location, so create a directory for the same.

  mkdie /home/mysqlbackup

2.  Download below files and database from R1soft to alternate data directory (/home/mysqlbackup)

    ib_logfile0
    ib_logfile1 
    ibdata1
    /var/lib/mysql/mysql 
    /var/lib/mysql/databasename

3. Start a temporary MySQL instance

3.1: Create temp folder to save mysql sock file

   mkdir /tmp/mysqltemp
   chmod 777 /tmp/mysqltemp

3.2: Start Temporary MySQL instance (I recommend you to start it in screen and detach screen once started)

   mysqld_safe --socket=/tmp/mysqltemp/mysql.sock --port=3307 --datadir=/home/mysqlbackup

Now separate MySQL server running in port 3307 with the database restored from R1soft

4. Generate Database Dump

     mysqldump --socket=/tmp/mysqltemp/mysql.sock  databasename > databasename.sql

5. Stop temporary MySQL instance by killing process

    kill -15 <Temp mysql processID>

6. Now we can restore the database dump to default MySQL.

    mysql databasename < databasename.sql

Leave a Reply

Your email address will not be published. Required fields are marked *