Database Restore - OpenVZ Servers
If for some reason, the database restore is not working from R1Soft, which usually happens with OpenVZ DB restores, there are two methods to perform the restore from DB files. One of the method is a little difficult. So, I will mention the other.
- Create a temporary server making sure that you use the version of MySQL as the one for which the restore has to be done. For example, if you have backed up a MySQL 5.6 database, the test server should have MySQL 5.6 itself.
- Select the Recovery Point in r1soft.
- Select All Necessary Files. Navigate to /var/lib/mysql (or /vz/root/CTID/var/lib/mysql/ in case of OpenVZ) under Location at the top. Ensure that you select ib_logfile0, ib_logfile1, and ibdata1.
Select the directory for the database name (eg. user_vbulletin) you would like to restore.
Also select the mysql directory
ib_logfile0
ib_logfile1
ibdata1
/var/lib/mysql/mysql
/var/lib/mysql/<username>_dbname - Select "Restore Selected".
- Give the alternate server name (test server) to restore and the alternate path.
- Restore the file.
- Stop MySQL on the test server.
- Remove all contents of /var/lib/mysql on the test server and move the files and directories you just restored to /var/lib/mysql/ .
- Give permissions:
chown -R mysql. /var/lib/mysql - In my.cnf (or depending on your configuration file), give the below parameters under [mysqld] section:
[mysqld]
skip-grant-tables
innodb_force_recovery=4
The innodb_force_recovery value should be started with 1 and depending on the success or failure it should be adjusted. Due to the fact that you are haven't restored the DB files of other databases which may have InnoDB tables, it will throw error if you don't enable this parameter. - Start mysql service and take a mysqldump of the database.