We strongly encourage testing on a pre-production instance first.
Step 1: Check rule compatibility
The rules engine in version 4.0 has been changed as explained here. These changes might have some impact on custom rules. In order to validate your instance does not have incompatible rules we have developed the rulesvalidator-4.jar tool available [here] (sha256: de719e45ddf2d65fecdd775d9c3bbcfe6e37e5153d4542dca6e16ead0b6a3d1c).
Use this command to display the help:
$ java -jar rulesvalidator-4.jar help
To validate your rules, execute the following command on your v3 instance:
$ java -jar rulesvalidator-4.jar --connectionString=[jdbc connection string] --dbUser=[database user] --dbPassword=[database password]
If the output is the following:
0:28:04.410 [main] INFO com.iriusrisk.rulesvalidator.RulesValidatorApplication - << Use the help argument (java -jar rulesvalidator-4.jar help) to obtain more information, examples and usage instructions.
2021-11-15 10:28:07.726 INFO 1 --- [ main] c.i.rulesvalidator.report.Report : <<<<<<<<<< REPORT <<<<<<<<<<<<
2021-11-15 10:28:07.727 INFO 1 --- [ main] c.i.rulesvalidator.report.Report : <<<< No unsupported rules detected.
Then you can safely upgrade to version 4 by following the process from Step 2 below.
If the tool reports there are unsupported rules, as for example:
0:38:21.207 [main] INFO com.iriusrisk.rulesvalidator.RulesValidatorApplication - << Use the help argument (java -jar rulesvalidator-4.jar help) to obtain more information, examples and usage instructions.
2021-11-15 10:38:23.695 INFO 1 --- [ main] c.i.rulesvalidator.report.Report : <<<<<<<<<< REPORT <<<<<<<<<<<<
2021-11-15 10:38:23.697 ERROR 1 --- [ main] c.i.rulesvalidator.report.Report : <<<< VERSION 4 UNSUPPORTED USER RULES FOUND!
2021-11-15 10:38:23.698 ERROR 1 --- [ main] c.i.rulesvalidator.report.Report : <<<<< Unsupported user custom rule: Rule: setRiskCalculation.drl, Content: package com.iriusrisk.drools;
import com.iriusrisk.drools.model.*;
import com.iriusrisk.*;
import com.iriusrisk.drools.fact.*;
rule "set calculate risk"
[REDACTED]
Then you have rules that are incompatible with version 4. Each incompatible rule will need to be deleted before upgrading to v4.
- If the rule is not necessary then it can simply be permanently deleted.
- If the rule is required and it's not clear how to migrate it to v4, then, please contact our Customer Support team attaching the full output of the rulesvalidator-4.jar program.
Once there are no incompatible rules present in your version 3 instance, it is ready to be upgraded to version 4.
Step 2: Perform a backup of your database
Regardless of your installation type, you should always have a backup of your IriusRisk database, especially before performing an upgrade to newer versions.
This step is mandatory if you want to be able to do a rollback later.
We recommend performing a backup with pg_dump tool. The command is as follows:
pg_dump -U iriusprod -h your.database.endpoint iriusprod -Fc -f DATABASE.dump
Step 3: Upgrade your IriusRisk instance
Stop the running docker containers by opening a command prompt and changing to the folder that contains IriusRisk files along with docker-compose.yml and execute:
docker-compose stop
Then you need to take a look at your docker-compose.yml. There is a section where you specify the image for tomcat9 container. Check that it points at a generic version 4 for the latest updates:
image: continuumsecurity/iriusrisk-prod:tomcat-4
"continuumsecurity/iriusrisk-prod:tomcat-4" will always contain the latest 3.X version.
Note that "continuumsecurity/iriusrisk-prod:tomcat-4" will always contain the latest 4.X version also.
Then ensure that you have the latest docker images with:
docker-compose pull
Start up your new installation:
docker-compose up -d
On the first run of the new IriusRisk release there will be upgrades and migrations performed on the database. This process can take more than 30 minutes depending on your database size and the type of migrations. You can check the progress of this by viewing the container console with:
docker logs -f iriusrisk-tomcat
The system is up and running and available for use once you see this message:
INFO [main] org.apache.catalina.startup.Catalina.start Server startup in xxxxxx ms
Rollback to a previous backup
In case you want to roll back to a certain previous version of IriusRisk you will need the database backup of your data in the desired version.
Restore the database
Before making any changes we encourage you to make a final backup.
We recommend performing a backup with pg_dump tool. The command is as follows:
pg_dump -U iriusprod -h your.database.endpoint iriusprod -Fc -f DATABASE_FINAL.dump
We start by deleting the current database and create a clean one:
dropdb -U iriusprod -h your.database.endpoint iriusprod
createdb -U iriusprod -h your.database.endpoint -O iriusprod iriusprod
Now we can load the backup in the desired version:
pg_restore -U iriusprod -h your.database.endpoint -Fc -c -d iriusprod DATABASE_VERSION_X.dump
This procedure may throw some warnings trying to delete in-existent tables. Ignore them.
Restore the application
Once the database is ready it's time to download and run the application.
Now just change the image to pull to the desired version. There is a section in your docker-compose.yml where you specify the image for tomcat container. Set the image to the desired version. For example, to get the 3.14.7 version put:
image: continuumsecurity/iriusrisk-prod:tomcat9-3.14.7
Comments
0 comments
Article is closed for comments.