Page 1 of 1

Migrating from Postgresql to MySQL

Posted: Tue Jul 24, 2018 4:35 am
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

Re: Migrating from Postgresql to MySQL

Posted: Tue Jul 24, 2018 4:20 pm
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.

Re: Migrating from Postgresql to MySQL

Posted: Wed Jul 25, 2018 1:41 am
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

Re: Migrating from Postgresql to MySQL

Posted: Wed Jul 25, 2018 3:19 am
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

Re: Migrating from Postgresql to MySQL

Posted: Wed Jul 25, 2018 2:28 pm
by cdienger
Glad to hear it was fixed!