Page 1 of 1
Manually restore the nagios(xi)db(s)
Posted: Tue Mar 29, 2016 2:53 pm
by benhank
hey fellas!
i need to figure export Nagios's DB and restore it to another. I saw documentation that detailed this a while ago, but cant find it now. I'm trying to do this on 2014 version.
Re: Manually restore the nagios(xi)db(s)
Posted: Tue Mar 29, 2016 2:59 pm
by rkennedy
Just to make sure, do you know if the server is actually utilizing MySQL? I believe 2014 still used Postgres.
Re: Manually restore the nagios(xi)db(s)
Posted: Wed Mar 30, 2016 7:49 am
by benhank
Yeah I think it uses both
Re: Manually restore the nagios(xi)db(s)
Posted: Wed Mar 30, 2016 1:29 pm
by ssax
To backup MySQL to file:
Code: Select all
mysqldump -uroot -pnagiosxi --add-drop-database nagios > /tmp/nagios_export.sql
mysqldump -uroot -pnagiosxi --add-drop-database nagiosql > /tmp/nagiosql_export.sql
To restore MySQL from file:
Code: Select all
mysql -uroot -pnagiosxi nagios < /tmp/nagios_export.sql
mysql -uroot -pnagiosxi nagiosql < /tmp/nagiosql_export.sql
To backup PostgreSQL to file:
Code: Select all
pg_dump -c -U nagiosxi nagiosxi > /tmp/nagiosxi_export.sql
To restore PostgreSQL from file:
Code: Select all
psql nagiosxi nagiosxi < /tmp/nagiosxi_export.sql
Re: Manually restore the nagios(xi)db(s)
Posted: Wed Mar 30, 2016 1:42 pm
by benhank
ok thanks ! dont lock it till I test ok?
Re: Manually restore the nagios(xi)db(s)
Posted: Wed Mar 30, 2016 2:28 pm
by hsmith
Sounds good.

Re: Manually restore the nagios(xi)db(s)
Posted: Wed Mar 30, 2016 2:41 pm
by benhank
ok cool the export worked thanks guys!