Page 1 of 2
Backup and Restore to new server
Posted: Mon Sep 19, 2016 10:37 am
by jpipitone
Hello,
We are upgrading our CentOS 5.1 32 bit system to CentOS 7 64 bit. Just wanted to confirm this is the correct procedure:
1) Backup NagiosXI config with /usr/local/nagiosxi/scripts/backup_xi.sh
2) Rebuild CentOS system by installing CentOS 7 64 bit
3) Copy tar.tgz backup file to new CentOS 7 server
4) Restore NagiosXI config with /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1279411912.tar.gz
Are there any other files I need to backup, or is all data / mysql / postgresql data stored within the backup .tar.gz file?
Thank you for your help!
Re: Backup and Restore to new server
Posted: Mon Sep 19, 2016 2:35 pm
by gormank
I've restored to another machine, but I was using the same OS and Nagios version. I doubt the OS matters, but if I recall restoring an earlier backup (such as 2014R2.7) to a newer 5.x version will have some problems.
If memory serves. the Postgresql DB isn't in the new version so that part of the restore won't work. It may be related to users. Support will be able to comment.
Re: Backup and Restore to new server
Posted: Mon Sep 19, 2016 3:22 pm
by lmiltchev
Usually, to migrate an "old" XI server to a "new" (SAME XI VERSION) server, you need to follow these steps:
1. Backup your old Nagios XI instance, following this document.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
2. Install Nagios XI on the new server (it is preferable to have a "
clean" install on the
SAME OS/Architecture as on the old server)
3. Move the backup to the new server
4. Restore from the backup that you transferred earlier following the document from step 1
Migrating to a different OS/architecture is not a good idea! I would recommend either creating a new XI server from scratch, or importing your configs into the "newly created" server manually. In the second case, you will lose the data that is in Postgres though, i.e. users, so you will need to recreate them manually.
Re: Backup and Restore to new server
Posted: Mon Sep 19, 2016 3:25 pm
by jpipitone
We need to go from 32 bit to 64 bit.
We plan on creating a new XI server from scratch.
When you say "importing your configs" manually - are you referring to /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1279411912.tar.gz, or is there some other method to manually backup/import the config?
In other words, is there a difference between "Restoring the config" and "importing the config?"
Re: Backup and Restore to new server
Posted: Mon Sep 19, 2016 3:46 pm
by lmiltchev
In other words, is there a difference between "Restoring the config" and "importing the config?"
There is a big difference. When using the "restore_xi.sh" script, you will be restoring EVERYTHING - configs, historical data, etc.
When I was talking about manually importing config files, I meant following the procedure, described here:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
It is usually used to import Nagios Core config files in XI. This way, you can import various config files from the "/usr/local/nagios/etc" directory into the CCM database. This process is tedious and you cannot import objects stored in postgres (or nagiosxi db in mysql), such as users.
So, if you need to change the OS/Architecture, build your XI server from scratch.
Re: Backup and Restore to new server
Posted: Thu Sep 22, 2016 10:18 am
by jpipitone
We are building the new server from scratch on the same physical hardware. Could you point me in the right direction as far as which files I need to make sure are backed up besides the files inside /usr/local/nagios/etc, or is that the only directory I need to backup and copy once we've rebuilt the server from scratch?
Re: Backup and Restore to new server
Posted: Thu Sep 22, 2016 10:34 am
by lmiltchev
Yes, the configs in "/usr/local/nagios/etc" is mostly what you need to import. Having said that, it is going to be more difficult if you wanted to also migrate the performance data as you are changing the architecture. For more info, see our DB article on migrating performance data here:
https://support.nagios.com/kb/article.php?id=166
Whatever you do, don't get rid of the "old" Nagios XI server BEFORE you make sure the new one is up and running properly! Do backups on the old server, and keep them safe as you might need them if something goes wrong. Better safe than sorry.

Re: Backup and Restore to new server
Posted: Thu Sep 22, 2016 10:36 am
by jpipitone
Thank you!
Re: Backup and Restore to new server
Posted: Thu Sep 22, 2016 11:52 am
by lmiltchev
You are welcome! Is it OK if we lock this thread?
Re: Backup and Restore to new server
Posted: Thu Sep 22, 2016 12:20 pm
by jpipitone
Sure thing