Page 2 of 2

Re: Upgrade from XI 2012R1.2 to XI 2014R1.4 still shows old

Posted: Tue Apr 21, 2015 4:16 pm
by jdalrymple
That's strange, haven't seen that one yet.

We can tackle it in 1 of 2 ways:

1) do a restore to prior to upgrade status and then run upgrade again with rhn-optional in place (some data lost no doubt)
2) edit subcomponents/install, remove nagiosql from the line starting "for pkg in nagioscore..." then try the upgrade again (should be no data lost)

You choose

Re: Upgrade from XI 2012R1.2 to XI 2014R1.4 still shows old

Posted: Tue Apr 21, 2015 4:31 pm
by luniversity
Well I've never done either one. For a restore, I assuming I would use the /usr/local/nagiosxi/scripts/restore_xi.sh? Is there anything special I need to do?

Re: Upgrade from XI 2012R1.2 to XI 2014R1.4 still shows old

Posted: Tue Apr 21, 2015 4:38 pm
by jdalrymple
Nope. cd to the scripts directory before running the restore.sh - we sometimes call other scripts relatively instead of absolutely.

so

Code: Select all

cd /usr/local/nagiosxi/scripts
./restore_xi.sh /store/backups/nagiosxi/14########.tar.gz
Just make sure to choose the last one created before the original upgrade attempt.

Re: Upgrade from XI 2012R1.2 to XI 2014R1.4 still shows old

Posted: Tue Apr 21, 2015 5:08 pm
by luniversity
Y'all are alright. I think that did the trick. I ran the restore, re-ran the upgrade and logged into the web interface, all the components have green check mark and Nagios XI 2014R2.6 shows up in the bottom corner. Thanks for the quick responses too. I think I'm good to go.

Re: Upgrade from XI 2012R1.2 to XI 2014R1.4 still shows old

Posted: Wed Apr 22, 2015 9:09 am
by lmiltchev
Let's try the following - open the "/tmp/nagiosxi/subcomponents/nagiosql/db_upgrades.php" file in a text editor, and comment out the lines 26 through 42 by placing "//" in front of each line. Example:

Code: Select all

//if(intval($oldversion) < 304) {
//        if(db_connect_select($dba)) {
//                $query = "ALTER TABLE tbl_user ADD COLUMN locale VARCHAR(6) DEFAULT 'en_EN'";
//                if(!mysql_query($query)) {
//                        echo "NagiosQL failed to update user table!\n".mysql_error()."\n";
//                        exit(1);
//                }
//                else {
//                        echo "NagiosQL user table updated successfully!\n";
//                        exit(0);
//                }
//        }
//        else {
//                "Unable to connect to NagiosQL database!\n";
//                exit(1);
//        }
//}
Save, exit and try to run the upgrade script again.

Re: Upgrade from XI 2012R1.2 to XI 2014R1.4 still shows old

Posted: Wed Apr 22, 2015 9:20 am
by luniversity
Hey lmiltchev,
Thanks you for the suggestion but we've already resolved the issue. I just needed to make the "RHEL Server Optional" RHN channel available to the system so that it could install php-mbstring package. I restored Nagios from my backup and re-ran the upgrade script. It worked beautifully. Thanks for the help. This thread can be completed.