Restoring Sample Database Sierra Leone 2.30 on DHIS2


I’ve installed DHIS2.30 with Postgre 10.7, Java 8 & Tomcat 8.5.

Now im facing problem with importing the sample database 2.30 into Postgresql and getting Invalid Commands /N continuously and its not importing anything into the database.

Is there a problem with the database and compatibility with the postgres version.

Please let know if somone has successfully installed the sample database v2.30 on the postgres 10.7 or above.

Thanks in Advance.
@bobj @Emma_Kassy @Knut_Staring @clairebre @jomutsani


Hi Rahul,
Have you installed the postgis extension yet? I did this and managed to download, unzip, import 2.30
but I do not know how to point the localhost:8080 to this database rather than the DHIS2 database. I tried to change the database name in the dhis.conf file but this just took me back to the 404 error.


Hey Hi Claire,

I tried to import DHIS 2.30 sample database but invalid command /n was the error i was getting. Im trying install the postgis then lets see how it works.

I will update you in case i get any success.

Also in the mean while if you can help with the installation of PostGIS steps or any documentation how to do the same would help.



@usfreak13 Note that you will need to have postgis extension created in the database BEFORE you import the sample db into it.

To install postgis check this link Installation | PostGIS .- it has installers for various platforms. After you have installed postgis, you need to enable the extension in a specific database. For that you need to execute CREATE EXTENSION POSTGIS; in the database in which you wish to import the samle demo data.

To verify postgis is installed and extension is created in the database, you can execute SELECT POSTGIS_FULL_VERSION(); in the db. If you get some result (any result rather than an exception), then everything is ok so far.

Once you have verified, you can proceed to importing the sample demo data into this database. Let us know how it goes.


@clairebre Changing of database names has to be done in the dhis.conf file. The relevant configuration property is connection.url=jdbc:postgresql://localhost/sierra

Once this change is saved in dhis.conf, a restart of the dhis2 application will pick up the new configurations and startup.

Let us know more details of the 404 error you are talking about. What is shown in the logs? Do you think the db is correctly imported with all tables and data?


Hi Rahul,

Go here to start.

There is a post to follow called ‘Can’t login after restoring sample database’ which I started.

When you come to this partpsql -d sierra --username=postgres -c ‘CREATE EXTENSION postgis’

On Windows you have to use “ not ‘

See how you go.



BTW Rahul, why are you setting up DHIS2?

I am planning to use it to set up new environmental health indicators for the Pacific Islands.



We are setting DHIS for monitoring all Rural and Urban health in various states in India.

Thanks for your help on the restoring the database. i will try your link and will let know how it went.

Thanks Again.


Hello House!
Thank you Rahul for it was your journey to installing dhis2 that helped me along too a s I pored over all of the conversations.
Please how did you permanently keep the dhis2 instance on your system.
I have to manually install it every time and it is tiring.Thanks

1 Like

A post was split to a new topic: Importing sample data to DHIS2 instance

Closing this post since it’s three years old. To continue the discussion, please continue in the link above: