Migrating to NMIS 8.3.1G

There are a few choices to patching NMIS8, the following is the one Opmantek suggests.  Because there are some significant file differences, e.g. deleted redundant files, it is recommended to migrate to NMIS 8.3.1G.

This document assume that you are the "root" user and that you have a user called "nmis" on your NMIS8 host and that NMIS8 is installed in /usr/local/nmis8.

This document assumes that you will migrate code changes from earlier version of NMIS8 which you have made and reapply those patches to NMIS8.3.1G manually or using tools, and please send those changes to Opmantek for inclusion where applicable.

Backup NMIS

If you don't already have backup working for NMIS, do the following.
mkdir ~nmis/backup
cp -r /usr/local/nmis8 ~nmis/backup

Extract NMIS Tarball

Get the NMIS 8.2.1 code into ~nmis, then extract it.
tar xvfz nmis-8.3.1g.tar.gz
mv nmis8 nmis8.3.1g
mv nmis8.3.1g /usr/local

Soft link NMIS runtime.

cd /usr/local
mv nmis8 nmis8.x.x; ln -s nmis8.x.x nmis8

Migrate the Configuration

There are some major changes in NMIS configuration files, and we have released some tools to help.  Have a look at these changes and ensure that the next few steps will work for your migration. Look at the changes you have made in the configuration to NMIS8.x.x using the new NMIS Config Differ.
cd /usr/local/nmis8.x.x
/usr/local/nmis8.3.1g/admin/diffconfigs.pl /usr/local/nmis8.x.x/install/Config.nmis /usr/local/nmis8.x.x/conf/Config.nmis 

The config differ, will perform a contextual comparison of the NMIS config file, and let you know what you have changed.  The easiest thing is to then apply these changes to the new NMIS config files, you can of course compare them too.

/usr/local/nmis8.3.1g/admin/diffconfigs.pl /usr/local/nmis8.x.x/install/Config.nmis /usr/local/nmis8.3.1g/install/Config.nmis 
 
You will need to manually merge and compare differences with Config811.nmis and Config.nmis after the copy.  This is probably the most annoying part of the migration.  Unless you have made significant changes, using the NMIS8.3.1G install templates will probably be the easiest option.  
You can copy the Nodes.nmis file over, nothing has changed in the structure of the file. To help there is a config updater too, use with caution, it will take a template config and apply the missing/null values to the second (current) config.  Then diff to compare the value changes.
/usr/local/nmis8.3.1g/admin/updateconfigs.pl /usr/local/nmis8.3.1g/install/Config.nmis /usr/local/nmis8.x.x/conf/Config.nmis

Migrate the Data

cd /usr/local
cp -r nmis8.x.x/var nmis8.3.1g
cp -r nmis8.x.x/database nmis8.3.1g
cp -r nmis8.x.x/logs nmis8.3.1g

Move the Softlink

cd /usr/local
rm nmis8
ln -s nmis8.2.1 nmis8

Kill fpingd.pl if using fping

ps -ef | grep fpingd.pl
root      3010     1  0 12:55 ?        00:00:00 fpingd.pl
root     13232  4852  0 14:45 pts/0    00:00:00 grep fpingd.pl

killall fpingd.pl

ps -ef | grep fpingd.pl
root     13235  4852  0 14:45 pts/0    00:00:00 grep fpingd.pl

Test Run NMIS8.3.1G

cd /usr/local
nmis8/bin/nmis.pl type=collect node=localhost debug=true

Backout Plan

Reverse the softlink

cd /usr/local
rm nmis8
ln -s nmis8.x.x nmis8