Migrating Notes from PosgreSQL to MySQL

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Migrating Notes from PosgreSQL to MySQL

Post by rajasegar »

I have just created a new instance to migrate about 400 servers.
Previously we were using SQL to insert notes to the PostgresQL DB that showsup in the Notes component.

Code: Select all

Insert INTO xi_options (name, value) VALUES (E'objectnotes_SST_KUL_ATM_FSPP_OPENSYS__',E'ST : PROD\rCity : WP - Kuala Lumpur\rLoc : [] - Taman Melawati 4\rAdr :  - No. 227 & 228, Jalan Bandar 13, Taman Melawati,\rNW : Digital HP (TCPIP)\rIND : BR-EBC\rMDL : OPS-OKIRG7\rMGT : SAFEGUARDS\rSN : \r');
Since the new instance is not using PostgreSQL but MySQL to store the notes, please advice on how to migrate the notes.

Thanks
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Migrating Notes from PosgreSQL to MySQL

Post by tmcdonald »

I can't say we have anything specifically for this, but the following might be useful:

http://stackoverflow.com/questions/1046 ... -dump-file

Otherwise since you were already using SQL directly, a quick script to iterate over the values from the Potsgres DB then insert them into MySQL would probably work as well.
Former Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Migrating Notes from PosgreSQL to MySQL

Post by rajasegar »

tmcdonald wrote:I can't say we have anything specifically for this, but the following might be useful:

http://stackoverflow.com/questions/1046 ... -dump-file

Otherwise since you were already using SQL directly, a quick script to iterate over the values from the Potsgres DB then insert them into MySQL would probably work as well.
I just want to confirm that the table structure is the same, just the location of the DB changed to MySQL and there is not other tables involved.
The rest is no problem.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Migrating Notes from PosgreSQL to MySQL

Post by avandemore »

A standard sql file should handle the table part for you. It's generally the most advanced stuff beyond that which doesn't translate easily. As referenced, there are tools to convert db types which may or may not work in this situation.
Previous Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Migrating Notes from PosgreSQL to MySQL

Post by rajasegar »

avandemore wrote:A standard sql file should handle the table part for you. It's generally the most advanced stuff beyond that which doesn't translate easily. As referenced, there are tools to convert db types which may or may not work in this situation.
MIgrating the data is not a problem. Just want to check if there is other changes that I am not aware of.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Migrating Notes from PosgreSQL to MySQL

Post by avandemore »

There is nothing additional I'm aware of but keep in mind somethings. You're using a component not included in XI support. It was written at a time when PostgreSQL was the DB. Also what you're attempting to do is likely the first one. A straight out migration may or may not work, and we do not offer an official migration path for the component.
Previous Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Migrating Notes from PosgreSQL to MySQL

Post by rajasegar »

avandemore wrote:There is nothing additional I'm aware of but keep in mind somethings. You're using a component not included in XI support. It was written at a time when PostgreSQL was the DB. Also what you're attempting to do is likely the first one. A straight out migration may or may not work, and we do not offer an official migration path for the component.
FYI, this was the component recommended by Nagios to add Notes.
So Nagios expects me to go individually to over 500 devices and paste them 1 by 1?

Would appreciate a solution and not a disclaimer.
Thanks
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Migrating Notes from PosgreSQL to MySQL

Post by tmcdonald »

rajasegar wrote:So Nagios expects me to go individually to over 500 devices and paste them 1 by 1?
This is not what we expect you to do. You had said earlier that:
rajasegar wrote:MIgrating the data is not a problem.
so it was our understanding that you were okay with doing a SQL dump as was suggested earlier. If this is not the case, please let us know and we can work toward a solution.

I need to point out that, as with any software, there are going to be features, capabilities, and functions that do not exist currently. While we are happy to request them on your behalf, these are development issues that need to be handled by the development team. Our support team is very capable of supporting the current functionality, but we cannot support something that does not yet exist. A migration script for the Notes component from Postgres to MySQL does not yet exist, so we cannot support it.

Please be understanding of the current software capabilities, and work with us to come up with a solution. If you are not able to do the migration on your own, I can request that our development team come up with a script to do so, but this is not something that the support team will be doing, so there will be a delay.
Former Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Migrating Notes from PosgreSQL to MySQL

Post by rajasegar »

tmcdonald wrote:
rajasegar wrote:So Nagios expects me to go individually to over 500 devices and paste them 1 by 1?
This is not what we expect you to do. You had said earlier that:
rajasegar wrote:MIgrating the data is not a problem.
so it was our understanding that you were okay with doing a SQL dump as was suggested earlier. If this is not the case, please let us know and we can work toward a solution.

I need to point out that, as with any software, there are going to be features, capabilities, and functions that do not exist currently. While we are happy to request them on your behalf, these are development issues that need to be handled by the development team. Our support team is very capable of supporting the current functionality, but we cannot support something that does not yet exist. A migration script for the Notes component from Postgres to MySQL does not yet exist, so we cannot support it.

Please be understanding of the current software capabilities, and work with us to come up with a solution. If you are not able to do the migration on your own, I can request that our development team come up with a script to do so, but this is not something that the support team will be doing, so there will be a delay.
Maybe I was not clear in my request. I cant use a dump as I am only migrating a subset of the servers.
Anyway I will sort this out on my own.

Please close this thread.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
Locked