Identify config changes from pristine

From OpenNMS
Jump to: navigation, search

When updating OpenNMS one of the first questions is what do I have changed in my configuration from a pristine configuration. To answer this question easier the OpenNMS pristine configuration from various versions is published to a GitHub repository. The repository has for every released version of OpenNMS Horizon a branch. Because of different $OPENNMS_HOME in YUM/RPM and DEB based Linux distributions, the configuration branches are prefixed with pristine/debian or pristine/rpm.

When updating OpenNMS one of the first questions is what do I have changed in my configuration from a pristine configuration. This example explains how to use git and the OpenNMS Horizon Config repository.

This repository has for every released version of OpenNMS Horizon a branch. Because of differences in $OPENNMS_HOME in YUM/RPM and DEB based Linux distributions, the configuration branches are prefixed with pristine/debian or pristine/rpm.

So first you want to know what, which files do you have changed from a default install and need to be migrated.

Here is a quick workflow with git to answer such a question.

Step 1 Make your OpenNMS Horizon config a git repository and store as it is a first commit.
cd ${OPENNMS_HOME}/etc
git init
git add -A
git commit -m "My 18.0.4 config before migration"
Step 2 Add the remote repository to compare against the pristine config
git remote add upstream https://github.com/OpenNMS/opennms-etc-pristine.git
git fetch --all
Step 3 Generate a file summary just for added or deleted files
git diff --ignore-all-space --summary upstream/pristine/rpm/18.0.4:etc

You can ignore everything in the examples directory, you should take the examples directory as it is from the new version from OpenNMS Horizon. The output looks like this:

delete mode 100644 centric.properties
create mode 100644 configured
delete mode 100644 datacollection/juniper-tca.xml
create mode 100644 datacollection/mycustom.snmp-datacollection.xml
delete mode 100644 dhcpd-configuration.xml
delete mode 100644 drools-engine.d/ncs/dependencyLoadingRules.drl
delete mode 100644 drools-engine.d/ncs/dependencyRules-context.xml
delete mode 100644 drools-engine.d/ncs/drools-engine.xml
delete mode 100644 drools-engine.d/ncs/eventMappingRules.drl
delete mode 100644 drools-engine.d/ncs/impactPropagationRules.drl
create mode 100644 foreign-sources/MyServer.xml
create mode 100644 imports/MyServer.xml
create mode 100644 java.conf
delete mode 100644 jira.properties
delete mode 100644 jms-northbounder-configuration.xml
create mode 100644 libraries.properties
delete mode 100644 ncs-northbounder-configuration.xml
delete mode 100644 nsclient-config.xml
delete mode 100644 nsclient-datacollection-config.xml
create mode 100644 opennms-upgrade-status.properties
create mode 100644 opennms.properties.d/rrd-configuration.properties
create mode 100644 org.opennms.features.datachoices.cfg
delete mode 100644 otrs.properties
create mode 100644 pluginManifestData.xml
delete mode 100644 rt.properties
delete mode 100644 snmp-asset-adapter-configuration.xml
delete mode 100644 snmp-graph.properties.d/juniper-tca.properties
delete mode 100644 snmp-hardware-inventory-adapter-configuration.xml
delete mode 100644 tca-datacollection-config.xml
delete mode 100644 xml-datacollection-config.xml
delete mode 100644 xmp-config.xml
delete mode 100644 xmp-datacollection-config.xml

All configuration files with "delete mode" do not exist in your configuration. You can ignore all these files in the first place. All files with "create mode" are created and do not exist in a pristine configuration, e.g. opennms.properties.d/rrd-configuration.properties. You have to ensure to migrate these files into your new OpenNMS Horizon version.

Why are there configuration files in pristine 18.0.4 which do not exist on my system? The pristine configuration has them from all features in OpenNMS. If you don't have them installed, you don't have those configuration files.

Step 4 Identify files which need to be manually merged

This is the trickier part, you want to know where you have changed files and need manual migration. You can use the following git command:

git diff --ignore-all-space --stat upstream/pristine/rpm/18.0.4:etc

When you remove all the files listed from "create mode" above and the files from the example directory you get all the files which need to be merged into the new version.

categories.xml                                     |    14 +
collectd-configuration.xml                         |     3 -
datacollection-config.xml                          |     1 +
discovery-configuration.xml                        |     4 +-
eventconf.xml                                      |   225 -
groups.xml                                         |    10 +-
notifd-configuration.xml                           |    42 +-
notifications.xml                                  |    34 +-
opennms-datasources.xml                            |     8 +-
org.apache.karaf.shell.cfg                         |     2 +-
org.opennms.features.datachoices.cfg               |     4 +
pluginManifestData.xml                             |     9 +
poller-configuration.xml                           |   193 +-
service-configuration.xml                          |   236 +-
snmp-config.xml                                    |     7 +-
surveillance-views.xml                             |    42 +-
threshd-configuration.xml                          |     9 +
thresholds.xml                                     |     6 +
users.xml                                          |    17 +-
viewsdisplay.xml                                   |     2 +

The list of files identified in "create mode" in Step 3 and the files identified here are the files you have to take care of and need to be just copied or manual merged when you go to your new version of OpenNMS Horizon.