Upgrade to Latest Bahmni Release

  1. To update to latest version of Bahmni (which now runs on Docker) please see the following documentation: Upgrading Bahmni on CentOS to Bahmni Standard (or Lite) on Docker.
  2. The page below is for older upgrades, and is deprecated!

Purpose

This page guides with the steps to upgrade the system to latest bahmni version once the fresh installation is done as mentioned in the Install and Setup

Steps to upgrade

Choose the version of bahmni

One has to identify the version to upgrade the system to.

Where to look for release versions ?

All the released versions and the corresponding notes are detailed on All Bahmni Releases

Example (0.91 Version)

If one chooses to upgrade to a version (0.91), pick the corresponding bahmni-installer rpm 

bahmni-installer-0.91-89.noarch.rpm

Update the existing installer rpm

The bahmni-installer rpm is responsible for fetching the required rpm's for bahmni installation. Since the use case is to upgrade to latest version of bahmni, the existing bahmni-installer rpm should be updated. Follow the code snippet below

How to update bahmni-installer rpm ?
sudo yum remove bahmni-installer
sudo yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.91-89.noarch.rpm

Backup 

It is a best practice to take backup data, files and any other local changes done (e.g. app config) in the system.


Backup Data and Files

One can use backups command that bahmni by default provides to backup the databases/files etc. For a comprehensive list of backup commands please see the documentation here. Also ensure that bahmni backup-restore configuration are setup properly in file: /etc/bahmni-backrest.conf

Please make sure to use the inventory file and replace the below command.

sudo bahmni -i <inventory-file-name> backup --backup_type=all --options=all

App Config

Please take a backup of your implementation specific config folders.

How to backup config ?
cp /var/www/bahmni_config ~/bahmni_config_backup

Make sure to backup any other changes you have made in the system.


Run Installation

Run the installation command

Commnad to install
bahmni -i <inventory-file> install

Example - (inventory file name is local)

bahmni -i local install

Make sure to change the setup.yml or inventory file before running the above command if required to modify the installation.

Please look at Install Bahmni on CentOS (Advanced Installation Options) for making changes before installation



Upgrade to Bahmni 0.92

While the above process worked for previous version of Bahmni (0.91 or earlier), upgrading to Bahmni 0.92 will require additional steps, since the OS itself has changed from CentOS 6.x to 7.x. There is no automated tools to do so, & Redhat upgrade tool is no longer available or supported, unless you get an archived version from somewhere. There are unofficial writeup about manual upgradation process from version 6 to 7, but we wouldn't recommend it, unless you know what you are doing! 

In the following sections we describe what would the process for you to migrate from earlier version of Bahmni (0.91 or earlier) to latest 0.92. 

We would recommend

  • installing on a new machine with CentOS 7.6 64 bit version installed. 
  • or re-purposing your existing machine / env.  

Before you start, proceed with caution

  • backup your data and files to an external drive (USB, File System on another machine, Network storage etc) 
  • try out first on a test env before proceeding on the production env


The artefacts that are to be backed up are: 

  1. MySQL databases: Component relevant (openmrs, bahmni_reports etc)
  2. Postgres databases: Component relevant (bahmni_pacs, clinlims, odoo, pacsdb etc)
  3. Patient images: from Bahmni Clinical / OpenMRS
  4. Document images: from Bahmni Clinical / OpenMRS
  5. Uploaded files: from Bahmni Clinical / OpenMRS
  6. Uploaded lab results: from Bahmni Clinical / OpenMRS
  7. PACS images: from Bahmni Clinical / OpenMRS
  8. Report module generated files by Queue feature: from Bahmni reports 


Below we explain 2 approaches for upgrades. Note, in both the approaches, the OpenERP database restoration will not work. 

Manual

Assuming, that you have a new env where you have just installed "bahmni-installer" and not yet run the "bahmni install" command yet. 

From the old env, you need to copy the databases and files/directories and restore them on new env. 


Restore databases

  • First take backup of databases from old env


MySQL DB Backup
$ mysqldump --routines -u root -p openmrs > openmrs_backup.sql
$ mysqldump --routines -u root -p bahmni_reports > bahmni_reports_backup.sql


Postgres DB backup
$ psql clinlims > openelis_backup.sql
$ psql bahmni_pacs > bahmni_pacs_backup.sql
$ psql pacsdb > pacsdb_backup.sql


  • Copy these databases to the new env. Some of the databases can be auto imported during installation
    • You can drop "openmrs_backup.sql" and "openelis_backup.sql" in /etc/bahmni-installer/deployment-artifacts
  • Now, run bahmni installation, and the openmrs and openelis databases will be restored 
    • bahmni -i <your inventory file> install
  • You still need to import the "bahmni_reports", "bahmni_pacs" and "pacsdb_backup" manually


Restore db
$ mysql -u[user] -p[password] bahmni_reports < bahmni_reports_backup.sql
$ psql bahmni_pacs < bahmni_pacs_backup.sql
$ psql pacsdb < pacsdb_backup.sql


Restore files/directories

  • Copy the following directories and files within from old env. The following are the default locations for files


/home/bahmni/patient_images
/home/bahmni/document_images
/home/bahmni/uploaded-files
/home/bahmni/uploaded_results
/home/bahmni/pacs_images
/home/bahmni/reports


  • On new env, you can restore the files exactly in the same locations 

Restart your services, and test out (don't forget to rebuild index on OpenMRS first) 


Using bahmni backup and restore

Alternatively, you can use Bahmni backup command to take a backup of all artefacts, and copy them to the new env and run restore command. 

To do this, first up - install Bahmni on the new env, with your application config specified. 

Before you proceed, check /etc/bahmni-backrest.conf  in the old env to make sure all configuration options are correctly set. We advice that you set a common root directory for all backup artefacts (easier to copy). Check the WIKI page on Configuration of backup


$ bahmni -i <inventory file> backup --backup_type=all --options=all


Copy the backup root directory - to similar path in new env. It can be different as well, but then you should edit the configuration file /etc/bahmni-backrest.conf

Then run the restore command. Check the WIKI Backup/restore page for restore commands and 

# the below db restore is just an example, you need to specify individual databases and appropriate 
# options for restoration. Check WIKI page listed above for commands

$ bahmni -i <inventory file> restore --restore_type=db --options=<DBName> --strategy=<dump/pitr> --restore_point=<Backup foldername>

$ bahmni -i <inventory file> --restore_type=file  --options=all





The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)