Table of Contents

Migrating to another system

There can be many reasons to migrate a PFMS server and its Web Console, which are generally on the same real machine or virtual machine (Pandora FMS monolith environment).

Possible examples:

Procedure

Usually the full path to the PFMS Web Console is

/var/www/html/pandora_console

and in the following instructions it is abbreviated as $CONSOLE_PATH .

Data Export

1.- Make a backup of the database of the previous system. There are several steps, open a terminal window with administrator rights (user root):

mysqldump --single-transaction --max_allowed_packet=512M -u root -p pandora> backup_pandora_X.Y.sql

You are solely responsible for the safeguarding of your data. Write down on paper and pencil the procedure you will choose for the data transfer. Be careful, use redundancy in terms of backups and procedures with several people helping you in the process.

Data Import

2.- Install the new Pandora FMS system from scratch, we recommend the online installation tool.

3.- Close all processes running on the new system, except mysql; start with Pandora FMS (starting with version NG 754, there are additional options for manual start and stop of HA High Availability Environments):

  /etc/init.d/pandora_server stop
  /etc/init.d/pandora_agent_daemon stop
  /etc/init.d/tentacle_server stop

4.- To stop the Apache server will depend on the distribution you are using:

/etc/init.d/apache2 stop
/etc/init.d/httpd stop
systemctl stop httpd.service

5.- Next, send or copy, in the easiest way, the file backup_pandora_X.Y.tar.gz from the old system to the new one. Unzip the files in their corresponding places.

6.- Enter mysql with user root. Access the Pandora FMS database in the new system, by default pandora and import the database.

  # mysql -u root -p
  mysql>use pandora
  Database changed
  mysql>source ~/backup_pandora_X.Y.sql

This path will vary depending on the directory where you have the old system backup, here it is assumed that you have it in your home directory ($HOME).

7.- If you are migrating to a major version, where the database structure changes, this would be the time to run the migration scripts as indicated in the major version upgrade procedure.

8.- If you have made a distribution change, take into account that the path or PATH of the Web Console has been modified and in this case there are some fields in the database that have also been changed. modified, such as the tconfig table and its attachment_store and fontpath fields. To modify these fields you must enter these instructions (query). The example is for a migration to Rocky Linux 8; in other distributions change the path of the Apache directory.

# mysql -u root -p> use pandora;
   Database changed> UPDATE tconfig SET value = '/var/www/html/pandora_console/attachment' WHERE token LIKE 'attachment_store';> UPDATE tconfig SET value = '/var/www/html/pandora_console/include/fonts/smallfont.ttf ' WHERE token LIKE 'fontpath';

These PATH must also be taken into account in the server and console configuration files (config.php and pandora_server.conf files).

9.- Once the database has been migrated, you must check if the files …/pandora_console/include/config.php and /etc/pandora/pandora_server.conf and the new ones they have the same data in the dbname, dbuser and dbpass fields.

# mysql -u root -p> grant all privileges on pandora.* to 'pandora1'@'localhost' identified by 'pandora2';> flush privileges;

10.- After this, start all the daemon again and you will be able to access the Pandora FMS Console, with all the Agents, Modules, alerts , etc.

11.- If in the new host the IP address or URL have changed, all Agents local will report to this new system. For Software Agents, you must modify the parameter server_ip in each of them.

12.- Use, in Operaciones Masivas, editing agents to finalize any pending details.