Performing a meta-data dependency export and exclude all sharing

Hi,

I am trying to perform a meta-data dependency export of a program and want to exclude all the sharing. This is not an option through the UI so tried the following via the API:

https://cbs-dev.dhis2.org/dhis/api/programs/uYjxkTbwRNf/metadata.json?attachment=metadataDependency.json&!user,!publicAccess,!userGroupAccesses=EXCLUDE

AND

https://cbs-dev.dhis2.org/dhis/api/programs/uYjxkTbwRNf/metadata.json?attachment=metadataDependency.json&fields=!user,!publicAccess,!userGroupAccesses

In both cases it still includes the sharing. Is there a proper way to do this? Thanks!

1 Like

@Shurajit_Dutta

I just created a jira issue to solve this.

https://jira.dhis2.org/browse/DHIS2-5709

Also if you don’t mind just having those sharing settings in the exported file, then when importing you can try to specify the skipSharing=true parameter.

api/metadata.json?importMode=COMMIT&dryRun=false&identifier=UID&importReportMode=ERRORS&preheatMode=REFERENCE&importStrategy=CREATE_AND_UPDATE&atomicMode=ALL&mergeMode=MERGE&flushMode=AUTO&skipSharing=true&skipValidation=false&async=true&inclusionStrategy=NON_NULL&format=json

2 Likes

Thank you @viet for your prompt response :smile:

Best,
James.

1 Like

Great, thanks Viet

2 Likes