Migrating from Postgresql to MySQL

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
noweda
Posts: 52
Joined: Fri Dec 06, 2013 2:47 am

Migrating from Postgresql to MySQL

Post by noweda »

Hi all,
when trying to migrate our old Postgresql Database to MySQL following this guide
(https://support.nagios.com/kb/article/c ... i-560.html),
we receive an errormessage oat the import step, saying that

"ERROR 1146 (42S02) at line 74224: Table 'nagiosxi.xi_sessions' doesn't exist".

All other steps work as described in the article and If I ignore that message and switch the DB
config anyway, a similar message is displayd in the Web Interface.
Switching back to Postgresql resolves the problem - Our Nagios Version is XI 5.5.1 running on CentOS 6.10.

any Ideas?
kind regards
simon
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Migrating from Postgresql to MySQL

Post by cdienger »

What is the output if you run:

echo "select * from xi_sessions" | mysql -uroot -pnagiosxi -D nagiosxi

?

Attached is a sql script to create any tables that may have been missed. Run it with:

mysql -uroot -pnagiosxi < agiosxi_db.sql

Try running this and then run the import command again.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
noweda
Posts: 52
Joined: Fri Dec 06, 2013 2:47 am

Re: Migrating from Postgresql to MySQL

Post by noweda »

Hello cdienger,

the SQL statement produces the same error message:

ERROR 1146 (42S02) at line 1: Table 'nagiosxi.xi_sessions' doesn't exist

I will try to run the script, you attached.

Best regards
Christoph
noweda
Posts: 52
Joined: Fri Dec 06, 2013 2:47 am

Re: Migrating from Postgresql to MySQL

Post by noweda »

Hello cdienger,

I had to run your script immediately before the import step, then it worked. Thank you for your help!

It seems, that the script linked in the article is missing the creation of xi_sessions table: see https://assets.nagios.com/downloads/nag ... ate_db.sql

Best regards
Christoph
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Migrating from Postgresql to MySQL

Post by cdienger »

Glad to hear it was fixed!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked