This document is intended to explain how to upgrade your IriusRisk version 2 to newer versions. If your IriusRisk installation is lower than 2.0.0, you need to follow this article instead.
Note: To deploy version 3 you need to change the image on your docker-compose file, if you are using docker, continuumsecurity/iriusrisk-prod:tomcat9-3.
Note to upgrade to version 4: To deploy version 4 you need to change the image on your docker-compose file, if you are using docker, continuumsecurity/iriusrisk-prod:tomcat-4.
And please check first the Rules Migration Guide from version 3 to version 4 before proceeding with the version 4 upgrade.
We strongly encourage testing on a pre-production instance first.
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.
If you're using PostgreSQL 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
Upgrade your IriusRisk
Docker based installations:
First of all you need to stop your 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 3 for the latest updates:
image: continuumsecurity/iriusrisk-prod:tomcat9-3
"continuumsecurity/iriusrisk-prod:tomcat9-3" will always contain the latest 3.X version.
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
WAR based installations:
Note: To deploy version IriusRisk version 3 you need to use iriusrisk-3.war.
We strongly encourage testing on a pre-production instance first.
These are the recommended steps:
- Do a database backup with the steps mentioned before
- Copy the old WAR file as a backup (to rollback in case you need it).
- Copy the new war on tomcat webapps folder. Be sure that you rename it correctly.
- When you start the application, check the catalina logs to ensure tomcat is deploying the new war.
- There may be migrations and the upgrade process can be long depending on the data. You can check out the activity in the catalina log file.
Roll back a failed backup
In case you want to roll back to a certain previous version of IriusRisk you will need 2 artifacts:
- Database backup of your data in the desired version.
- IriusRisk container or WAR file in the desired version.
Restore the database
Before making any changes we encourage you to make a final backup.
If you're using PostgreSQL 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.
If you are using containers, 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.1 version put:
image: continuumsecurity/iriusrisk-prod:tomcat9-3.14.1
In case you use a native installation method, download the desired WAR file and run it as usual.
Comments
0 comments
Article is closed for comments.