Metadata Import Error

Hi everyone,

I have recently installed dhis2 2.30 in my ubuntu 19.10 server with tomcat9, postgresql 12 and openjdk8 for testing purposes. I am trying to import metadata which is exported from the other dhis2 server with same version i.e. 2.30. I did import the organization Units metadata, after the successful import the some icons are displayed as in screenshot below.

However it is not the big problem, while I tried to import the metadata for data set I get following error messages:

	Invalid reference [Xs8UQuJBVi2] (UserGroup) on object 11-1 Tubercluosis Dataset [a2JkM9Uvfa2] (DataSet) for association `userGroupAccesses`.
	Maximum length of property `shortName`is 50, but given length was 74.

How can I resolve this error? Please help me to import dataset metadata so that I can use it from data entry app.
Thanks in advance.

1 Like

HI @zerotwo,

About the error while importing metadata - you will have to change the shortName values to a max of 50 characters as the limit. Edit the values on the shortName field then try importing again and let us know what happens.


1 Like

Hi @jomutsani,

Is there any way to import the data set without editing the json file? The json metadata of dataset is exported from other dhis2 instance and I need to import the dataset metadata same as the previous dhis2 instance.
I tried altering the type of table attribute shortName to varchar(100) but It didn’t work.


1 Like

Hi @zerotwo,

Based on my knowledge, the shortname is set to a maximum of 50 characters and you can’t adjust it. You may have to edit the name to suit the system requirement.
I’m happy to hear from other members if they have a different workaround for this.


1 Like

This might not be the most technical of workarounds and I do not know how many datasets you have but I would actually go check all the datasets to be sure their shortnames are less than 50 characters and then run the export and import again.
Sorry if that does not help.

At WHO we have been working on an application to move metadata (and data) from one DHIS2 instance to another one called MetaData Sync.
It may be helpful for your case. It handles exchanges of data and metadata between two DHIS2 instance with different base metadata.

Here the link to the last release in case it helps: