Bahmni 0.93 → 1.0 Migration: Form Translation Files Missing After Restore

Title: Bahmni 0.93 → 1.0 Migration: Form 2 Translation Files Missing After Restore

Hi Bahmni Community, @angshuonline @mohant @josephkagimu1

We are migrating an existing Bahmni 0.93 installation to Bahmni Standard 1.0.0 (Docker) and found an issue related to Form 2 translation files.

Bahmni 0.93 setup

In our 0.93 installation, Form 2-related files were stored in two different locations.

Form definitions/resources were stored under:

/home/bahmni/clinical_forms/

For example:

/home/bahmni/clinical_forms/4532b079-cc52-4526-b090-a737617311fd.json

and referenced from form_resource.value_reference.

However, many Form 2 translation files were stored under the implementation config repository:

/opt/gitRepository/bahmni_config_93/openmrs/apps/forms/translations/

which corresponds to the old Bahmni config translation location.

Migration/backup problem

During migration, the clinical forms backup is created from:

cp -a /home/bahmni/clinical_forms /bahmni-backup/

This successfully backs up the Form 2 definition JSON files.

However, translations that exist only under:

bahmni_config/openmrs/apps/forms/translations/

are not included in clinical_forms.

After restoring into Bahmni 1.0, those translations are therefore missing.

Result after migration

The Form 2 definition itself exists and loads from:

/home/bahmni/clinical_forms/

but requesting translations results in HTTP 500.

For example:

GET /openmrs/ws/rest/v1/bahmniie/form/translations
?formName=Dental+and+Orthodontic+Intervention
&formUuid=e36a3d32-2a5f-4fed-bf70-4e2cadb51596
&formVersion=3
&locale=en

returns:

500 Internal Server Error

OpenMRS log:

Unable to find translation file for <Form Name>_v<version>

org.openmrs.api.APIException:
Unable to find translation file...
    at org.bahmni.module.bahmni.ie.apps.service.impl.
    BahmniFormTranslationServiceImpl.getTranslationJsonFromFile(...)

Bahmni 1.0 configuration

In the Docker installation we have two relevant global properties:

bahmni.forms.directory
bahmni.formTranslations.directory

We are planning to use:

bahmni.forms.directory=/home/bahmni/clinical_forms/

bahmni.formTranslations.directory=/home/bahmni/clinical_forms/translations

This would allow the restored structure to be:

/home/bahmni/clinical_forms/
├── <form-resource-uuid>.json
├── <form-resource-uuid>.json
└── translations/
    ├── <form-uuid>.json
    ├── <form-name>_<version>.json
    └── ...

Proposed migration workaround

During the 0.93 backup, after backing up clinical_forms, we can additionally copy the old config-based translations into the backup:

cp -a /home/bahmni/clinical_forms /bahmni-backup/

mkdir -p /bahmni-backup/clinical_forms/translations

cp -a \
/opt/gitRepository/bahmni_config_93/openmrs/apps/forms/translations/. \
/bahmni-backup/clinical_forms/translations/

Then the existing Bahmni 1.0 clinical forms restore should restore both the form definitions and nested translations directory together.

After restore:

/home/bahmni/clinical_forms/
├── forms...
└── translations/

and:

bahmni.formTranslations.directory=/home/bahmni/clinical_forms/translations

Questions

  1. Is this the expected/recommended approach when migrating Form 2 translations from Bahmni 0.93 to 1.0?

  2. Is there an existing migration step/script that moves translations from:

bahmni_config/openmrs/apps/forms/translations

to:

/home/bahmni/clinical_forms/translations

that we may have missed?

  1. Should bahmni.formTranslations.directory in Bahmni 1.0 normally point to:
/home/bahmni/clinical_forms/translations

rather than the implementation config directory?

  1. Should the official 0.93 → 1.0 migration documentation/backup script explicitly include Form 2 translation files stored in bahmni_config?

We found this because some forms worked correctly after migration while others returned “Unable to find translation file”. The difference was that the working translation files were available under the migrated clinical forms data, while affected forms had translations only in the old bahmni_config repository.

Any guidance on the expected migration strategy would be appreciated.

Hi @sushantpatil1214,

Your proposed workaround is correct. In Bahmni 1.0, BahmniFormTranslationServiceImpl resolves translations by looking for <formName>_<version>.json files in the directory specified by bahmni.formTranslations.directory. The 500 error you’re seeing is simply because those files don’t exist at the expected path after restore.

Your migration script addition of copying translations from the old config path into /home/bahmni/clinical_forms/translations/ and setting:

bahmni.formTranslations.directory=/home/bahmni/clinical_forms/translations

is the right fix. One thing to verify: ensure the copied filenames match the expected pattern (<formName>_<version>.json) — if the old config used UUID-based filenames, you’ll need to rename them.

This is a gap in the official migration documentation. I’d suggest opening a Bahmni JIRA ticket requesting the 0.93 → 1.0 backup script explicitly include Form 2 translations from bahmni_config/openmrs/apps/forms/translations/.