← Back to team overview

dhis2-users team mailing list archive

Re: How do I change databases in dhis2?

 

*@Knut*, Earlier after seeing your solutions on
*<https://lists.launchpad.net/dhis2-users/msg03086.html
<https://lists.launchpad.net/dhis2-users/msg03086.html>>* I had copied the
*dhis.conf* file and saved it as *hibernate.properties* within the same
directory.

I have now *changed my passwords* (system user, postgresql, and encryption
key) and updated my *hibernate.properties* file, I removed /webapps
contents, and replaced with DHIS 2.22 war. I have also restarted
the postgres server. After restarting the tomcat it loads for quite a while
and goes blank.

So I restarted my installation,
- first I stopped the tomcat server
- backed up the config/dhis.conf and tomcat-dhis/bin/setenv.sh files
- removed the tomcat-user instance (tomcat-dhis) by deleting the whole
directory, removed the /home/dhis/config directory
- removed the the postresql user and database, re-added them with new
credentials and restarted postgresql (with help from google)
- created a new tomcat-user instance (create the /home/dhis/tomcat-dhis
directory)
- downloaded dhis.war 2.22 and copied it to /tomcat-dhis/webapps/
- replaced the setenv.sh in tomcat-dhis/bin/
- created the /home/dhis/config directory and placed dhis.conf
- started the Tomcat server

And this worked. I now get the following in About DHIS 2

Database type:PostgreSQLDatabase name:dhis2Database user:dhis

I went over this a number of times and I am not sure what worked. But I
strongly suspect that my changed user credentials and DB encryption
required were a connection mis-configuration.

The problems/issues this solved are:
- Changes not persisting beyond Tomcat/Server restart and
- Failure to add custom logo's

Thank you for all your help Knut Staring and Jason Pickering.

I have one more issue which I'll post in a new question.

--
Adam

References