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

Performing a Backup of Bahmni Data on USB or External Drive

Steps to be Performed

  1. Encrypt USB/External drive using steps mentioned in https://miguelmenendez.pro/en/articles/encrypt-usb-storage-device-linux-unified-key-setup-luks.html. Note down the password in a secret location. And don't keep a password that is shared / re-used / easy-to-guess. This is a ONE TIME activity for the drive. Encrypting the USB has the advantage that even if you lost it, you will feel a little better that it will be very difficult for someone to get to the data.
  2. Mount the hard drive at /media/USB.
  3. Create directories in the USB (use the mkdir command): 
    # Folder struture
    emr_backup
       |____ database
       |____ patient_images
       |____ document_images
       |____ uploaded-files
       |____ uploaded_results
       |____ pacs_images
           |____archive
  4. Unlock it with the command ‘cryptsetup luksOpen LUKS0001’ with passphrase/password.
  5. Mount the hard drive using command ‘mount /dev/mapper/LUKS0001 /media/USB'
  6. Copy the backups as per the below steps (NOTE:rsync is a command line program for doing delta updates / copy. Read more about it here):  /media/USB/emr_backup/database/ # Backup image files - patient images, document images, pacs images, uploaded_results, uploaded-files (depending on what features of Bahmni you are using) rsync -rh --progress -i --itemize-changes --update /home/bahmni/patient_images /media/USB/emr_backup/patient_images/../ rsync -rh --progress -i --itemize-changes --update /home/bahmni/document_images /media/USB/emr_backup/document_images/../ rsync -rh --progress -i --itemize-changes --update /home/bahmni/uploaded-files /media/USB/emr_backup/uploaded-files/../ rsync -rh --progress -i --itemize-changes --update /home/bahmni/uploaded_results /media/USB/emr_backup/uploaded_results/../ rsync -rh --progress -i --itemize-changes --update /var/lib/bahmni/dcm4chee-2.18.1-psql/server/default/archive /media/USB/emr_backup/pacs_images/archive/../]]>
    # Take database backup using the DB backup scripts for MySQL and PostGreSQL DBs
    
    
    cd ~/bahmni-environment/scripts
    ./backup-mysql.sh password
    ./backup-psql.sh
    cp /backup/<two newly created files> /media/USB/emr_backup/database/
    
    
    # Backup image files - patient images, document images, pacs images, uploaded_results, uploaded-files (depending on what features of Bahmni you are using) 
    
    
    rsync -rh --progress -i --itemize-changes --update /home/bahmni/patient_images /media/USB/emr_backup/patient_images/../
    rsync -rh --progress -i --itemize-changes --update /home/bahmni/document_images /media/USB/emr_backup/document_images/../
    rsync -rh --progress -i --itemize-changes --update /home/bahmni/uploaded-files /media/USB/emr_backup/uploaded-files/../
    rsync -rh --progress -i --itemize-changes --update /home/bahmni/uploaded_results /media/USB/emr_backup/uploaded_results/../
    rsync -rh --progress -i --itemize-changes --update /var/lib/bahmni/dcm4chee-2.18.1-psql/server/default/archive /media/USB/emr_backup/pacs_images/archive/../
  7. Umount the disk using &lsquo;umount /media/USB'.
  8. Lock the drive again with &lsquo;cryptsetup luksClose LUKS0001'.
  9. Disconnect the hard drive and keep it in a safe, secure and remote place from the production environment.
원문 정보

Bahmni Wiki · CC BY-SA 4.0

원문 보기 ↗