Sample database loading error into postgres 11

Hi All,

I fetched error while tried to restore sample dhis2 database from (https://s3-eu-west-1.amazonaws.com/databases.dhis2.org/sierra-leone/2.31/2.31.0/dhis2-db-sierra-leone.sql.gz) into postgres 11.

It was giving error
psql:<>: invalid command \N

My working environment was,
OS: windows 10
postgres: 11
tomcat: 9
dhis2: 2.31

Later I downgrade my database version to postgres 10 and everything worked fine and smooth.

This information might be helpful for whom who might want to work on dhis2 with postgres 11.

Hey hi Sarder,

I’m trying to load the sample database 2.29 over 2.29 dhis2 database. But its giving me lot of errors and i dont think anything is been stored in the database.

Can you help me the steps through the same.

Would be grateful. Thanks

Hey Rahul @usfreak13 ,
Which postgres version are you trying to load? What is your server OS (windows/ubuntu)? What is error are you getting during load? Please provide me these information. if you already fixed it out then congratulations :-).

Hi Sarder,

Im using Postgre 10.7 and on windows 10 and trying to upload database for dhis2 2.30. Error is the invalid command /n on the cmd after i run the psql command to load the database.

I guess the error is because of the Postgis extension which is required for 2.30 version and above.

Let me try on the same and if successful will update.

Thanks

Hi there guys,
I have same problem. I’ve downloaded sierra-leons’ sample data. PG11, Tomcat 9, DHIS 2.34.
psql:dhis2-db-sierra-leone.sql:321750: invalid command \N

have you sold this issue?
thanks

Hi @Ulanbek
as @sohel solved it, try downgrading postgres 11 to postgres 10, that has solved the problem for him, it might solve yours too. :slightly_smiling_face: , update us if it doesn’t solve the problem

Thanks Hamza. I will try, although it is strange instead of upgrading we are downgrading servers’ version.
Maybe somebody have the sierra-leon sample data for pg11?
Thanks

If I remember correctly that \N is related to the postgis extension not being installed.

Jaime, everything is installed.
Not the case…

Sorry, maybe I should have said “created”.

Are you sure you did this:
sudo -u postgres psql -c "create extension postgis;" dhis2

Taken from: Home - DHIS2 Documentation

Yes Jaime, I installed it by following the instructions. And I am using Windows 10pro, installed locally. Main intention is to understand how it works and to learn how to create registry for the local community.
I think after I will seek the answer how to complete those tasks :slight_smile:

Solved:
0. Stopped everything

  1. removed dhis2 database.
  2. Recrecreated new database
  3. Restored all data
  4. Restarted all services

Thanks community🙋‍♂️