Page 1 of 2
NAGIOS XI MIGRATION
Posted: Wed Jul 26, 2023 3:55 am
by kmsharma
Acc to the migration document present on nagios website ,it says after copying the backup to the new server extract it and copy the files to correct location.
since after extracting the backup I got other tar.gz files and some directory e.g. httpd ,mysql etc.
I want to know which files after extracting the backup tar.gz are to be copied and to which location.
I want to know the files and their location where I should copy them before running the restore script.
Re: NAGIOS XI MIGRATION
Posted: Tue Aug 15, 2023 9:46 am
by sgardil
Hey
@kmsharma, thanks for reaching out.
If you have the backup tar.gz, all you should have to do is move the file to /store/backups/nagiosxi/ directory. While the tarball is in this location, all that is needed to be done in order to restore this back up is run this script /usr/local/nagiosxi/scripts/restore_xi.sh </store/backups/nagiosxi/{tar.gz}>
Example:
/usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1279411912.tar.gz
Hope this helps, if you have any further questions feel free to reach out.
Related docs:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://support.nagios.com/kb/article/m ... r-892.html
Re: NAGIOS XI MIGRATION
Posted: Thu Aug 17, 2023 12:17 am
by kmsharma
kmsharma wrote: ↑Wed Jul 26, 2023 3:55 am
Acc to the migration document present on nagios website ,it says after copying the backup to the new server extract it and copy the files to correct location.
since after extracting the backup I got other tar.gz files and some directory e.g. httpd ,mysql etc.
I want to know which files after extracting the backup tar.gz are to be copied and to which location.
I want to know the files and their location where I should copy them before running the restore script.
can anyone plz answer this?
it would be a great help.
Re: NAGIOS XI MIGRATION
Posted: Thu Aug 17, 2023 7:58 am
by kmsharma
sgardil wrote: ↑Tue Aug 15, 2023 9:46 am
Hey
@kmsharma, thanks for reaching out.
If you have the backup tar.gz, all you should have to do is move the file to /store/backups/nagiosxi/ directory. While the tarball is in this location, all that is needed to be done in order to restore this back up is run this script /usr/local/nagiosxi/scripts/restore_xi.sh </store/backups/nagiosxi/{tar.gz}>
Example:
/usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1279411912.tar.gz
Hope this helps, if you have any further questions feel free to reach out.
Related docs:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://support.nagios.com/kb/article/m ... r-892.html
when you read these documents, it says after moving your tar.gz backup from old server to new server on the location /store/backups/nagiosxi/
untar the tar.gz backup and copy the files to respected directory.
here i got confused ----what are these respected directories?
Re: NAGIOS XI MIGRATION
Posted: Thu Aug 17, 2023 9:53 am
by sgardil
Sorry for the confusion, it does say that in the overview of restoring from a back up. On page 12 of the pdf it goes over the way to restore from command line which is the suggested way. The script will move the files to the correct locations and will be much more seamless than moving the files to their corresponding locations. The example I posted above is how to run the command line script. I don't recommend moving them manually as there's an exponentially higher chance of causing issues. However the files should have the same names if you were dead set on doing it that way.
Re: NAGIOS XI MIGRATION
Posted: Fri Aug 18, 2023 5:05 am
by kmsharma
sgardil wrote: ↑Thu Aug 17, 2023 9:53 am
Sorry for the confusion, it does say that in the overview of restoring from a back up. On page 12 of the pdf it goes over the way to restore from command line which is the suggested way. The script will move the files to the correct locations and will be much more seamless than moving the files to their corresponding locations. The example I posted above is how to run the command line script. I don't recommend moving them manually as there's an exponentially higher chance of causing issues. However the files should have the same names if you were dead set on doing it that way.
so ,i have to just put backup tar.gz to the given location in new server and just have to run the restore script without even doing untar of the backup that i got from old server?
Re: NAGIOS XI MIGRATION
Posted: Fri Aug 18, 2023 9:10 am
by sgardil
Correct, that should be all that is needed to be done if you are restoring a backup in the same distro, i.e cent 8 to cent 9. Otherwise you'll need to also run the restore script. If this gives you any issues when running the script let us know.
Re: NAGIOS XI MIGRATION
Posted: Fri Aug 18, 2023 8:27 pm
by kmsharma
sgardil wrote: ↑Fri Aug 18, 2023 9:10 am
Correct, that should be all that is needed to be done if you are restoring a backup in the same distro, i.e cent 8 to cent 9. Otherwise you'll need to also run the restore script. If this gives you any issues when running the script let us know.
Thank you
I will let you know if I face any problem.
Re: NAGIOS XI MIGRATION
Posted: Sun Aug 20, 2023 6:04 am
by kmsharma
sgardil wrote: ↑Fri Aug 18, 2023 9:10 am
Correct, that should be all that is needed to be done if you are restoring a backup in the same distro, i.e cent 8 to cent 9. Otherwise you'll need to also run the restore script. If this gives you any issues when running the script let us know.
I was migrating my nagiosxi from ubuntu22.04 to debian10
after moving the backup form old to new server and running restoring script ,I was getting error ,then I ran restore_repair.sh then I was getting database error on browser
"A database connection error has been detected, please follow the repair prompt below. If the issue persists, please contact Nagios support.
Run the following from the CLI as root to attempt to repair the DB:
/usr/local/nagiosxi/scripts/repair_databases.sh"
then i ran the above told script ,then it is giving me an error
"nagios database repair succeeded
nagiosxi database repair FAILED, please check output above!
"/usr/local/nagiosxi/scripts/repairmysql.sh: line 112: pushd: /var/lib/mysql/nagiosxi: No such file or directory
ERROR: Could not change to dir: /var/lib/mysql/nagiosxi""
then i created the given dir structure
and again ran the database repair script
now script output is restored successfully but on browser it is saying
"SQL Error [nagiosxi] : Table 'nagiosxi.xi_cmp_favorites' doesn't exist"
what to do now?
This is what I am getting after doing all the steps
Re: NAGIOS XI MIGRATION
Posted: Mon Aug 21, 2023 9:38 am
by lgute
Hi
@kmsharma, thanks for reaching out.
I am sorry you are having so much trouble migrating. I see you are trying to migrate XI from Ubuntu 22 to Debian 10. I want to try and reproduce the issues you are having. In order to do so, I need a bit more information.
- What version of XI are you running Ubuntu 22?
- What version of XI are you running on Debian 10?