Migrating metadata from 2.36 to 2.39

We have a DHIS2 2.36.x and a custom app installed having lots of client data. We plan to upgrade to latest 2.39 but before patching we would like to confirm the app works properly in 2.39. So we installed a 2.39, but when we export the metadata from the prev version it does not import into the latest DHIS2, because of metadata structure changes.

Did anyone face the same issue, or we are not doing it right?

Thank you for your post!

Please add more details such as error logs that you’re seeing. Additionally, if you can share steps to reproduce this on a play.dhis2.org instance, it would be very helpful!

Hi @Mahmud,

Yes, I have faced the same as new dhis2 version has added few new fields. Those fields now shifted the number of columns to right. Therefore if you are relying on number of columns not DE/TEA uid’s then you should do manual update of your software.

Regards, Ulanbek

Let me explain in details. The example I am showing is from 2.38 (the 2.39 was not working so we thought 2.38 would do, but has exact same issues).

When we exported the metadata from 2.36 it contains users, org units and other metadata. As the users are the first JSON block, import stops in 2.38 with following screen -

The structure of user JSON has changed from 2.36 to 2.38. I am attaching the 2 JSONs with this msg.

user_metadata_2_38.json (1.2 KB)
user_metadata_2_36.json (2.1 KB)

Major things to note - 2.36 had a ‘userCredentials’ object which is not present in 2.38. Also 2.38 introduced a new field ‘username’ property which was not there in 2.36. So the users do not import.

Bottom line, we have to manually update each user JSON to match with 2.38 format and then continue importing.

The org units also will not import…which is even more complicated to fix. Please note, I am not talking about any custom app, I am saying normally exporting metadata from 2.36 will not import without manual intervention into 2.38.

1 Like

Hi @Mahmud @Gassim

Hope you have resolved your problem. Below I would like to share the steps, on how normally I do this type of import:

  • create temp database and put all data of old DHIS2.36 instance
  • install 2.38 instance, and point it to the 2.36 database
  • run 2.38 instance where all conversion could be done easily there
  • export new DHIS2.38 metadata into any new stable 2.38 instance.


1 Like