Database Backup and Restore

Right now I have a box which was packaged manually (not a versioned box). I realized that I don’t have the ability to update my system using vagrant box update

My plan now is to

  1. Backup the database using bahmni -i local db-backup of my bahmni version 0.87
  2. Download the bahmni vagrant box version 0.88
  3. Restore the backup to the latest box (version 0.88)

Is the above methods the right way to do it ? How do I restore the data from the previous version to the latest one (will I face any issues during restoration ?

Hi @abiieez,

It will take the backup of the databases of the modules that you specified in local inventory file to /db-backup folder.

You can upgrade the Bahmni version to 0.88 manually.

  • ssh to the box
  • Take a copy of bahmni_config and bahmniapps folder
  • Remove existing bahmni-installer rpm yum remove -y bahmni-installer
  • Install latest bahmni-installer rpm yum install -y bahmni-installer-version.rpm
  • Place the db-backup files and bahmni_config folder inside /etc/bahmni-installer/deployement-artifacts folder as mentioned on this wiki page.
  • Trigger install command bahmni -i local install

Once everything installed successfully, check this wiki page to create the box to save existing configuration.

As Bindu has mentioned above, you can either take a DB and File backup, and then copy the backup into the new Virtual Box, or you can upgrade your existing Virtual Box by installing the new version of Bahmni in that box. Her steps above (yum remove, etc) are about the second approach of how you can update the box manually to the latest Bahmni version.

I will still suggest that you backup your database and files safetly out of the Virtual Box, so that if it gets messed up, you can still “destroy” and restore the orignal Virtual box. For instance, besides backing up the databases, you should also backup the configuration files located in your “bahmni_config” folder. Basically the idea is to backup whatever changes you made since you setup Bahmni.

For backup of Virtual Machines (including in Virtual Box) why not make a snapshot. This will keep the full state at the time of the snapshot. With Virtual Box, you could also start a new machine as a clone of the snapshot allowing you to see the state before the upgrade.

1 Like