Posts

Showing posts from December, 2021

DHIS2 Database Migration/Restoration Process

  DHIS2 Database Migration/Restoration Process This process assumes that the OS is Linux and that you have both the current DHIS2 setup (Will call it “Origin”) and a new/empty DHIS2 instance (Will call it “Destination”) where you intend to migrate data. Actions at Origin Server [Linux] Create a sql dump of the current/origin database: user@origin_server$ sudo su - postgres  postgres@origin_server$ pg_dump dhis2 -U dhis -f dhis2_origin_db.sql   Copy the sql dump to the destination server. You can use ssh client such as PUTTY/WinSCP or simply use the command below: user@origin_server$ scp dhis2_origin_db.sql dhis@ destination_server :/home/dhis/ Actions at Origin Server [Windows] Open Command Line Window Navigate to Postgres bin folder i.e cd C:\Program Files\PostgreSQL\9.6\bin Dump the database using the command below pg_dump.exe -U postgres -d dhis2 -f D:\Backup\<backup-file-name>.sql Type password for your postgres user You may copy the dump fil

Building Your DHIS2 Tracker Event -Power BI Model

Image
 DHIS2 offers the Web API as a robust means for external systems or tools to access and manipulate data stored in your DHIS2 instance. This comes in handy whenever you want to: Push metadata in or out of the instance, Push/pull data into a DHIS2 instance i.e. MoH to Implementing Partner or into analytical tools such as PowerBI and Tableau. The focus of this document is building a Tracker/Event-based data model in PowerBI. Of importance, the tracker Web API consists of 3 endpoints (tracked entity instances, enrollments, events) with full CRUD support ( DHIS2 Documentation ), refer – Figure 1. Figure 1 : EndPoints Baseurl: https://yourdhis2.com/prod/ Essential/Core Endpoints Endpoint Sample Payload API Call TrackedEntity Instance Baseurl/api/trackedEntityInstances.json?ou=L66MANY1j43&ouMode=DESCENDANTS&program=yw0mVtYaERN&trackedEntityInstance=ydKJVwz8h3t&fields=trackedEntityInstance,trackedEnt