Hey! These docs are for version 6.3, which is no longer officially supported. Click here for the latest version, 6.7!

Moving database

Learn how to move the database to an infrastructure server

In order to move the database to an infrastructure server, the following process must be followed:

Stopping Opsview

You will need to stop Opsview Monitor to achieve a consistent snapshot of the database and, as such, in the example below, we show you how to stop Opsview Monitor.

Stop Opsview for a consistent snapshot of the database.

/opt/opsview/watchdog/bin/opsview-monit stop all

Backup Your Databases

Here, we assume that you are undertaking a full database export. You may, of course, use any other application to back up your MySQL databases. You should be aware that if the new database server is located on a different architecture, that is, 32- or 64-bit, then you will need to export your database, as shown in the example below:

Run the below command as root making sure to include any extra databases you may have (for example, include jasperserver if it exists). This will create a full database export:

mysqldump -u root -p --add-drop-database --opt --databases opsview runtime odw dashboard notifications | gzip -c > databases.sql.gz

Backup Access Control

You should also set up access controls with your new database server so that the Opsview Monitor master is allowed to connect. So, from the Opsview Monitor master run the command shown below:

Set up access controls to allow the Opsview Monitor master to connect.

/opt/opsview/coreutils/bin/db_mysql -t > opsview_access.sql 


If you are migrating the jasperserver database that is used for the reporting module then export the database access controls.

/opt/opsview/jasper/bin/db_mysql -t > opsview_access_jasper.sql

Update the deployment configuration file

Add the database configuration to opsview_deploy.yml
From /opt/opsview/deploy/etc, update the opsview_deploy.yaml


# add the following lines:

If you use a different administration user user than root for the database, you can specify that using

    user: admin

which should be underneath and indented to line up with the ip: line.

For system upgraded from Opsview Monitor 5.4.2

From /opt/opsview/deploy/etc, comment out the following from user_upgrade_vars.yml

#- opsview-old-uk-master:

Run the following commands:

cd /opt/opsview/deploy/
./bin/opsview-deploy lib/playbooks/check-deploy.yml
./bin/opsview-deploy lib/playbooks/setup-hosts.yml
./bin/opsview-deploy lib/playbooks/setup-infrastructure.yml

Restore Your Databases

On your new server, restore the databases, as shown in the example below. You should also verify that your character set for the new databases are the same, as your previous version, since you may experience issues when upgrading.

On your new server restore your databases.

gunzip -c databases.sql.gz | mysql -u root -p

Restore Access Control

The file, opsview_access.sql now contains all the necessary access credentials, which should be transferred to the new database and imported as follows:

mysql -u root -p < opsview_access.sql 

If migrating the reporting jasperserver database

mysql -u root -p < opsview_access_jasper.sql

For additional security, you may want to restrict access to the Opsview Monitor master only.

Run the following commands:

host1:~# cd /opt/opsview/deploy/

# install and configure the opsview
host1:/opt/opsview/deploy# ./bin/opsview-deploy lib/playbooks/setup-opsview.yml