1

I've set up DHIS2 Live on my computer. I would like to import the sample data that is supplied along with DHIS2 Live, it's a file called "default.sql".

How do I go about importing sql data?

thanks...

1

Assuming this is Windows only. Its a 4 step process:

  1. Download the demo database from the dhis download site. It's about 188 MB.
  2. Unzip it to get a 2.4GB sql file!
  3. Restore the demo database using psql. You may need to create a database and its user in pgAdmin, or CLI. use google here.

    • Find psql somewhere in C:\...\PostgreSQL\bin. You can use Windows search.
    • Open CMD here by holding shift then right-click on a whitespace.
    • Run psql -d dbname -U username -f demo.sql
  4. After the database is setup. Configure the hibernate.properties or create a new dhis.conf file under the /conf folder then paste the orginal dhis.conf contents as in the implementation guide, ensure your password and username is as in step 3.

You may also refer to this article from the dhis-users group on launchpad.

1
  • I followed all your steeps but during database demo.sql import, it comes with several msgs like "invalid command \N". It implies that it does not import complete database demo.sql file. So import process does not complete successfully.
    – user70181
    Sep 18 '16 at 4:52
1

Please check your database server version with the version of dump you are going to import. Your dumped database server version mentioned above of the sample database dumped file

Example:

  • PostgreSQL database dump
  • Dumped from database version 10.4
  • Dumped by pg_dump version 10.4

I have found the similar issues with Postgres 11 later downgrade of my database server to 10 worked fine for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.