# How to update the OpenMRS Core version of Bahmni?

**URL:** <https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575>\
**Category:** Bahmni\
**Tags:** install\
**Created:** [October 2, 2017, 12:42pm UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575 "2017-10-02T12:42:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mksrom](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksrom/32/20221_2.png) [@mksrom](https://talk.openmrs.org/u/mksrom)\
**Post date:** [October 2, 2017, 12:42pm UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/1 "2017-10-02T12:42:15Z")

</div>

Hi everyone,

I cannot figure out how to deploy a new version of OpenMRS Core on an existing installation of Bahmni (installed the standard way, from the documentation). In my case, this is 0.89. Bahmni 0.89 is using OpenMRS Core 2.1.0 (7eadd7). I would like to use ‘2.1.1-SNAPSHOT’

I have tried to simply replace the existing `openmrs.war` file located in `/opt/openmrs/` with my 2.1.1-SNAP WAR artifact (from the build of OpenMRS Core) but nothing happened (after a restart).

I have also tried to replace the contents of the `/opt/openmrs/openmrs` folder with the new WAR artifact contents (unzipped). Still does not work.

Maybe it has to do with the [openmrs.jar](https://github.com/Bahmni/bahmni-package/blob/master/openmrs/scripts/rpm/start.sh#L2) file used to start Tomcat? So I have tried to use a more recent openmrs.jar file fetched from the build of Bahmni Package 0.90 (0.90 depends on Core 2.1.1-SNAPSHOT) without success either.

Any idea?

Thanks

Romain

---

<div class="post-metadata">

**Author:** ![janux](https://talk.openmrs.org/letter_avatar/janux/32/6_22734026db12803ebb3e059622ac3534.png) [@janux](https://talk.openmrs.org/u/janux)\
**Post date:** [October 3, 2017, 5:29am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/2 "2017-10-03T05:29:08Z")

</div>

Hi,

I also don’t know how to do this but this Confluence page at least indicates that what you are trying to do is possible:

[https://bahmni.atlassian.net/wiki/spaces/BAH/pages/86802434/OpenMRS+Upgrade+to+2.0](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/86802434/OpenMRS+Upgrade+to+2.0)

Just one idea: Did you check the contents of the config file `/opt/openmrs/etc/openmrs.conf`?

---

<div class="post-metadata">

**Author:** ![janux](https://talk.openmrs.org/letter_avatar/janux/32/6_22734026db12803ebb3e059622ac3534.png) [@janux](https://talk.openmrs.org/u/janux)\
**Post date:** [October 3, 2017, 5:31am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/3 "2017-10-03T05:31:40Z")

</div>

Well, after reading it completely, the page is just about the Java upgrade.

---

<div class="post-metadata">

**Author:** ![janux](https://talk.openmrs.org/letter_avatar/janux/32/6_22734026db12803ebb3e059622ac3534.png) [@janux](https://talk.openmrs.org/u/janux)\
**Post date:** [October 3, 2017, 5:39am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/4 "2017-10-03T05:39:35Z")

</div>

Is there any error message in the OpenMRS logs?

---

<div class="post-metadata">

**Author:** ![shashikanth](https://talk.openmrs.org/user_avatar/talk.openmrs.org/shashikanth/32/4533_2.png) [@shashikanth](https://talk.openmrs.org/u/shashikanth)\
**Post date:** [October 3, 2017, 5:47am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/5 "2017-10-03T05:47:45Z")

</div>

Hi Romain,

I would like to know why do you want to upgrade only OpenMRS ? I would suggest not to upgrade as you might face compatibility issues(Not sure of it).

If you still want to deploy the 2.1.1-SNAPSHOT, please take the backup of openmrs/modules and install [bahmni-OpenMRS RPM](http://repo.mybahmni.org.s3.amazonaws.com/rpm/bahmni/bahmni-openmrs-0.90-37.noarch.rpm) (It is packaged rpm of OpenMRS 2.1.1-SNAPSHOT ) and copy back the omods.

Let me know if you face any issues.

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [October 3, 2017, 6:58am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/6 "2017-10-03T06:58:36Z")

</div>

Hi @shashikanth, simply because we need to leverage the latest snapshot. We need to obtain at runtime 2.1.1-SNAPSHOT containing [this](https://github.com/openmrs/openmrs-core/commit/7ee5c96665964ed085107443ca2e90b0d543c7ee) commit.

---

<div class="post-metadata">

**Author:** ![mksrom](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksrom/32/20221_2.png) [@mksrom](https://talk.openmrs.org/u/mksrom)\
**Post date:** [October 3, 2017, 9:28am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/7 "2017-10-03T09:28:26Z")

</div>

> [@shashikanth](#):
>
> If you still want to deploy the 2.1.1-SNAPSHOT, please take the backup of openmrs/modules and install bahmni-OpenMRS RPM (It is packaged rpm of OpenMRS 2.1.1-SNAPSHOT ) and copy back the omods.

Thanks. I can install the RPM just fine but I am having trouble to start the server because of a Java JRE 1.8.0\_101 that is not found. In the log:

```auto
failed to run command `/usr/java/jre1.8.0_101/bin/java': No such file or directory

```

Indeed it seems that JRE 1.8.0\_131 is installed:

```auto
[root@bahmni /]# ll /usr/java/
total 4
lrwxrwxrwx 1 root root 16 Jun 22 22:53 default -> /usr/java/latest
drwxr-xr-x 7 root root 4096 Jun 22 22:53 jre1.8.0_131
lrwxrwxrwx 1 root root 22 Jun 22 22:53 latest -> /usr/java/jre1.8.0_131

```

* * *

But before I spend time troubleshooting this, I would like to make sure this is the right solution for me.

What you are describing seems valid for Core 2.1.1-SNAPSHOT only because Bahmni 0.90 depends on Core 2.1.1-SNAPSHOT and therefore this package is made available. But what if I would like to deploy/use any other version of the Core or a custom fork of it for instance?

What would be the steps to manually update the Core, ie what does the RPM do exactly? (I just need to have a very good understanding and control over this OpenMRS Core update since that will likely needed to be used on production servers at some point)

---

<div class="post-metadata">

**Author:** ![shashikanth](https://talk.openmrs.org/user_avatar/talk.openmrs.org/shashikanth/32/4533_2.png) [@shashikanth](https://talk.openmrs.org/u/shashikanth)\
**Post date:** [October 4, 2017, 5:19am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/8 "2017-10-04T05:19:13Z")

</div>

> [@mksrom](#):
>
> What you are describing seems valid for Core 2.1.1-SNAPSHOT only because Bahmni 0.90 depends on Core 2.1.1-SNAPSHOT and therefore this package is made available.But what if I would like to deploy/use any other version of the Core or a custom fork of it for instance?

Usually if you want to deploy other version, we compile and unzip the war file in the `/opt/openmrs/openmrs` as you said. Not sure what is the issue you are facing.

> [@mksrom](#):
>
> But before I spend time troubleshooting this, I would like to make sure this is the right solution for me.

This is ideally not the right solution. As I have already said that it is not recommended to update openmrs-core without upgrading Bahmni. Can you try changing the JAVA\_HOME variable in` /opt/openmrs/etc/openmrs.conf` to point it to right location.

---

<div class="post-metadata">

**Author:** ![mksrom](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksrom/32/20221_2.png) [@mksrom](https://talk.openmrs.org/u/mksrom)\
**Post date:** [October 4, 2017, 8:30am UTC](https://talk.openmrs.org/t/how-to-update-the-openmrs-core-version-of-bahmni/13575/9 "2017-10-04T08:30:02Z")

</div>

> [@shashikanth](#):
>
> Usually if you want to deploy other version, we compile and unzip the war file in the /opt/openmrs/openmrs as you said. Not sure what is the issue you are facing.

Yes, that works. If just unzipping on top of the current folder (`/opt/openmrs/openmrs`), this works fine, Core is updated. However, if this folder is made empty and then we unzip the WAR, then the server won’t start: Seems like some files are missing.

```auto
Caused by: java.io.IOException: Missing config file: '/WEB-INF/dwr-modules.xml'
...

```

See complete error: [Ubuntu Pastebin](http://paste.ubuntu.com/25671967/)

I am wondering which process that runs at installation of Bahmni is creating those missing extra files. Shouldn’t extracting the WAR be enough?
