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

백업 및 복원 명령

기능 소개

Bahmni 시스템에는 환자 문서, 환자 이미지, DB 데이터 등 다양한 산출물이 있습니다. 하드 드라이브 고장이나 사용자가 잘못된 SQL(예: delete SQL)을 실수로 실행해 데이터가 손실되는 등의 예기치 않은 사건이 발생할 수 있습니다. Bahmni는 모든 산출물을 백업하는 메커니즘을 제공해야 하며, 문제가 발생하면 백업에서 복구해 병원 업무를 가능한 한 빨리 정상화할 수 있어야 합니다.

현재 Bahmni 백업 메커니즘은 파일 백업과 데이터베이스 백업의 두 범주를 지원합니다. 지원 항목은 다음과 같습니다.

  1. 환자 이미지 문서 이미지 업로드된 파일 업로드된 검사실 결과 PACS 이미지 Queue 기능으로 Report 모듈이 생성한 파일 MySQL 데이터베이스 Postgres 데이터베이스

기존 백업 및 복원 방식

기존 백업 방식

MySQL 및 Postgres 백업 도구가 설치되어 있지 않으면 다음 명령을 사용하는 기존 방식으로 대체됩니다. 다음 명령은 이전 데이터베이스 백업 방식과 동일한 결과를 냅니다.관련 문서: Bahmni 데이터베이스 자동 백업

inventory_file_name을 알맞은 파일 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Full Openelis/clinlims DB Backup (Old way)
bahmni -i local backup --backup_type=db  --options=clinlims
Full Openerp DB Backupup (Old way)
bahmni -i local backup --backup_type=db  --options=openerp
Full Openmrs DB Backup (Old Way)
bahmni -i local backup --backup_type=db  --options=openmrs
Uninstall Backup Tools
If backrest tools are already installed, then uninstall them to perform oldway backup.
To uninstall pgsql backup tool, execute the following commands

sudo rm -f /usr/bin/pgbackrest
sudo rm -f /usr/bin/pg_backrest
sudo rm -rf /usr/lib/perl5/BackRest
sudo rm -rf /usr/share/perl5/BackRest
sudo rm -rf /usr/lib/perl5/pgBackRest
sudo rm -rf /usr/share/perl5/pgBackRest

To uninstall mysql backup tool, execute the following command
yum list installed | grep xtrabackup|xargs yum remove -y

기존 복원 방식

inventory_file_name을 알맞은 파일 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Restore clinlims/openelis database
bahmni -i local restore --restore_type=db --options=clinlims  --strategy=dump --restore_point=clinlims_dump_20170215-150418.sql.gz
Restore openerp database
bahmni -i local restore --restore_type=db --options=openerp  --strategy=dump --restore_point=openerp_dump_20170215-150418.sql.gz
Restore openmrs db (old way)
bahmni -i local restore --restore_type=db --options=openmrs --strategy=dump   --restore_point=openmrs_dump_20170221084218.sql.gz

완전/전체 백업

가능한 모든 파일과 데이터베이스를 백업하려면 아래 명령을 사용하십시오.

bahmni -i <inventory_file_name> backup --backup_type=all --options=all

inventory_file_name을 알맞은 파일 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Command to backup everything (databases, files)
bahmni -i local backup --backup_type=all --options=all

백업 예약:

백업을 예약하려면 명령줄의 --schedule 옵션을 사용할 수 있습니다. 이 옵션은 사용자의 cron 항목을 추가하여 일정에 따라 명령을 실행합니다.

Sample command
bahmni -i <inventory_file_name> backup --backup_type=<file/db> --options=<options_possible> --strategy=<strategy> --schedule "* * * * *"
Example Scheduling Full Backup command for Openmrs Database
bahmni -i local backup --backup_type=db --options=openmrs --strategy=full --schedule "30 2 * * 0"


    # Use the hash sign to prefix a comment
    # +---------------- minute (0 - 59)
    # |  +------------- hour (0 - 23)
    # |  |  +---------- day of month (1 - 31)
    # |  |  |  +------- month (1 - 12)
    # |  |  |  |  +---- day of week (0 - 7) (Sunday=0 or 7)
    # |  |  |  |  |
    # *  *  *  *  *  command to be executed

MySQL 백업:

MySQL 데이터베이스 백업 명령에는 다음과 같은 구성 항목이 있습니다.

KeyDefault valueAvailable optionsMandatory
backup_typeallThis value should be db for database backupNo
optionsallThis Value can be either openmrs or bahmni-reports while taking mysql database backup.No
strategyfullPossible values are full, incr.No

MySQL 전체 백업

데이터베이스 이름을 지정해 특정 MySQL 데이터베이스의 전체 백업을 만들 수 있습니다.

Sample command for Full backup of MySQL database
bahmni -i <inventory_file_name> backup --backup_type=db --options=<DBName>

inventory_file_name을 알맞은 파일 이름으로, DBName을 데이터베이스 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Openmrs Database Full Backup
bahmni -i local backup --backup_type=db --options=openmrs
Bahmni Reports Database Full Backup
bahmni -i local backup --backup_type=db --options=bahmni_reports

MySQL 증분 백업:

전체 백업 외에 증분 백업도 만들 수 있습니다. 증분 백업에서는 strategy를 "incr"로 지정해야 합니다.

Sample Command for Incremental Backup
bahmni -i <inventory_file_name> backup --backup_type=db --options=<DBName>  --strategy=incr

inventory_file_name을 알맞은 파일 이름으로, DBName을 데이터베이스 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Openmrs Database Incremental Backup
bahmni -i local backup --backup_type=db --options=openmrs  --strategy=incr
Bahmni Reports Database Incremental Backup
bahmni -i local backup --backup_type=db --options=bahmni_reports  --strategy=incr

MySQL 데이터베이스 복원:

선택한 복원 지점이나 파일이 구성된 복원 경로에 있다면 데이터베이스를 전체 또는 증분 복원 지점으로 복원할 수 있습니다.

Sample Mysql restore command
bahmni -i <inventory_file_name> restore --restore_type=db --options=<DBName> --strategy=<dump/pitr> --restore_point=<Backup foldername>

inventory_file_name을 알맞은 파일 이름으로, DBName을 데이터베이스 이름(openmrs 또는 bahmni_reports)으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

MySQL 데이터베이스 복원 명령에는 다음과 같은 구성 항목이 있습니다. 아래 구성에는 기본값이 없습니다.

KeyDescriptionMandatory
restore_typeValue should be "db" (in case of database restore)Yes
optionsAvailable options for mysql database restore are "openmrs" or "bahmni_reports"Yes
strategyStrategyDescription
pitrIf the restore point value is the folder name of the backup.
dumpIf the restore point value is database entire dump gunzip file.
  • 값은 백업 파일의 폴더 이름이어야 합니다(증분 또는 전체). strategy가 dump이면 dump 파일 이름이어야 합니다.

MySQL 덤프 복원

dump gunzip 파일을 지정해 데이터베이스를 복원할 수 있습니다.

Openmrs Database Dump Restore
bahmni -i local restore --restore_type=db --options=openmrs --strategy=dump   --restore_point=openmrs_dump_20170221084218.sql.gz

MySQL 전체 복원

전체 백업 파일을 지정해 데이터베이스를 복원할 수 있습니다.

Openmrs Database FULL PITR (Point In Time Restore)
bahmni -i local restore --restore_type=db --options=openmrs --strategy=pitr   --restore_point=20170220103125_full
Bahmni Reports Database FULL PITR (Point In Time Restore)
bahmni -i local restore --restore_type=db --options=bahmni_reports --strategy=pitr   --restore_point=20170220103125_full

MySQL 증분 복원

증분 백업 파일을 지정해 데이터베이스를 복원할 수 있습니다.

Openmrs Database INCREMENTAL PITR (Point In Time Restore)
bahmni -i local restore --restore_type=db --options=openmrs --strategy=pitr   --restore_point=20170330103125_incr
Bahmni Reports Database INCREMENTAL PITR (Point In Time Restore)
bahmni -i local restore --restore_type=db --options=bahmni_reports --strategy=pitr   --restore_point=20170330103125_incr

PostgreSQL 데이터베이스 백업:

PostgreSQL 데이터베이스 백업 명령에는 다음과 같은 구성 항목이 있습니다.

KeyDefault valueAvailable optionsMandatory
backup_typeallThis value should be db for database backupNo
optionsallThis Value can be either postgres while taking pgsql database backup.No
strategyfullPossible values are full, incr.No

Postgres 전체 백업

options에 postgres 데이터베이스 이름을 지정하여 전체 백업을 만들 수 있습니다.

Sample command for Full backup of Postgres database
bahmni -i <inventory_file_name> backup --backup_type=db --options=<DBName>

inventory_file_name을 알맞은 파일 이름으로, DBName을 데이터베이스 이름(postgres)으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Postgres Databases Full Backup
bahmni -i local backup --backup_type=db --options=postgres

Postgres 증분 백업:

전체 백업 외에 증분 백업도 만들 수 있습니다. 증분 백업에서는 strategy를 "incr"로 지정해야 합니다.

Sample Command for Incremental Backup
bahmni -i <inventory_file_name> backup --backup_type=db --options=<DBName>  --strategy=incr

inventory_file_name을 알맞은 파일 이름으로, DBName을 데이터베이스 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Postgres Database Incremental Backup
bahmni -i local backup --backup_type=db --options=postgres  --strategy=incr

PostgreSQL 데이터베이스 복원:

PostgreSQL 백업 전체를 한 번에 복원할 수 있습니다. 빈 Postgres 데이터베이스를 복원할 때는 먼저 전체 백업으로 DB를 복원한 다음 원하는 증분 백업을 적용해야 합니다.

Pgsql restore
bahmni -i <inventory_file_name> restore --restore_type=db --options=postgres --strategy=<pitr/dump>     --restore_point=<DB backup folder name>

PostgreSQL 데이터베이스 복원 명령에는 다음과 같은 구성 항목이 있습니다. 아래 구성에는 기본값이 없습니다.

KeyDescriptionMandatory
restore_typeValue should be "db" (in case of database restore)Yes
optionsvalue in case of pitr startegy is "postgres".value in case of dump strategy is "clinlims" or "openerp".Yes
strategyStrategyDescription
pitrIf the restore point value is the folder name of the backup.
dumpIf the restore point value is database entire dump gunzip file.
  • 값은 백업 파일의 폴더 이름이어야 합니다(증분 또는 전체). strategy가 dump이면 dump 파일 이름이어야 합니다.

Postgres 덤프 복원

inventory_file_name을 알맞은 파일 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

OpenERP 덤프 복원

dump gunzip 파일을 지정해 데이터베이스를 복원할 수 있습니다.

Openerp Database Dump Restore
bahmni -i local restore --restore_type=db --options=openerp --strategy=dump   --restore_point=openerp_dump_20170221084218.sql.gz

OpenELIS 덤프 복원

OpenELIS (clinlims) Database Dump Restore
bahmni -i local restore --restore_type=db --options=openerp --strategy=dump   --restore_point=openerp_dump_20170221084218.sql.gz

Postgres 전체 복원

전체 백업 파일을 지정해 데이터베이스를 복원할 수 있습니다.

Postgres Database FULL PITR (Point In Time Restore)
bahmni -i local restore --restore_type=db --options=postgres --strategy=pitr  --restore_point=20170221-120904F

Postgres 증분 복원

증분 백업 파일을 지정해 데이터베이스를 복원할 수 있습니다.

Postgres Database Incremental PITR (Point In Time Restore)
bahmni -i local restore --restore_type=db --options=postgres --strategy=pitr   --restore_point= 20170221-121423F_20170222-124131I

아티팩트 백업

모든 아티팩트 또는 개별 아티팩트를 백업할 수 있습니다. 사용할 수 있는 구성은 다음과 같습니다.

KeyDescriptionMandatory
backup_typeThis Value should be "file" incase of artifact backupyes
optionsValueDescription
allbackup all artifacts
patient_imagesbackup patient images only
document_imagesbackup document images only
uploaded-filesbackup uploaded files only
uploaded_resultsbackup uploaded results only
reportsbackup reports only
pacs_imagesbackup pacs images only

아티팩트 전체 백업

local을 알맞은 inventory 파일 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Command to backup all artifacts
bahmni -i local backup --backup_type=file  --options=all

아티팩트 개별/선택 백업

inventory_file_name을 알맞은 파일 이름으로, artifact_name을 해당 값으로 바꾸십시오.

Backup specific files
bahmni -i <inventory_file_name> backup --backup_type=file  --options=<artifact_name>
Commands to Backup specific files
bahmni -i local backup --backup_type=file  --options="patient_images" //for patient images
bahmni -i local backup --backup_type=file  --options="document_images" //for document images
bahmni -i local backup --backup_type=file  --options="uploaded-files" //for uploaded files
bahmni -i local backup --backup_type=file  --options="uploaded_results" //for uploaded results
bahmni -i local backup --backup_type=file  --options="reports" //for reports
bahmni -i local backup --backup_type=file  --options="pacs_images" //for pacs images

아티팩트 복원

모든 아티팩트 또는 개별 아티팩트를 복원할 수 있습니다. 사용할 수 있는 구성은 다음과 같습니다.

KeyDescriptionMandatory
restore_typeThis Value should be "file" incase of artifact restoreyes
optionsValueDescription
allrestore all artifacts
patient_imagesrestore patient images only
document_imagesrestore document images only
uploaded-filesrestore uploaded files only
uploaded_resultsrestore uploaded results only
reportsrestore reports only
pacs_imagesrestore pacs images only

아티팩트 전체 복원

local을 알맞은 inventory 파일 이름으로 바꾸십시오. 아래 예시에서는 local이 inventory 파일 이름입니다.

Command to restore all artifacts
bahmni -i local restore --restore_type=file  --options=all

아티팩트 개별/선택 복원

inventory_file_name을 알맞은 파일 이름으로, artifact_name을 해당 값으로 바꾸십시오.

Restore specific files
bahmni -i <inventory_file_name> restore --restore_type=file  --options=<artifact_name>
Example Commands to Restore specific files
bahmni -i local restore --restore_type=file --options="patient_images" //for patient images
bahmni -i local restore --restore_type=file  --options="document_images" //for document images
bahmni -i local backup --restore_type=file  --options="uploaded-files" //for uploaded files
bahmni -i local restore --restore_type=file  --options="uploaded_results" //for uploaded results
bahmni -i local restore --restore_type=file  --options="reports" //for reports
bahmni -i local restore --restore_type=file  --options="pacs_images" //for pacs images
원문 정보

Bahmni Wiki · CC BY-SA 4.0

원문 보기 ↗