BBahmni 한국어 매뉴얼검색
한국어 번역 완료
한국어English

Configure backup

Purpose and Benefits

Bahmni has different artifacts in the system like patient documents, patient images, DB data etc. There is a possibility that unwanted events may happen such as hard drive failure or data loss due to some wrong SQL (eg: delete sql) mistakenly run by the user. Bahmni provides mechanism to backup all the artifacts so that if any unwanted event happen then we should be able to recover from the backup so that usage of Bahmni continues as usual at the earliest.

Configure MySQL Databases Backup/Restore

Install Tool

The Xtrabackup tool is used for MySQL database backup. This tool can be installed during the Bahmni installation. Change the inventory file to have the below configuration and rerun the Bahmni installation. The hosts specified in the inventory under mysql-backup-tool will be used to install tools in that particular hosts.

Sample Inventory config
[mysql-backup-tool]
192.168.33.13

Configurable parameters

Below are some of the configurable parameters.

KeyDescriptionDefault Value
pathPath to backup the files. Backed up files are stored in this path./data/openmrs (for openmrs database)/data/reports (for bahmni_reports database)
restore_pathPath from where the restore files are picked up. In order to restore a file, it has to be present in this configured location/data/openmrs (for openmrs database)/data/reports (for bahmni_reports database)
retention_limitMaximum number of files maintained. Beyond this, the system automatically replaces the old files with the new backed up files.2
Sample Config for Openmrs
openmrs:
  path: /data/openmrs/
  retention_limit: 2
  restore_path: /data/openmrs/
Sample Config for Bahmni Reports
bahmni_reports:
  path: /data/reports/
  retention_limit: 2
  restore_path: /data/reports/

Configure Postgres Databases Backup/Restore

Install Tool

The Pgbackrest tool is used for Postgres database backup. This tool can be installed during the Bahmni installation. Change the inventory file to have the below configuration and rerun the Bahmni installation. The hosts specified in the inventory under postgres-backup-tool will be used to install tools in that particular hosts.

Sample Inventory config
[postgres-backup-tool]
192.168.33.13

Configurable parameters

Below are some of the configurable parameters.

KeyDescriptionDefault Value
pathPath to backup the files as well as restore the files from. Backed up files are stored in this path. The file to be restored should be present in this location configured./var/lib/pgbackrest
retention_limitMaximum number of files maintained. Beyond this, the system automatically replaces the old files with the new backed up files.2
Sample Config
postgres:
  path: /var/lib/pgbackrest/
  retention_limit: 2

Configure Artifacts Backup/Restore

The host specified in the inventory under bahmni-backup-artifacts will be used to take backup in that particular host.Only one host can be specified to take backup

Sample Inventory config
[bahmni-backup-artifacts]
192.168.33.13

Configurable parameters

Below are some of the configurable parameters

KeyDescriptionDefault Value
async_timingrestore and backup can be done asynchronously.This timing is the maximum runtime for which the job will run in background.value has to be specified in seconds.86400
backup_to_pathpath to store the backedup artifacts/mymount
backup_from_pathpath from where backup has to be taken/home/bahmni/patient_images/home/bahmni/document_images/home/bahmni/uploaded-files/home/bahmni/uploaded_results/home/bahmni/pacs_images/home/bahmni/reports
restore_from_pathpath from where backup files that has to be restored will be taken/mymount
restore_to_pathpath to restore artifacts/home/bahmni/
retention_limitMaximum number of files maintained for each artifact. Beyond this, the system automatically replaces the old files with the new backed up files.2
Sample Config
patient_images:
     backup_to_path: /mymount
     backup_from_path: /home/bahmni/patient_images
     restore_from_path: /mymount
     restore_to_path: /home/bahmni/
     retention_limit: 2

Issues Fixed:

The issue mentioned here related to artifacts is fixed as part of release-0.89.관련 문서: Known Issues with DB Backup and Restore

Sample Config
all_artifacts:
   - name: patient_images
     backup_to_path: /mymount
     backup_from_path: /home/bahmni/patient_images
     restore_from_path: /mymount
     restore_to_path: /home/bahmni/
     retention_limit: 2
원문 정보

Bahmni Wiki · CC BY-SA 4.0

원문 보기 ↗