This procedure describes how to do a basic Horizon upgrade. You may need to complete additional steps to upgrade in a more complex setup (for example, if you run more than one Horizon instance, have more complex database migration requirements, or depending on the age of current version).

If you use Git to track changes to your configuration files, see Upgrade Horizon with Git.

 Make sure you complete the tasks in the before you begin section before starting. In addition, if the system requirements for the new version require you to upgrade your PostgreSQL database, you must do this before the Horizon upgrade.

## Update and verify the Horizon repository

• CentOS/RHEL

• Debian/Ubuntu

Your Horizon repository is defined in the `/etc/yum.repos.d/` directory. The file may be named `opennms-repo-stable-<OSversion>.repo`, but it is not guaranteed to be.

``````yum -y install yum-utils
yum-config-manager --enable opennms-repo-stable-*``````
3. Purge any cached yum data:

``yum clean all``
4. Make a backup copy of your config:

``````rsync -Ppav ${OPENNMS_HOME}/etc /tmp/etc.orig rsync -Ppav${OPENNMS_HOME}/jetty-webapps/opennms/WEB-INF /tmp/opennms-web-inf``````

``yum -y upgrade opennms``

``yum-config-manager --disable opennms-repo-stable-*``
7. Upgrade Java 11 to the latest release:

``yum -y install java-11-openjdk java-11-openjdk-devel``
8. Use the `runjava` command to set the JVM that Horizon will use:

``${OPENNMS_HOME}/bin/runjava -s`` 9. Check for configuration file changes and update accordingly using the files you backed up in identify changed configuration files.  If you upgrade in place, Horizon renames any shipped config that conflicts with an existing user-modified config to `.rpmnew` or `.rpmsave`. Inspect these files manually and reconcile any differences. Use `diff -Bbw` and `diff -y` to look for changes. If any `.rpmnew` or `.rpmsave` files exist within the configuration directory, services will not start. 10. Run the Horizon installer: ``${OPENNMS_HOME}/bin/install -dis``

The upgrade may take some time. An "Upgrade completed successfully!" message confirms that the upgrade has completed. If you do not get this message, check the output of the install command for any errors.

11. Clear the Karaf cache:

``yes | ${OPENNMS_HOME}/bin/fix-karaf-setup.sh`` 12. Start Horizon: ``systemctl start opennms.service``  `tail -F${OPENNMS_HOME}/logs/manager.log` shows the Horizon startup progress.
13. The upgrade is completed and operation resumes.

 Make sure that you clear your browser’s cache before using the Horizon web UI against the upgraded version. This is especially important for pages that use JavaScript heavily (for example, the Requisitions UI).

Your Horizon repository is defined in the `/etc/apt/sources.list` directory. The file may be named `opennms-repo-stable-<OSversion>.repo`, but it is not guaranteed to be.

``````sudo apt-mark unhold libopennms-java \
libopennmsdeps-java \
opennms-common \
opennms-db``````
3. Purge any cached data:

``apt-get clean``
4. Make a backup copy of your config:

``````rsync -Ppav ${OPENNMS_HOME}/etc /tmp/etc.orig rsync -Ppav${OPENNMS_HOME}/jetty-webapps/opennms/WEB-INF /tmp/opennms-web-inf``````

``apt-get upgrade opennms``

``````sudo apt-mark hold libopennms-java \
libopennmsdeps-java \
opennms-common \
opennms-db``````
7. Upgrade Java 11 to the latest release:

``apt-get install openjdk-11-jdk-headless openjdk-11-jre-headless``
8. Use the `runjava` command to set the JVM that Horizon will use:

``${OPENNMS_HOME}/bin/runjava -s`` 9. Check for configuration file changes and update accordingly using the files you backed up in identify changed configuration files.  Debian prompts you to keep or overwrite your files during the `apt upgrade` process. Inspect these files manually and reconcile any differences. Use `diff -Bbw` and `diff -y` to look for changes. 10. Run the Horizon installer: ``${OPENNMS_HOME}/bin/install -dis``

The upgrade may take some time. An "Upgrade completed successfully!" message confirms that the upgrade has finished. If you do not get this message, check the output of the install command for any errors.

11. Clear the Karaf cache:

``yes | ${OPENNMS_HOME}/bin/fix-karaf-setup.sh`` 12. Start Horizon: ``systemctl start opennms.service``  `tail -F${OPENNMS_HOME}/logs/manager.log` shows the Horizon startup progress.
13. The upgrade is completed and operation resumes.

 Make sure that you clear your browser’s cache before using the Horizon web UI against the upgraded version. This is especially important for pages that use JavaScript heavily (for example, the Requisitions UI).