Migrate from a Centreon 3.4 platform
Prerequisites
The following procedure only applies to migration from a Centreon 3.4 platform installed on a 64-bit GNU/Linux distribution other than Oracle Linux / RHEL 8. Here are the system requirements:
Components | Version |
---|---|
Centreon Web | 2.8.x |
Centreon Broker | 3.0.x |
Centreon Engine | 1.8.x |
Migrate
All servers (central, remote and pollers) in your architecture must have the same major version of Centreon. It is also recommended that they have the same minor version.
If your Centreon platform includes a Centreon redundancy system, please contact Centreon support.
If you try to migrate a platform using the Centreon Poller Display 1.6.x, please refer to the following migration procedure.
Install the new central server
Perform the following actions:
You will need to install a new Centreon Central server from packages, until you complete the installation process by connecting to the Centreon Web interface.
Perform software and system updates:
- Alma / RHEL / Oracle Linux 8
- Alma / RHEL / Oracle Linux 9
- Debian 11
dnf update
dnf update
apt update
It is advisable to set the same password for the centreon user during the web installation process.
Synchronize the data
Connect to your old Centreon server and synchronize following directories:
rsync -avz /etc/centreon root@<IP_NEW_CENTREON>:/etc
rsync -avz /etc/centreon-broker root@<IP_NEW_CENTREON>:/etc
rsync -avz /var/log/centreon-engine/archives/ root@<IP_NEW_CENTREON>:/var/log/centreon-engine
rsync -avz --exclude centcore/ --exclude log/ /var/lib/centreon root@<IP_NEW_CENTREON>:/var/lib
rsync -avz /var/spool/centreon/.ssh root@<IP_NEW_CENTREON>:/var/spool/centreon
rsync -avz /usr/share/centreon/www/img/media root@<IP_NEW_CENTREON>:/usr/share/centreon/www/img
Replace <IP_NEW_CENTREON> by the IP or the new Centreon server.
Retrieve databases
Dump source databases:
mysqldump -u root -p centreon > /tmp/centreon.sql
mysqldump -u root -p centreon_storage > /tmp/centreon_storage.sqlStop source MariaDB servers:
service mysqld stop
Export the dumps to the new Centreon 23.04 database server (make sure you have enough space for large databases dumps):
rsync -avz /tmp/centreon.sql root@<IP_NEW_CENTREON>:/tmp/
rsync -avz /tmp/centreon_storage.sql root@<IP_NEW_CENTREON>:/tmp/On the Centreon 23.04 database server, drop the original databases and create them again:
mysql -u root -p
DROP DATABASE centreon;
DROP DATABASE centreon_storage;
CREATE DATABASE centreon;
CREATE DATABASE centreon_storage;Import the previously transfered dumps:
mysql -u root centreon -p </tmp/centreon.sql
mysql -u root centreon_storage -p </tmp/centreon_storage.sqlUpgrade the tables:
mysql_upgrade
If your database is password-protected, enter:
mysql_upgrade -u <database_admin_user> -p
Example: if your database_admin_user is
root
, enter:mysql_upgrade -u root -p
Start the mariadb process on the new server:
systemctl start mariadb
Replace <IP_NEW_CENTREON> by the IP or the new Centreon server.
Synchronize the plugins
Synchronizing the monitoring plugins is more complex and depends on your installation. The main directories to synchronize are:
- /usr/lib/nagios/plugins/
- /usr/lib/centreon/plugins/
To run the plugins, you must first install the required dependencies.
If you still have distant Centreon Engine 1.8.1 Pollers that you want to postpone the upgrade to 23.04, be aware that Centreon Web 23.04 resource $USER1$ actually points to /usr/lib64/nagios/plugins
On the 1.8.1 Pollers to mitigate the issue:
mv /usr/lib64/nagios/plugins/* /usr/lib/nagios/plugins/
rmdir /usr/lib64/nagios/plugins/
ln -s -t /usr/lib64/nagios/ /usr/lib/nagios/plugins/You now have a symbolic link as:
$ ls -alt /usr/lib64/nagios/
lrwxrwxrwx 1 root root 24 1 nov. 17:59 plugins -> /usr/lib/nagios/plugins/
-rwxr-xr-x 1 root root 1711288 6 avril 2018 cbmod.so
You can now push poller configuration from Centreon 23.04 whether the distant Poller is Centreon Engine 23.04 or 1.8.1.
Upgrade Centreon
On the new server, force the update by moving the contents of the /var/lib/centreon/installs/install-23.04.0-YYYYMMDD_HHMMSS directory to the /usr/share/centreon/www/install directory:
cd /var/lib/centreon/installs/
mv install-23.04.0-YYYYMMDD_HHMMSS/ /usr/share/centreon/www/install/
If you use the same IP address or same DNS name between old Centreon webserver and the new one, do a full cache cleanup of your browser to avoid JS issues
Go to http://<IP_NEW_CENTREON>/centreon
URL and perform the upgrade.
If you changed the centreon password during the installation process you must follow these steps:
- Edit the /etc/centreon/centreon.conf.php file,
- Edit the /etc/centreon/conf.pm file,
- Edit the Centreon Broker central configuration using Centreon web interface and change the password for the Perfdata generator and Broker SQL database output,
- Edit the /etc/centreon/config.d/10-database.yaml file.
If the IP of your Centreon server has changed, edit the configuration for all the Centreon Broker modules of your Pollers and change the IP to connect to the Centreon Central server (output IPv4). See the Advanced configuration chapter for more information.
The credentials of the newly created centreon-gorgone user need to be updated to match those of the centreon-gorgone user on the old server. Edit etc/centreon-gorgone/config.d/31-centreon-api.yaml
and enter the credentials of the old user. Example:
gorgone:
tpapi:
- name: centreonv2
base_url: "http://127.0.0.1/centreon/api/latest/"
username: "@GORGONE_USER@"
password: "@GORGONE_PASSWORD@"
- name: clapi
username: "@GORGONE_USER@"
password: "@GORGONE_PASSWORD@"
Then generate the configuration of all your pollers and export it.
Upgrade the modules
Please refer to the documentation of each module to verify compatibility with Centreon 23.04 and perform the upgrade.
Migrate your other servers
Make sure all servers (central, remote and pollers) in your architecture have the same major version of Centreon.