Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add documentation on how to import location tags

This page illustrates how to migrate data from OpenMRS to OpenSRP and Keycloak.

From version 2.2.x and above OpenSRP does not have any direct dependency on OpenMRS. Locations, team, team members were moved to OpenSRP while Users were moved to Keycloak

Location Tags

Get the First export location tags from OpenMRS and import to OpenSRP
TODO add stepsto a JSON file then run POST request for each of the returned location tag in the order of the location hierarchy beginning from the top e.g. starting from the Country to the village level. (NOTE: Currently OpenSRP does not support posting location tags in a JSON Array)

First delete any previously generated JSON file. The execute the SQL statement to generate the JSON.

Code Block
languagebash
sudo rm /tmp/location_tags.json
Code Block
languagesql

SELECT CONCAT('[', group_concat(
        json_object('name', name, 'description', if(description is null, concat(name, ' Tag'), description), 'active',
                    if(retired = 0, true, false))), ']') as tags
FROM location_tag
INTO OUTFILE '/tmp/location_tags.json';

Locations


Get the secure directory that mysql permits to export data. Otherwise when the response returned by the following command is NULLcreate the directory and set the secure_file_priv = /var/lib/mysql-files/ property in your mysql.conf or mariadb.conf file.

...