Upgrading from version 4.2.1.2 to version 4.2.1.3

In the 4.2.1.3 version of OpenIAM there were some changes made that require upgrading. This document will guide the users on how to upgrade to version 4.2.1.3 from older ones.

To upgrade, first stop the current version.

openiam-cli stop

Make sure to backup any necessary data from OpenIAM 4.2.1.2 version.

mkdir backup_4.2.1.2
mv services/bin/* backup_4.2.1.2/
mv ui/webapps/*.war backup_4.2.1.2/
  1. Afterwards, cleanup working directories.
cd /usr/local/openiam/ui/webapps/
rm -rf *
  1. Download new files
cd /tmp/
wget https://download.openiam.com/release/enterprise/4.2.1.3/binaries/backend.tar.gz
wget https://download.openiam.com/release/enterprise/4.2.1.3/binaries/frontend.tar.gz
wget https://download.openiam.com/release/enterprise/4.2.1.3/db/4.2.1.3_mysql.zip
  1. Update services
cp /tmp/backend.tar.gz /usr/local/openiam/services/bin/
cd /usr/local/openiam/services/bin/
tar -xvf backend.tar.gz
rm backend.tar.gz
chown openiam:openiam *
  1. Update UI
cd /usr/local/openiam/ui/webapps/
cp /tmp/frontend.tar.gz .
tar -xvf frontend.tar.gz
rm frontend.tar.gz
chown openiam:openiam *
  1. Proceed by updating DB files.
cd /usr/local/openiam/conf/schema/mysql/openiam/
cp /tmp/4.2.1.3_mysql.zip .
unzip 4.2.1.3_mysql.zip
rm 4.2.1.3_mysql.zip
chown -R openiam:openiam 4.2.1.3
  1. Then, add new host in rabbitmq.
rabbitmqctl add_vhost openiam_sas
rabbitmqctl set_permissions -p openiam_sas openiam ".*" ".*" ".*"
  1. Update DataBase
[root@139-162-151-114 openiam]# nano utils/flyway/init.sh
[root@139-162-151-114 openiam]# ./utils/flyway/init.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 260 100 260 0 0 26000 0 --:--:-- --:--:-- --:--:-- 26000
Database access information
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 577 100 562 100 15 46833 1250 --:--:-- --:--:-- --:--:-- 48083
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 183 100 183 0 0 16636 0 --:--:-- --:--:-- --:--:-- 18300
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 577 100 562 100 15 46833 1250 --:--:-- --:--:-- --:--:-- 48083
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 183 100 183 0 0 16636 0 --:--:-- --:--:-- --:--:-- 16636
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 577 100 562 100 15 46833 1250 --:--:-- --:--:-- --:--:-- 52454
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 16727 0 --:--:-- --:--:-- --:--:-- 16727
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 577 100 562 100 15 51090 1363 --:--:-- --:--:-- --:--:-- 52454
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 16727 0 --:--:-- --:--:-- --:--:-- 16727
=============== CRITICAL SECTION ===============

After upgrading, you need to configure a database, as follows.

Use default value if this is new installation. If you are doing update, specify your current (before update) version here, like 4.2.1.2, default: 0.0.0.0

This is the name of the openiam core database. If using mariadb, this is most likely 'openiam', default: openiam
This is the name of the openiam Activiti database. If using mariadb, this is most likely 'activiti', default: activiti
Possible values: mysql, postgres, mssql, oracle. Type of the database that you are going to use with OpenIAM. The RDBMS have to be already installed, default: mysql
Do you want to initialize OpenIAM Schema and Users? Select this if you are not created schema and users in RDBMS yet. Super user (root) password will required [y/n]:n
skip database Initialization installation
This is the hostname of where the openiam core database is., default: localhost
194.233.175.51
This is the port of where the openiam core database is. If using mariadb, this is most likely '3306', default: 3306
This is the hostname of where the openiam activiti database is., default: localhost
194.233.175.51
This is the port of where the openiam activiti database is. If using mariadb, this is most likely '3306', default: 3306
Please validate information below
---------------------------------
FLYWAY_BASELINE_VERSION=2.3.0.0
FLYWAY_OPENIAM_DATABASE_NAME=openiam
FLYWAY_ACTIVITI_DATABASE_NAME=activiti
FLYWAY_OPENIAM_HOST=194.233.175.51
FLYWAY_OPENIAM_PORT=3306
FLYWAY_ACTIVITI_HOST=194.233.175.51
FLYWAY_ACTIVITI_PORT=3306
FLYWAY_DATABASE_TYPE=mysql
Database will be initialized=N
---------------------------------
Please validate your input above, if your are OK with that enter 'y'. To repeat an information collecting procedure enter 'n' :y
/usr/local/openiam/conf/schema/mysql/openiam/
Flyway Community Edition 6.5.4 by Redgate
Database: jdbc:mysql://194.233.175.51:3306/openiam (MySQL 5.5)
Schema history table `openiam`.`flyway_schema_history` already initialized with (2.3.0.0,<< Flyway Baseline >>). Skipping.
Successfully validated 1097 migrations (execution time 00:00.401s)
Current version of schema `openiam`: 4.2.1.2.999
Migrating schema `openiam` to version 4.2.1.3.001 - OE-1350
Migrating schema `openiam` to version 4.2.1.3.002 - OE-1328
Migrating schema `openiam` to version 4.2.1.3.003 - OE-1234
Migrating schema `openiam` to version 4.2.1.3.004 - OE-1321
Migrating schema `openiam` to version 4.2.1.3.005 - OE-1329
Migrating schema `openiam` to version 4.2.1.3.006 - OE-1440
Migrating schema `openiam` to version 4.2.1.3.007 - OE-1321
Migrating schema `openiam` to version 4.2.1.3.008 - fix policy map
Migrating schema `openiam` to version 4.2.1.3.009 - fix ms auth policy
Migrating schema `openiam` to version 4.2.1.3.010 - OE-1479
Migrating schema `openiam` to version 4.2.1.3.011 - OE-1479
Migrating schema `openiam` to version 4.2.1.3.012 - Test H2 db connector
Migrating schema `openiam` to version 4.2.1.3.013 - OE-1508
Migrating schema `openiam` to version 4.2.1.3.014 - OE-1503
Migrating schema `openiam` to version 4.2.1.3.015 - OE-1524
Migrating schema `openiam` to version 4.2.1.3.016 - OE-1601
Migrating schema `openiam` to version 4.2.1.3.017 - OE-1081
Migrating schema `openiam` to version 4.2.1.3.018 - OE-1575
Migrating schema `openiam` to version 4.2.1.3.019 - OE-1221
Migrating schema `openiam` to version 4.2.1.3.999 - version
Successfully applied 20 migrations to schema `openiam` (execution time 00:01.030s)
Flyway Community Edition 6.5.4 by Redgate
Database: jdbc:mysql://194.233.175.51:3306/activiti (MySQL 5.5)
Schema history table `activiti`.`flyway_schema_history` already initialized with (2.3.0.0,<< Flyway Baseline >>). Skipping.
Successfully validated 7 migrations (execution time 00:00.017s)
Current version of schema `activiti`: 4.2.1.0.999
Schema `activiti` is up to date. No migration necessary.

Done.

Then, change:

wget https://download.openiam.com/release/enterprise/4.2.1.3/binaries/4.2.1.3_mysql.zip

to

wget https://download.openiam.com/release/enterprise/4.2.1.3/db/4.2.1.3_mysql.zip

For other db types:

wget https://download.openiam.com/release/enterprise/4.2.1.3/db/4.2.1.3_mssql.zip

wget https://download.openiam.com/release/enterprise/4.2.1.3/db/4.2.1.3_oracle.zip

wget https://download.openiam.com/release/enterprise/4.2.1.3/db/4.2.1.3_postgres.zip

Finally, create directory in utils called curator

mkdir utils/curator

And create init.sh file there https://bitbucket.org/openiam/rpm-utils/src/RELEASE-4.2.1.3/prepared/openiam/utils/curator/init.sh

The provisionrequest elasticsearch document can grow to be many GB in size, and, thus, we must add the possibility to curate it.

Before deploying and upgrading, you will need to run:

curl -XDELETE "http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/provisionrequest"
curl -XDELETE "http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/connectorreply"
curl -XDELETE "http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/provisionconnectorrequest"

After, run init.sh from utils/curator and then start openiam.

openiam-cli start