Guide / Tutorial / Writeup / Walkthrough / How to: Upgrade Openfire 3.10.2 to 4.1.5, upgrade PostgreSQL 9.3 to 9.5, Upgrade Ubuntu 14.04.1 LTS to 16.04.3 LTS

Version 2

    Building off of this document: Guide / Tutorial / Writeup / Walkthrough / How to: Setting up Openfire 3.10.2 with a PostgreSQL DB, Active Directory / LDAP integration, and a Wildcard SSL Certificate

     

    I have just successfully completed an in-place upgrade of my server.

     

    In my case I am running Ubuntu as a VM on VMware ESXi 5.5 Hypervisor.  This makes it easy to take a snapshot before each critical step.  If you are running on bare metal, then I suggest you make a backup of the server before proceeding with these steps, or at least a backup of the Openfire install and the PostgreSQL DB.

     

    The upgrade process for Openfire is surprisingly painless:

     

    1. Upgrade Ubuntu (e.g. 14.04.1 to 16.04.3, if necessary or if desired)

    (backup server or take snapshot before starting process)

     

               Stop openfire and postgresql services (just in case)

               $ sudo service openfire stop

         $ sudo service postgresql stop

     

         Update the existing version to the latest packages before starting the Ubuntu update

         $ sudo apt-get update

         $ sudo apt-get upgrade

         $ sudo apt-get autoremove

     

              Start the Ubuntu update process

         $ sudo do-release-upgrade

         Follow on-screen instructions if necessary (several reboots may be required)

     

              Restore custom repositories for Oracle Sun JAVA

              If you followed my previous guide for installing Openfire (linked at the beginning of this document) and you are using the duinsoft.nl repository for maintaining Oracle Sun JAVA, the Ubuntu upgrade from v14 LTS to v16 LTS will disable ("comment out") the custom repository line from /etc/apt/sources.list

              You will need to $ sudo vi /etc/apt/sources.list and remove the comment # from the http://www.duinsoft.nl/pkg deb all line, or re-add the line manually

                   A method for re-adding the line manually from the command prompt: echo "deb http://www.duinsoft.nl/pkg debs all" | sudo tee -a /etc/apt/sources.list.d/duinsoft.list

              There are other methods for installing Oracle Sun JAVA:

                   a. Download the tar.gz file from the Oracle website and install JAVA manually (this will not update automatically)

                   b. Install a ppa:

              $ sudo add-apt-repository ppa:webupd8team/java

               $ sudo apt-get update

               $ sudo apt-get install oracle-java8-installer

     

     

    2. Upgrade PostgreSQL (e.g. 9.3 to 9.5, if necessary or desired)

    (backup postgresql DB or take a snapshot before starting process)

     

               Stop openfire and postgresql services

         $ sudo service openfire stop

         $ sudo service postgresql stop

     

              If you upgraded Ubuntu from 14 LTS to 16 LTS, the next two steps are likely not necessary as the upgrade process will already have installed the newer postgresql version

              $ sudo apt-get install postgresql-9.5

              $ sudo apt-get install postgresql-client-9.5

     

         Delete the newly installed (and empty) PostgreSQL v9.5 DB 'main' cluster

         $ sudo pg_dropcluster --stop 9.5 main

         Upgrade the old PostgreSQL v9.3 DB 'main' cluster which contains your Openfire DB to v9.5 (this creates a copy of the v9.3. cluster in the new v9.5 directory)

         $ sudo pg_upgradecluster -v 9.5 9.3 main

               Delete the old (and now redundant) PostgreSQL v9.3 DB 'main' cluster

         $ sudo pg_dropcluster 9.3 main

     

         Remove the Postgresql v9.3 packages

         $ sudo apt-get remove postgresql-client-9.3

         $ sudo apt-get remove postgresql-9.3

         $ sudo apt-get autoremove

     

         Make sure both services start without errors

         $ sudo service postgresql start

         $ sudo service openfire start

     

         Restart your server to restore full functionality

         $ sudo shutdown -r now

     

     

    3. Upgrade OpenFire (e.g. 3.10.2 to 4.1.5)

    (backup OpenFire DB or take snapshot before starting process)

     

              Download the latest version of OpenFire

         $ wget --no-check-certificate https://download.igniterealtime.org/openfire/openfire_4.1.5_all.deb

     

              Stop the OpenFire service

         $ sudo service openfire stop

     

              Run the OpenFire installer

         $ sudo dpkg -i openfire_4.1.5_all.deb

              Note: the Openfire installer will automatically detect that there is an existing installation of Openfire and will indicate such with text displaying the currently installed version and the new version to be installed.  The Openfire installer will also ask if you wish to overwrite the existing Openfire configuration file with a new version, or keep the existing configuration file.  Since this is an upgrade, you should keep the existing configuration file, and that is the default option.

     

              Make sure the OpenFire service restarts without errors

         $ sudo service openfire start

     

              You MUST restart the server to restore full functionality

         $ sudo shutdown -r now