Failed Export Concepts - MetaSharing module

Hi all,

I’m trying to export metadata like Concept from one server to another. But I have failed to publish a package. Could be I don’t know how.

Steps Taken

  • Move to the metadatasharing module dashboard using the legacy ui
  • Moved to the configure data page. I added my url prefix as ‘http://localhost:8080/openmrs
  • Move to Export Metadata —> Create Package.
  • I added Concept data to created Package —> Click Export
  • Opppsss, validation error is caused.

Could you help me here.

MetadaSharing Module version - 1.3.0, Platform - 2.0.6

I have looked through this User guide but it looks obsolete.

cc: @dkayiwa, @ssmusoke

This is specifically occurring when export Concepts. Other metadata types are Exported successfully. Could I be doing it wrongly?

cc: @dkayiwa

Does it work if you export one concept?

It doesn’t work @dkayiwa

Could someone direct me on how to workaround this. Its really blocking me. We can’t merge Patients Data without using this module to share concepts.

cc: @dkayiwa, @ssmusoke, @wyclif

Take a look at this thread

Thanks @willa for looking in this but it looks like error was specific to particular concepts which @akanter could have fixed. I couldn’t get any solution from the thread

Do you get the same error on this server?

Yes @dkayiwa

From the stack trace it seems like you are facing the same problem. From the trace I see

Caused by: org.openmrs.api.DuplicateConceptNameException: ‘Oui’ is a duplicate name in locale ‘fr’


Caused by: org.openmrs.api.DuplicateConceptNameException: ‘Não’ is a duplicate name in locale ‘pt’

@samuel34 you have an invalid concept with a duplicate french name among the concepts you are attempting to import, please look at the error details for the uuid of concept and try to fix it before you try again.

On a second thought and may be this is a very naive question, if the server can allow the duplicate names concepts to exist why can’t the metadata sharing module simply export them? What I am wondering is, how does a server end up with duplicates if it is not supposed to be allowed in the first place? Is it possible that they are created outside the API may be or am I missing something?

That error is triggered by an export process.

What makes me wonder the same error happens when you try to export Concepts from the demo server.

This what I wanna learn of. I don’t know how

Can you post the error you are getting on the

Perfect question that I was almost asking @dkayiwa

You could validate the concepts on your server. It’s likely to find the same problem with duplicate names for “yes” in Portuguese (pt) and French (fr) locales. The validation module does a great job of finding duplicates, but you need to clean them up.

Here is the error on the demo site

This arises if you imported the concepts outside of the API e.g. by loading a sql script, and this is actually how the CIEL dictionary is loaded

You edit the concept on the source server and fix the name to be unique before you import it.

You have several invalid concepts on the source server, I bet if you tried to save one of those offending concepts on the source server on the concept form page in the legacy UI, the operation would fail with that exact same error.

You can use the validation module to find all invalid concepts and fix them before you import them.

So indeed you have duplicates. Searching for não on demo gives the results below.

I think the easiest fix for testing purposes is retiring the concept that is not being used or renaming as per Wyclif suggestion. Otherwise the comprehensive solution would be to use the validation module as per Ellen’s suggestion.