Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This page documents how to take a DB Backup of your OpenMRS / EMR DB from Kubernetes environment (running on cloud), build a docker image with this DB, and then run Bahmni docker compose with the restored database.

WARNING: If you are working with production data, please be very careful how you handle it, who has access to it, and where you share/keep it. It is illegal to make private patient data available to people without authorisation in most countries!

...

5. Navigate to bahmni-scripts root directory and execute the following docker command (note the TAGNAME should be set to some specific value. e.g my-build-1):

Code Block
docker build --no-cache -t bahmni/openmrs-db:<TAGNAME> -f demo/db-backups/1.0.0-lite/mysql5.7/Dockerfile .

...

  1. Navigate to the bahmni-docker/bahmni-lite or bahmni-india-package directory where the docker- compose.yml is present

Info

If using Apple M1 chip, add platform: linux/amd64 to each service present under the docker compose file.

2. Add the openMRS DB details captured earlier in DB backup extraction to the .env file and save it. Ensure the OPENMRS_DB_IMAGE_NAME is pointing to the newly created docker image (as generated in the previous step).

Code Block
# OpenMRS Environment Variables
OPENMRS_IMAGE_TAG=latest
OPENMRS_DB_IMAGE_NAME=bahmni/openmrs-db:<TAGNAME>
OPENMRS_DB_NAME=<DBNAME>
OPENMRS_DB_HOST=openmrsdb
OPENMRS_DB_USERNAME=<DBUSERNAME>
OPENMRS_DB_PASSWORD=<DBPASSWORD>
OPENMRS_DB_CREATE_TABLES='false'
OPENMRS_DB_AUTO_UPDATE='true'
OPENMRS_MODULE_WEB_ADMIN='true'
MYSQL_ROOT_USERNAME=root
# OMRS_DEV_DEBUG_PORT=
OMRS_JAVA_SERVER_OPTS=''
OMRS_JAVA_MEMORY_OPTS=''
OPENMRS_UPLOAD_FILES_PATH=./openmrs-uploads
BAHMNI_OPENMRS_MODULES_PATH=
MYSQL_ROOT_PASSWORD=<ROOTPASSWORD>
OPENMRS_DB_TYPE=mysql
OPENMRS_DOCKER_ENV='true'

...