DHIS2 War file Change

I want to change War file of my DHIS2 Instance.I am using Ubuntu lxd Containers.
I have my War file in /opt/dhis and in webapps all the extracted apps. Now I have 2.40.6 version and I want to upgrade to 2.41.3. when I replace the old war file opt/dhis with the new one then noting happen after restarting tomaca9 it still loads 2.40.6.

1 Like

Hello Tahir,

For upgrading War file your need to upgrade the database too. And to deploy the war file you need to stop the instance first then run the below script to depoly 2.41 version.
dhis2-deploy-war -l https://releases.dhis2.org/41/dhis2-stable-41.3.0.war instance_name
Then restart the tomcat.
Make sure you update the java version.

Okay Thanks for the database info can you guide me where I need to replace the old war file with the new one . which folder structure. and also guide me through the upgradation of database.
Regard’s
Tahir Zaman Khalid

Thanks @MohinderS!

@Tahir_Zaman , if you’re on Ubuntu, you’d use the same way as you originally did when setting up for the first time:

  • Move the WAR file into the Tomcat webapps directory. We want to call the WAR file ROOT.war in order to make it available at localhost directly without a context path: Using war file downloaded with above wget example:
sudo mv dhis.war /home/dhis/tomcat-dhis/webapps/ROOT.war

(source)

1 Like

Thanks, I think i Understand what’s happening now according to the manual installation if dhis-home is not set then the war file will be installed in opt/dhis2. and as of my knowledge, I used automated installation and I think I didn’t set the DHIS_HOME variable. That is why I am seeing my war file in opt/dhis2. Have I Got it Right?

Hello Tahir,

In the automated installation you don’t need to change into the DHIS_HOME manually. Manual changes required when you do manual installation.
As updated you earlier in the lxd installation change the war file you just need to run below command.
example :

dhis2-deploy-war -l https://releases.dhis2.org/41/dhis2-stable-41.3.0.war hmis

2 Likes

Thank You @Gassim @MohinderS For the Guidance. I have successfully changed it and it is working. Before, I was doing wrong by installing the JDK 17 but not setting the configuration to run JDK 17 for Tomcat. As soon as I did it, the system was up and running. Thanks for the support.
Regards,
Tahir Zaman Khalid

3 Likes

Great to know :+1:

1 Like

A post was split to a new topic: Issues Upgrading From 2.38 to 2.42