Upgrading DHIS 2 versions after 2.30

Hi sysadmins,

here’s a quick refresher on how to upgrade DHIS 2 versions. In version 2.31 we introduced the Flyway framework which gives us much better controls over database migrations during upgrades. Specifically we now have:

  • A baseline database schema.
  • A guarantee for database migrations being done exactly once.
  • Validation of the database schema, which will abort the upgrade if inconsistencies are detected.

The impact of this is that once a DHIS 2 implementation has reached version 2.30, one should not do incremental versions upgrades and instead go directly to the DHIS 2 version you are upgrading to.

There is no harm in doing incremental upgrades, although it does not add any value and adds a small risk of performing extra database migration work.

Prior to version 2.30, one should still do incremental upgrades, meaning installing each DHIS 2 major version between the current version and the target version. This means that if you are on a version prior to 2.30, you should always install version 2.30 when upgrading.

Examples

Some examples to illustrate this:

1) You are on DHIS 2 version 2.28 and plan to upgrade to 2.33.

Upgrade path: Go to version 2.29 → 2.30 → 2.33.

2) You are on DHIS 2 version 2.30 and plan to upgrade to 2.33.

Upgrade path: Go directly to 2.33.

3) You are on DHIS 2 version 2.31 and plan to upgrade to 2.33.2.

Upgrade path: Go directly to 2.33.2.

Summary

Once you are on version 2.30, you should upgrade directly to the version you are targeting, as all migrations will be included. If you are on version prior to 2.30, you should go through version 2.30.

best regards,

Lars

5 Likes

Thank you a lot Lars, this is a great note I was not aware of. It would indeed reduce some issues we used to have.