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