|
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
One has to identify the version to upgrade the system to.
All the released versions and the corresponding notes are detailed on All Bahmni Releases |
If one chooses to upgrade to a version (0.91), pick the corresponding bahmni-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
sudo yum remove bahmni-installer sudo yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.91-89.noarch.rpm |
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.
|
Please take a backup of your implementation specific config folders.
cp /var/www/bahmni_config ~/bahmni_config_backup |
Make sure to backup any other changes you have made in the system. |
Run the installation command
|
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 |
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
Before you start, proceed with caution
The artefacts that are to be backed up are:
Below we explain 2 approaches for upgrades. Note, in both the approaches, the OpenERP database restoration will not work.
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
$ mysqldump --routines -u root -p openmrs > openmrs_backup.sql $ mysqldump --routines -u root -p bahmni_reports > bahmni_reports_backup.sql |
$ psql clinlims > openelis_backup.sql $ psql bahmni_pacs > bahmni_pacs_backup.sql $ psql pacsdb > pacsdb_backup.sql |
$ 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
/home/bahmni/patient_images /home/bahmni/document_images /home/bahmni/uploaded-files /home/bahmni/uploaded_results /home/bahmni/pacs_images /home/bahmni/reports |
Restart your services, and test out (don't forget to rebuild index on OpenMRS first)
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 |