Import/Export app did not export all tracked entity instances

Greetings
I’d like to share my experience with the Import/Export app while updating tracked entity records in DHIS2.
My goal was to update the “Full Name” variable for around 923 tracked entity instances. To do this, I attempted to export all 923 records as a CSV using the Import/Export app, but only 322 were exported—this issue persisted even when exporting in JSON format. To work around this, I used the Event Reports app to display all cases and then downloaded the data.
Next, I modified the “Full Name” variable using R for data processing. Since the update process in DHIS2 requires re-importing the JSON file via the Import/Export app, I converted my CSV file to JSON. However, I encountered another challenge: the Event Reports export structure differs from the required JSON format for import, making the conversion process complex.
I’m sharing this experience to highlight two key gaps:

  1. Incomplete exports using the Import/Export app – Has anyone else faced this issue?
  2. Best practices for bulk updating tracked entity data – What is the most efficient way to update a large number of records in DHIS2?
    Looking forward to your insights and suggestions.
1 Like

Hi @jounyabass

I’d say that the route using the Import / Export app is the more standard way; however, you might face more issues when using the deprecated Event Reports app.

Let’s start by addressing the first issue you experienced which is the ‘incomplete’ export of TEIs from the Import/Export app. Is it possible that this is because of settings/authority and access the user has? For instance, if you’d used a superuser account to export, would an incomplete export happen?

In the settings there are options that limit which TEIs are exported such as the question “Which OUs should be included?” 322/923 is a big gap, any idea what’s in the 322 that’s not in the others? For instance, they’re all from certain OUs whereas the remaining are from different OUs…etc

What is the version of the DHIS2 instance you are using? Thanks!

Thank you for your detailed response and insights!

Yes, I am using a superuser account. I tried exporting for a specific OU and a specific tracker program, only a subset of the tracked entity instances was exported.

Additionally, the 322 records in the CSV export do not represent 322 cases. Since each tracked entity instance contains multiple variables, each variable is exported as a separate row. In this case, our tracked entity type contains 7 variables, meaning the 322 rows actually correspond to only 46 cases.

Our DHIS2 instance is running on version 2.39.4.

Regards