This is a cache of https://support.nagios.com/kb/article/xi-5-10-0-and-newer-postgress-to-mysql-conversion-560.html. It is a snapshot of the page at 2025-05-12T00:24:22.762+0000.
<strong>xi</strong> 5.10.0 and newer Postgress to MySQL Conversion
Home » Categories » Multiple Categories

xi 5.10.0 and newer Postgress to MySQL Conversion

The Nagios xi default database changed from PostgreSQL to MySQL, since the initial release of xi 5.  If you see a notice after upgrading xi on your server to version 5.10.0, or later, to convert your PostgreSQL database to MySQL, it means you are still on PostgreSQL (maybe due to original installation being pre - xi 5).


The following process will guide you through a successful migration of the PostgreSQL database to the MYSQL database. Please note to only run this script on your xi 5.10.x or xi 5.11.x installation. Please make sure you have upgraded to one of those versions first, before proceeding.
 

Make sure to back up your xi instance first, using this document: https://assets.nagios.com/downloads/nagiosxi/docs/Backing-Up-And-Restoring-Nagios-xi.pdf
 

Open a root ssh session to the Nagios server and look in the /etc/my.cnf file or the /etc/my.cnf.d/mysql-server.cnf file (your server will have one or the other) for the following option:

max_allowed_packet=256M

If it is not defined, then under this section

[mysqld]
Add this
max_allowed_packet=256M

Save the change and run this command to restart the MYSQL or MariaDB database.

systemctl restart mariadb || systemctl restart mysqld

Change the directory:

cd /usr/local/nagiosxi/scripts/pg2mysql/


Run this to download the conversion script.
wget https://assets.nagios.com/downloads/support/convert_mod.zip

Unzip the downloaded file by running this command:
unzip convert_mod.zip

Then run the following command to convert the nagiosxi database from PostgreSQL to MYSQL and setup the server to point to the database in MYSQL.

In the command to perform the conversion, it uses nagiosxi as the root password for the mysql database, if it was changed on your server, use your password instead of this example.

Run this command to set the script executable.
chmod a+x convert_mod.php


Then run this command to perform the conversion.

./convert_mod.php localhost root nagiosxi

After the script has finished, you can log back in to the xi interface and make sure everything is working correctly.



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

1.67 (3)
Article Rating (3 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios xi - Using SSL with xi Active Directory
Viewed 5142 times since Thu, Jan 28, 2016
Nagios xi - mysql_error out of range value for column
Viewed 6692 times since Tue, Aug 14, 2018
Nagios xi - Integrating autoIT With Nagios
Viewed 5781 times since Wed, Jan 27, 2016
Nagios xi - Monitoring Using the Full Power of Nagios xi Enterprise - NWC15
Viewed 8540 times since Mon, Feb 8, 2016
Nagios xi - Integrating On-Call Schedules with Nagios - NWC13
Viewed 6447 times since Tue, Feb 9, 2016
Nagios xi - Receiving SNMP Traps From Nagios Network Analyzer
Viewed 7790 times since Mon, Oct 17, 2016
Nagios xi - Downgrading Nagios Core
Viewed 9046 times since Wed, Aug 15, 2018
Nagios xi - Configuring Global Event Handlers
Viewed 7281 times since Wed, Jan 27, 2016
Nagios xi - Connecting To Your Email Server
Viewed 5150 times since Wed, Jul 19, 2017
Nagios xi - Understanding the Nagios xi Directory Structure
Viewed 7143 times since Thu, Jan 28, 2016