Migrate from Linux 7.x to OEL 8.9 failing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
User avatar
BanditBBS
Posts: 2460
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Migrate from Linux 7.x to OEL 8.9 failing

Post by BanditBBS »

So I have 2024 R1.0.2 on current system and new system. I ran a backup on current and restore it on new. I then ran the restore repair script since I changed OS and this was the end of the output:

Notice the error about the patches at the top and then the mysql at the bottom.

Code: Select all

UPGRADE: NSCA upgrade OK.
UPGRADE: PNP is being upgraded...
Applying Nagios XI patches to PNP...
./apply-patches: line 6: patch: command not found
INSTALL: Webinject is being installed...
INSTALL: Webinject installed OK.
UPGRADE: NDO is being upgraded...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for string.h... (cached) yes
checking mysql/mysql.h usability... no
checking mysql/mysql.h presence... no
checking for mysql/mysql.h... no
configure: error: Can't locate mysql headers
Finished restore repair OK
Now when I try to open the web page I get:

Code: Select all

Database Error
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
I run repair, it seems to run fine but doesn't fix the webpage loading. Any ideas?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2460
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Migrate from Linux 7.x to OEL 8.9 failing

Post by BanditBBS »

I just noticed the restore command output. I saw Restore complete but didn't notice the errors at the top:

Code: Select all

tar: 1713366351/nagiosxi.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
tar: 1713366351/nagiosxi.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
TS=1713367161
Extracting backup to /store/backups/nagiosxi/1713367161-restore...
In /store/backups/nagiosxi/1713367161-restore/xi-backup-1713366351-aEa53PPtm3BaKlgRSPoU...
Backup files look okay.  Preparing to restore...
Shutting down services...
Restoring directories to /...
Restoring Nagios Core...
Restoring Nagios XI...
Restoring NRDP backups...
Restoring MRTG...
Restoring SNMP configuration files...
Restoring SNMP MIBs...
Restoring Nagvis backups...
Restoring nagios home dir...
Restoring MySQL databases...
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Restoring Nagios XI MySQL database...
mysql: [Warning] Using a password on the command line interface can be insecure.
Restarting database servers...
Failed to restart mariadb.service: Unit mariadb.service not found.
Restoring Apache cronjobs...
Restoring logrotate config files...
Restoring Apache config files...
Job for nagios.service failed because the control process exited with error code.
See "systemctl status nagios.service" and "journalctl -xe" for details.

===============
RESTORE COMPLETE
===============
I did not rename the archive or do anything to it except copy it to the new server.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jsimon
Posts: 106
Joined: Wed Aug 23, 2023 11:27 am

Re: Migrate from Linux 7.x to OEL 8.9 failing

Post by jsimon »

Hi @BanditBBS,

This is a known issue which we are aiming to address in the next XI release (1.1.2). In the meantime, you could try creating another backup and trying again to see if it's an issue with the backup generated.
User avatar
BanditBBS
Posts: 2460
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Migrate from Linux 7.x to OEL 8.9 failing

Post by BanditBBS »

@jsimon ,

Thanks for that information. I have one other question I came up with while working through this.

It is OEL 8.9 the new server. When I installed 2024R1.0.2 on it, it installed MySql instead of MariaDB and then some of the scripts were complaining due to MariaDB service not being found! Should I install MariaDB manually before installing XI? Note, I am using the offline installation due to a very tightly configured proxy on the new host. If I install MariaDB before XI, will XI install just use it?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
jmichaelson
Posts: 119
Joined: Wed Aug 23, 2023 1:02 pm

Re: Migrate from Linux 7.x to OEL 8.9 failing

Post by jmichaelson »

MySQL and MariaDB freqently have package conflicts, so I wouldn't recommend that.

Which packages are installed? mysql or maria? execute sudo yum list installed to check.

Check to see if either service is installed:

systemctl | grep -i mysql
systemctl | grep -i maria
Please let us know if you have any other questions or concerns.

-Jason
User avatar
BanditBBS
Posts: 2460
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Migrate from Linux 7.x to OEL 8.9 failing

Post by BanditBBS »

On the current server is MariaDB but on the new one where I fresh installed(using offline installer) it installed MySQL on OEL 8.9. If I am backing up on the older OS and restoring to the newer, shouldn't it need to be MariaDB on that one as well? And in that case, should I install MariaDB before doing the offline install and will it just use Maria at that point and not install MySQL?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jsimon
Posts: 106
Joined: Wed Aug 23, 2023 11:27 am

Re: Migrate from Linux 7.x to OEL 8.9 failing

Post by jsimon »

You should be able to complete your migration by following this document. It should not need to be MariaDB, our backup/restore procedure was designed with this situation in mind, and you should be able to complete it by following this process without any special accommodations.

Code: Select all

https://answerhub.nagios.com/support/s/article/Backing-Up-and-Restoring-Migrating-Nagios-XI-b36feda0
Post Reply