Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Metadata Export and Import (1.1)

Volker edited this page Jun 5, 2019 · 3 revisions

DHIS 2 Tracker Program related metadata can be exported and imported from and into the Adapter.

Metadata Export

One or more Tracker Program including its direct and indirect dependencies are exported. The export will include alls data that is required to setup the Tracker Programs again. The metadata export will be in JSON format. Compression of exported metadata is not yet supported.

curl -u admin:district http://localhost:8081/api/metadata

The following query parameters are supported.

Parameter Default Value Description
trackerProgramId All The Adapter IDs of one or more Tracker Programs that should be exported.
excludedSystemUri None The system URIs of one or more system for which no codes should be exported (e.g. http://snomed.info/sct)
includeTrackedEntities false Specifies if tracked entity mappings should be included in the export. Tracked entity mappings require often profiling and should normally not overridden on other systems.
includeResourceMappings false Specifies if resource mappings should be included in the export. Resource mappings require often profiling and should normally not overridden on other systems.
download false Specifies if the resulting JSON file will be offered as a download by the browser. Otherwise the content of the export may be shown in the browser windows.

Metadata Import

Previously exported metadata can be imported again. Specific parts of the exported metadata can be skipped.

curl -u admin:district -XPOST -H "Content-Type: application/json" -i -d "@metadata.json" http://localhost:8081/api/metadata

The following query parameters are supported.

Parameter Default Value Description
updateResourceMappings false Specifies if resource mappings should be updated. If this is disabled, only new resource mappings will be imported.
updateCodes false Specifies if code related metadata should be updated. If this is disabled, only new code related metadata will be imported.
updateScripts false Specifies if script related metadata should be updated. If this is disabled, only new script related metadata will be imported.
Clone this wiki locally