Restore database backups
Use this procedure to restore the MySQL database that the Contrast installer creates.
This procedure does not apply to MySQL databases that you create for distributed environments.
Before you begin
Database restoration should be performed by a MySQL Database Administrator.
Steps
Use the encrypted properties editor to identify the MySQL database settings.
Shut down Contrast.
Start up MySQL individually using the MySQL service packaged with Contrast. Replace
<YourPath>
with the path to your Contrast home.Windows:
"<YourPath>\mysql\bin\mysqld.exe" --defaults-file="<YourPath>\data\conf\my.cnf"
Linux:
sudo -u contrast_service <YourPath>/mysql/bin/mysqld --defaults-file=<YourPath>/data/conf/my.cnf --basedir=<YourPath>/mysql --datadir=<YourPath>/data/db --plugin-dir=<YourPath>/mysql/lib/plugin --lc-messages-dir=<YourPath>/mysql/share --tmpdir=/tmp --lc-messages=en_US --log-error=<YourPath>/logs/mysql_error.log --pid-file=<YourPath>/data/proc/MysqldResource.pid --port=13306
Connect to MySQL. Replace
<jdbc.host>
,<jdbc.port>
,<jdbc.user>
and<jdbc.schema>
with your host, port, user and schema.Windows:
mysql -h <jdbc.host> -P <jdbc.port> -u <jdbc.user> -p <jdbc.schema>
Linux:
./mysql -h <jdbc.host> -P <jdbc.port> -u <jdbc.user> -p <jdbc.schema>
Drop the Contrast database with
drop database <jdbc.schema>;
.Create the Contrast database with
create database <jdbc.schema>;
.Grant permissions to the Contrast user with
GRANT ALL PRIVILEGES ON *.* to 'contrast'@'%';
.Exit from MySQL.
Restore the MySQL backup. Replace
<backup_location>
with your backup location and<backup_filename>
with your backup filename.Windows:
mysql -h <jdbc.host> -P <jdbc.port> -u <jdbc.user> -p <jdbc.schema> < <backup_location>/<backup_filename>
Linux:
./mysql -h <jdbc.host> -P <jdbc.port> -u <jdbc.user> -p <jdbc.schema> < <backup_location>/<backup_filename>
Shut down MySQL:
Windows:
Use the Windows Service Manager application to shut down the MySQL service.
Linux:
$CONTRAST_HOME/mysql/bin/mysqladmin.exe shutdown -h localhost -P 13306 -u contrast -p
You are prompted for the password that is set in the encrypted properties editor.
Restart the fully-restored Contrast and MySQL together.