← Back to team overview

dhis2-users team mailing list archive

Re: How do I change databases in dhis2?

 

And change all of the passwords while you are at it, since this is a public
mailing list!



On Wed, Mar 23, 2016 at 8:29 AM, Knut Staring <knutst@xxxxxxxxx> wrote:

> Before changing to 2.22, just rename dhis.conf to hibernate.properties and
> restart tomcat.
>
> You don't need ROOT.war. Just stop tomcat, delete the webapps/dhis folder
> and place the 2.22 war file in webapps.
>
> On Wed, Mar 23, 2016 at 8:25 AM, Adam Dawoodjee <adam.daveed@xxxxxxxxx>
> wrote:
>
>> I dont have the */home/dhis/config/hibernate.properties *file. And don't
>> know what should go in there. I'm running 2.21 as thats what was in the
>> install docs, I thought because its the current stable release.
>>
>> Do you recommend that I switch to 2.22? If so is it just a matter of
>> replacing the* ROOT.war *file and* dhis* directory under webapps?
>>
>> --
>> Adam
>>
>> On Wed, Mar 23, 2016 at 9:20 AM, Adam Dawoodjee <adam.daveed@xxxxxxxxx>
>> wrote:
>>
>>> My */home/dhis/tomcat-dhis/bin/setenv.sh* contains:
>>>
>>>
>>> #!/bin/sh
>>>
>>> #
>>>
>>>
>>> CATALINA_HOME=/usr/share/tomcat7
>>>
>>>
>>> export JAVA_HOME='/usr/lib/jvm/java-8-oracle/'
>>>
>>> export JAVA_OPTS='-Xmx7500m -Xms4000m'
>>>
>>> export DHIS2_HOME='/home/dhis/config'
>>>
>>>
>>> # The first existing directory is used for JAVA_HOME (if JAVA_HOM
>>>
>>> E is not
>>>
>>> # defined in $DEFAULT)
>>>
>>> JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /us
>>>
>>> r/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-
>>>
>>> ibm"
>>>
>>>
>>> # Look for the right JVM to use
>>>
>>> for jdir in $JDK_DIRS; do
>>>
>>>     if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then
>>>
>>>         JAVA_HOME_TMP="$jdir"
>>>
>>>         # checks for a real JDK like environment, needed to check
>>>
>>>  if
>>>
>>>         # really the java-gcj-compat-dev package is installed
>>>
>>>         if [ -r "$jdir/bin/jdb" ]; then
>>>
>>>             JAVA_HOME="$JAVA_HOME_TMP"
>>>
>>>         fi
>>>
>>>     fi
>>>
>>> done
>>>
>>>
>>> # Default Java options
>>>
>>> if [ -z "$JAVA_OPTS" ]; then
>>>
>>>         JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
>>>
>>> fi
>>>
>>> And just in case my */home/dhis/config/dhis.conf* contains:
>>>
>>> # Hibernate SQL dialect
>>>
>>> connection.dialect = org.hibernate.dialect.PostgreSQLDialect
>>>
>>>
>>> # JDBC driver class
>>>
>>> connection.driver_class = org.postgresql.Driver
>>>
>>>
>>> # JDBC driver connection URL
>>>
>>> connection.url = jdbc:postgresql:dhis2
>>>
>>>
>>> # Database username
>>>
>>> connection.username = dhis
>>>
>>>
>>> # Database password
>>>
>>> connection.password = mal@Gov16
>>>
>>>
>>> # Database schema behavior, can be validate, update, create, crea
>>>
>>> te-drop
>>>
>>> connection.schema = update
>>>
>>>
>>> # Encryption password (sensitive)
>>>
>>> encryption.password = m!N!stryOfAgr!c16@MAL
>>>
>>>
>>> # File store provider. Currently 'filesystem' and 'aws-s3' are su
>>>
>>> pported.
>>>
>>> filestore.provider = filesystem
>>>
>>>
>>> # Directory / bucket name. Refers to subdirectory in external dir
>>>
>>> ectory on file system and bucket on AWS S3.
>>>
>>> filestore.container = files
>>>
>>> Thank you,
>>> Adam
>>>
>>>
>>> On Wed, Mar 23, 2016 at 9:10 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>>>
>>>> Hi Adam,
>>>>
>>>> What is inside your setenv.sh file?
>>>>
>>>> On Wed, Mar 23, 2016 at 7:57 AM, Adam Dawoodjee <adam.daveed@xxxxxxxxx>
>>>> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> @*Gerald* I'm running my installation DHIS2 installation on Ubuntu
>>>>> Server 14.04.
>>>>>
>>>>> *@Knut *The contents of my */home/dhis/tomcat-dhis *are as below:
>>>>>
>>>>> dhis@websever:~$ ls tomcat-dhis
>>>>> bin  conf  logs  temp  webapps  work
>>>>>
>>>>>
>>>>> Below is my complete environment:
>>>>> ______________________
>>>>> Web API:Browse it here <http://www.agriculture.gov.zm:8080/api>Current
>>>>> user:adminVersion:2.21Build revision:21057Build date:2016-03-22 11:55User
>>>>> agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,
>>>>> like Gecko) Chrome/49.0.2623.87 Safari/537.36Server date:2016-03-22
>>>>> 23:11Last analytics table generation:Time since last analytics table
>>>>> generation:Last analytics table runtime:Environment variable:
>>>>> DHIS2_HOMEExternal configuration directory:/home/dhis/configDatabase
>>>>> type:DhisH2Database name:
>>>>> dhis2;DB_CLOSE_DELAY=-1;MVCC=TRUE;ALIAS_COLUMN_NAME=TRUE;DB_CLOSE_ON_EXIT=FALSEDatabase
>>>>> user:saJava opts:-Xmx7500m -Xms4000mJava home:
>>>>> /usr/lib/jvm/java-8-oracle/jreJava temporary directory:
>>>>> /home/dhis/tomcat-dhis/tempJava version:1.8.0_74Java vendor:Oracle
>>>>> CorporationOS name:LinuxOS architecture:amd64OS version:
>>>>> 4.2.0-34-genericServer memory:Mem Total in JVM: 4924 Free in JVM:
>>>>> 2984 Max Limit: 6667CPU cores:8
>>>>>
>>>>> ________________________
>>>>>
>>>>> On Tue, Mar 22, 2016 at 11:23 PM, Adam Dawoodjee <
>>>>> adam.daveed@xxxxxxxxx> wrote:
>>>>>
>>>>>> Following Knut Staring's guidance here
>>>>>> https://lists.launchpad.net/dhis2-users/msg03086.html. I have:
>>>>>>
>>>>>> 1. copied the setenv.sh file from tomcat-dhis/bin/setenv.sh to
>>>>>> /usr/share/tomcat
>>>>>> 7/bin/setenv.sh
>>>>>> 2. Completed steps *8.3.5 and 8.3.6 of the implementation guide* and *placed
>>>>>> the dhis.conf file in the /home/dhis/config* directory.
>>>>>>
>>>>>> But my database still says H2.
>>>>>>
>>>>>> Kind regards,
>>>>>> Adam
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Knut Staring
>>>> Dept. of Informatics, University of Oslo
>>>> Norway: +4791880522
>>>> Skype: knutstar
>>>> http://dhis2.org
>>>>
>>>
>>>
>>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> Norway: +4791880522
> Skype: knutstar
> http://dhis2.org
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049

Follow ups

References