The following instructions explain how to upgrade an instance of OpenEMPI from 3.5.x to the 4.0.0 release. Note that the 4.0.0 release of OpenEMPI includes considerable changes to the application, including changes to the REST API that introduce incompatibilities with the 3.5.x releases. We strongly recommend that you perform this upgrade on a test or development instance and fully test your integration with OpenEMPI first before upgrading your production instance to this version. Before attempting this upgrade make sure you have a complete backup of your instance data and configuration information.

1. Shutdown your Tomcat server instance. Make sure the server has shutdown before moving on to the next step.


2. Backup your Postgres and OrientDB databases. You can find instructions on how to do that here.

3. Install the 4.0.0 instance in its new OPENEMPI_HOME directory. Follow the installation instructions for installing a new instance of OpenEMPI from a distribution that can be found here. The recommended approach is to install new releases in the same directory so that openempi-4.0.0 and openempi-3.5.y are in the same directory. On our installations, we follow the convention of installing new releases in the /sysnet/openempi directory so that the 4.0.0 release would be installed in the /sysnet/openempi/openempi-4.0.0 directory and the 3.5.7 release would be installed in the /sysnet/openempi/openempi-3.5.7 directory.

For the purpose of these instructions, we assume that OPENEMPI_OLD_HOME points to the installation directory of the 3.5.x release

4. First, compare the contents of the following configuration files between the 3.5.x and 4.0.0 directories and if they include changes that you have made, then merge those changes into the new version of the file. If you have questions about specific differences between the two versions and are unsure how to proceed, don't hesitate to reach out to us through the customer support portal. We can perform the merge between the configuration files for you. For example, the may have been changed to activate or deactivate specific modules in your instance of OpenEMPI and may have changed to reflect a change in the database password for the relational or graph databases.

openempi-entity-3.5.x/conf/ (not likely to have local changes for your environment)
openempi-entity-3.5.x/conf/ (more likely to have local changes for your environment)
openempi-entity-3.5.x/conf/applicationContext-resources.xml (more likely to have local changes for your environment)
openempi-entity-3.5.x/conf/applicationContext-services.xml (not likely to have local changes for your environment)

5. Copy the following configuration files from the 3.5.x to the 4.0.0 directory.



6. Migrate the Graph database to the 4.0.0 release.

NOTE: This is a very important step in moving to the 4.0.0 release or later releases. Failure to perform this step can cause irreversible corruption to your database. In the following instructions we make the assumption that the data directory for the 3.5.7 (or the 3.5.x release of OpenEMPI you are upgrading from) is at: /sysnet/openempi/openempi-3.5.7/data.Your data directory is specified in the data-directory parameter of your mpi-config.xml file.

$ cd /tmp
$ wget
$ tar xf orientdb-3.0.38.tar.gz
$ cd /sysnet/openempi/openempi-3.5.7/data
$ /tmp/orientdb-3.0.38/bin/
OrientDB console v.3.0.38 - Veloce (build b636a4c891bc1b0f93df5bb16ec72dedee7a63e7, branch 3.0.x)
Type 'help' to display all the supported commands.
orientdb> connect plocal:./person-db openempi openempi

Connecting to database [plocal:./person-db] with user 'openempi'...OK
orientdb {db=person-db}> export database person-db
Database export completed in XXXXXXms
orientdb {db=person-db}> quit
$ /tmp/orientdb-3.0.38/bin/
$ cd /sysnet/openempi/
$ mkdir tmp
$ cd tmp
$ mv /sysnet/openempi/openempi-3.5.7/data/person-db.json.gz .
$ /tmp/orientdb-3.0.38/bin/ 
OrientDB console v.3.0.38 - Veloce (build b636a4c891bc1b0f93df5bb16ec72dedee7a63e7, branch 3.0.x)
Type 'help' to display all the supported commands.
orientdb> create database plocal:./person-db admin admin

Creating database [plocal:./person-db] using the storage type [PLOCAL]...
Database created successfully.

Current database is: plocal:./person-db
orientdb {db=person-db}> import database person-db.json.gz

Database import completed in XXXXX ms
orientdb {db=person-db}> quit
$ cd /sysnet/openempi/openempi-4.0.0
$ rm -rf data/person-db    # Remove the target directory just in case it is already there.
$ cp -r ../tmp/person-db data   # Above we restored the database in the /sysnet/openempi/tmp directory

7. Run any database upgrade scripts that are specific to the new version you are upgrading to. Not every release includes a database upgrade script but if there is one, it would be in the conf directory under OPENEMPI_HOME. Upgrading to the 4.0.0 release from 3.5.x requires that you run the script update_database_schema-4.0.0.sql.

psql --user=openempi --password --host=localhost
\i update_database_schema-4.0.0.sql

8. Start your instance of OpenEMPI using the startup script from the new release directory. If you are using a service startup script to automatically start your instance of OpenEMPI, make sure you update the script to reflect its new directory location (this is usually installed in /etc/systemd/system/openempi.service).