This guide provides instructions on how to perform an OpenMRS upgrade using Docker and Liquibase.
This project assumed an upgrade from OpenMRS upgrade from 2.2.x to 2.6.x
You can add the neccessary liquibase files as needed for you upgrade. See here
- Docker and Docker Compose should be installed on your machine.
- You need access to the MySQL database container and the OpenMRS project directory.
- Add the OpenMRS database to upgrade under db (Ensure you have a backup of the database)
The first step is to start the MySQL database container using Docker Compose. This will launch the database container required for the upgrade process.
docker compose -f docker-compose.database.yml up
Before running the Liquibase migration, build the necessary Docker image for Liquibase.
docker build . -t liquibase-mysql
After building the Docker image for Liquibase, you can now run the Docker Compose configuration to apply the necessary Liquibase migrations to your OpenMRS database.
docker compose -f docker-compose.liquibase.yml up
Once you've run the Docker Compose command for Liquibase, it will apply the migrations from the specified changelog files to your MySQL database. You can verify the migration by checking the logs of the Liquibase container:
After the migration process, create a dump of your updated database.
To dump your database from the MySQL container, you can use the mysqldump
command. Run the following command from your terminal:
docker exec -t openmrs-db mysqldump -u openmrs -popenmrs openmrs > updatedDB.sql