# Setting up Bahmni with the Data Synchronization Module

**URL:** <https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320>\
**Category:** Implementing\
**Tags:** synchronization, openmrs-dbsync, openmrs-eip, bahmni\
**Created:** [March 14, 2025, 9:50am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320 "2025-03-14T09:50:49Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![masayuki.kubo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/masayuki.kubo/32/20765_2.png) [@masayuki.kubo](https://talk.openmrs.org/u/masayuki.kubo)\
**Post date:** [March 14, 2025, 9:50am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/1 "2025-03-14T09:50:49Z")

</div>

Hello, I am a member of ASHA NPO.

We are planning to set up a system where Bahmini-docker runs on a cloud server and connects with two health posts in Nepal. The data should be synchronized among all sites. For initial testing, I ran three Bahmini-docker instances with sync-module (not sync-module2) in my local VirtualBox and verified that data was syncing properly among the containers.

Can I get any advice for further testing and operational workflow to set up the real system? In advance, thank you all readers.

◆ System Features

- No other EMR systems exist
- Only use the services which related the the following modules:
  - Patient Registration Module
  - Clinical Module
  - Reports Module

◆ Local Test Environment

[Bahmni Test Data Generator DefaultConf] — API —\> [Child0\_bahmni-docker] \<— synced —\> [Parent\_bahmni-docker] \<— synced —\> [Child1\_bahmni-docker]

---

<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:** [March 14, 2025, 10:40am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/2 "2025-03-14T10:40:29Z")

</div>

Hi @masayuki.kubo 👋

If you need to sync OpenMRS data across EMR nodes in a health system, you can explore  
 👉 [dbsync](https://github.com/mekomsolutions/openmrs-dbsync).

The dbsync project is used at scale by at least two implementations, however with non-Bahmni OpenMRS distributions. This should not be a major impediment but may have implications depending on the version of OpenMRS Core that you are running.

---

<div class="post-metadata">

**Author:** ![masayuki.kubo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/masayuki.kubo/32/20765_2.png) [@masayuki.kubo](https://talk.openmrs.org/u/masayuki.kubo)\
**Post date:** [March 15, 2025, 3:18am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/3 "2025-03-15T03:18:46Z")

</div>

Thank you @mskd for reply.

Could undestood some of the overview by checking the readme and your old some posts. I will talk about this with other members and gonna plan implementation test near future.

BTW Does [sync-module](https://github.com/openmrs/openmrs-module-sync) also could be one of the choise in our system? I’d like to have more than option for our challenge.

We use the core version below

OpenMRS Version 2.5.10 Build 0

---

<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:** [March 15, 2025, 9:47am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/4 "2025-03-15T09:47:07Z")

</div>

To be my knowledge there’s ever been three OpenMRS tools/software to achieve this:

1. [openmrs-module-sync](https://github.com/openmrs/openmrs-module-sync)
  - This should probably be ruled out because it is ancient and was designed for much older versions of Core. It’s worth noting that it has been used at scale in at least one implementation.

2. [openmrs-module-sync2](https://github.com/openmrs/openmrs-module-sync2)
  - This should probably be ruled out because it never took off. It was meant to be a standards-based upgrade to the former but it never got traction, suffered some design flaws that became difficult to address and got abandonned.

3. [openmrs-dbsync](https://github.com/mekomsolutions/openmrs-dbsync)
  - This is a different approach to the first two.  
Whilst it is still specific to OpenMRS, it is not a module and is run through a middleware (a Spring Boot app leveraging [openmrs-eip](https://github.com/openmrs/openmrs-eip) under the hood). We had contemplated to make it much less specific to OpenMRS—which would be much better for a piece of middleware that syncs data between nodes—by exchanging Debezium payloads rather than OpenMRS-specific model entities. However, funding waned and this work was never executed. Not a huge deal though, it’s perfectly useable as it is.

---

<div class="post-metadata">

**Author:** ![masayuki.kubo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/masayuki.kubo/32/20765_2.png) [@masayuki.kubo](https://talk.openmrs.org/u/masayuki.kubo)\
**Post date:** [March 15, 2025, 3:10pm UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/5 "2025-03-15T15:10:17Z")

</div>

1 openmrs-module-sync

→ Oh, I thought this was still maintained. [Version 3.0.0 module](https://addons.openmrs.org/show/org.openmrs.module.sync) requires OpenMRS core version 2.5.6 or higher, and the master branch keeps updating.

Anyway, the comparison will help me understand the background.

@mksd, thanks again.

---

<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:** [March 17, 2025, 11:28am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/6 "2025-03-17T11:28:00Z")

</div>

Apologies @masayuki.kubon, my bad, you are right, it looks like PIH/@mseaton did work on the older sync module to adapt it to more recent versions of Core (I hadn’t followed that this had happened).

This possibly makes it a contender as well as dbsync.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [March 17, 2025, 5:17pm UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/7 "2025-03-17T17:17:37Z")

</div>

As far as i remember, the old sync module is not recommended for new installations. I think PIH is maintaining it for the sake of the installations that they already had in place running that module. If they were just starting afresh, they would probably use something else. dbsync is more modern than that old sync module, and hence more recommended.

---

<div class="post-metadata">

**Author:** ![masayuki.kubo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/masayuki.kubo/32/20765_2.png) [@masayuki.kubo](https://talk.openmrs.org/u/masayuki.kubo)\
**Post date:** [March 20, 2025, 4:41am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/8 "2025-03-20T04:41:12Z")

</div>

@dkayiwaAppreciate your comment. We will try dbsync module soon. Let me post updates or qustions if there are any.

---

<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:** [March 20, 2025, 9:28am UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/9 "2025-03-20T09:28:26Z")

</div>

@masayuki.kubo it’s totally fine and appropriate to continue the discussion here, and we will be looking forward to your updates about trying out dbsync, but just a fyi that dbsync can also be discussed on the channel [#openmrs-eip](https://openmrs.slack.com/archives/C0178G3A1T7) on Slack.

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [March 26, 2025, 6:32pm UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/10 "2025-03-26T18:32:50Z")

</div>

> [@dkayiwa](#):
>
> As far as i remember, the old sync module is not recommended for new installations. I think PIH is maintaining it for the sake of the installations that they already had in place running that module. If they were just starting afresh, they would probably use something else. dbsync is more modern than that old sync module, and hence more recommended

I’d say this is accurate. We do continue to make fixes to openmrs-module-sync and PIH does use it in production at scale in Rwanda and Malawi, so it could certainly be something to at least evaluate and compare. However, it certainly is showing it’s age and does not get the kind of maintenance, upgrades, and active development these days that might be needed to truly rely upon it without developer capacity and processes to monitor sync.

A few additional points (@mksd please correct me if I misrepresent):

- My understanding is that dbsync only supports 1-way sync, where as the sync module supports bidirectional sync. If bidirectional sync is needed, that might be an important factor.

- Many implementations still prefer to manage a single application (eg. OpenMRS + modules) rather than multiple applications in a micro-service architecture. dbsync is a separate application which (I believe) requires yet another application (eg. a JMS server like ArtemisMQ). So there may be factors that make one more appropriate than another for a given implementation environment.

---

<div class="post-metadata">

**Author:** ![wyclif](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wyclif/32/19607_2.png) [@wyclif](https://talk.openmrs.org/u/wyclif)\
**Post date:** [March 27, 2025, 12:29pm UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/11 "2025-03-27T12:29:08Z")

</div>

> [@mseaton](#):
>
> My understanding is that dbsync only supports 1-way sync, where as the sync module supports bidirectional sync. If bidirectional sync is needed, that might be an important factor.

Well, 2-way sync is supported as implied by the [sync mode here](https://github.com/mekomsolutions/openmrs-dbsync/blob/master/api/src/main/java/org/openmrs/eip/dbsync/SyncMode.java#L18), it was never thoroughly tested though, neither has it been used in production by an implementation we know of, but it should work if fully tested.

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [March 27, 2025, 1:15pm UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/12 "2025-03-27T13:15:04Z")

</div>

@wyclif that’s great if it is supported. I was mostly [going off of this documentation](https://github.com/mekomsolutions/openmrs-dbsync/tree/master?tab=readme-ov-file#one-way-data-sync), and anecdotal comments I’ve read in the past.

---

<div class="post-metadata">

**Author:** ![wyclif](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wyclif/32/19607_2.png) [@wyclif](https://talk.openmrs.org/u/wyclif)\
**Post date:** [March 27, 2025, 1:52pm UTC](https://talk.openmrs.org/t/setting-up-bahmni-with-the-data-synchronization-module/45320/13 "2025-03-27T13:52:34Z")

</div>

Yes the documentation was never updated, I guess because we were yet to fully test to guarantee functionality before updating it.
