Migrate from an EL-type OS to another EL-type OS (from a Centreon 18.10 or newer)
Prerequisites
This procedure only applies if the following conditions are met:
- You wish to migrate from a 64-bit EL-type OS to another supported 64-bit EL-type OS. For instance, if you want to migrate from a CentOS 7 to an Alma 8.
- Your version of Centreon is 18.10 or newer.
If your Centreon platform includes a Centreon redundancy system, please contact Centreon support.
Migrating a central server
Step 1: Install the new server
Install your new OS according to the prerequisites.
Install a new Centreon central server from packages, until you complete the installation process by connecting to the Centreon web interface.
Use the same password for the centreon user as for the old platform during the web installation process.
Perform software and system updates:
dnf update
Step 2 : Synchronize the data
Connect to your old Centreon server.
Generate a pair of ssh keys for root:
ssh-keygen -t rsa
By defaut, the generated key pair will be saved to /root/.ssh/id_rsa.pub and /root/.ssh/id_rsa.
Copy root's public key (/root/.ssh/id_rsa.pub) into the /root/.ssh/authorized_keys file of the new server. If you are not using root for the synchronization, make sure that the user you use has writing rights on the target directory.
From the old server, synchronize the following directories to the new server:
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 /usr/share/centreon/www/img/media root@<IP_NEW_CENTREON>:/usr/share/centreon/www/imgIf you have given a custom name to your private key file, use the following format (just replace id_rsa_custom by your file name, and
<command>
by the commands above):rsync -avz -e "ssh -i /root/.ssh/id_rsa_custom" <command>
Replace <IP_NEW_CENTREON> by the IP address of the new Centreon server.
Step 3: Retrieve the databases
On the old server, create a dump of the databases:
mysqldump -u root -p centreon > /tmp/centreon.sql
mysqldump -u root -p centreon_storage > /tmp/centreon_storage.sqlOn the old server, stop MariaDB:
systemctl stop mariadb
On the old server, export the dumps to the new Centreon database server (make sure you have enough space for large database dumps):
rsync -avz /tmp/centreon.sql root@<IP_NEW_CENTREON>:/tmp/
rsync -avz /tmp/centreon_storage.sql root@<IP_NEW_CENTREON>:/tmp/On the new 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;
exitOn the new database server, import the previously transfered dumps into the database:
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 address of the new Centreon server.
Step 4: Synchronize the plugins
If you only use Centreon plugins, reinstall them on the new server:
yum install centreon-plugin-\*
If you are using custom plugins, synchronize the directories that contain your custom plugins, including any necessary dependencies.
Step 5: Upgrade Centreon
On the new server, force the update by moving the contents of the /var/lib/centreon/installs/install-22.10.x-YYYYMMDD_HHMMSS directory to the /usr/share/centreon/www/install directory (x is the target version number for your migrated machine):
cd /var/lib/centreon/installs/
mv install-22.10.x-YYYYMMDD_HHMMSS/ /usr/share/centreon/www/install/If you use the same IP address or same DNS name between the 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
and perform the upgrade.If the password for user centreon that you specified when installing the new server is different from the password on the old server, 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 the Centreon web interface and change the password for the unfied-sql output,
- Edit the /etc/centreon/config.d/10-database.yaml file.
If the IP address 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 fingerprint of your platform has changed too: contact Centreon to obtain a new license.
Deploy the configuration for all your monitoring servers (including the central).
Restart the following processes:
systemctl restart cbd centengine
systemctl restart gorgoned
systemctl start snmptrapd centreontrapd
systemctl start snmpdIf your old Centreon server was monitoring itself, and you have changed the username/password for the database during the migration, update the configuration of all related resources (host, services attached to that host).
Go to Configuration > Plugin Packs, then update all the plugin packs.
Step 6 (older versions only): Migrate to Gorgone
If you are migrating from a Centreon version 18.10, 19.04 or 19.10, migrate from Centcore to Gorgone.
Step 7: Upgrade the modules
To upgrade the modules, go to Administration > Extensions > Manager and click Update all. If you have a MAP server or an MBI server, follow the corresponding migration procedures:
Migrating a remote server
To migrate a remote server:
- Follow the same procedure as for a central server.
- Attach the new remote server to your central server.
Migrating a poller
To migrate a poller:
- Follow steps 1 and 4 of the procedure to migrate a central server (i.e. install the new server and synchronize the plugins).
- On the central server, go to Configuration > Pollers. Select the poller that was migrated and update its IP address (if it has changed).
- Deploy the configuration.
- If your poller doesn't work after migrating it (e.g. you cannot deploy the configuration, or execute monitoring actions), update the poller's fingerprint, as described in this knowledge base article.