본문 바로가기
Infra

Gitlab backup / restore 방법

by west_east_circle 2025. 5. 20.
반응형

사내에서 쓰는 구식 12.4 버전의 gitlab백업 및 복구 테스트 작업을 진행 하였다. 

이거 내가 세팅 안해서 첨해봤는데 별거 없엇..(난 복구를 스냅샷으로 해서리 ...)

 

gitlab-backup create    (한참걸릴수도..)

위 명령어 치면 /var/opt/gitlab/backups/어쩌구저쩌구 .tar로 저장 된다 

위 파일과 /etc/gitlab/gitlab0secrets.json , /etc/gitlab/gitlab.rb 이 두 파일을 복구할 서버에

/etc/gitlab/ 폴더로 카피한다

gitlab 기본 설치된 복구할 서버에서 1차적으로

gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq 

서비스 죽이고 시작

chown git:git 백업파일 소유권 변경

chmod 600 /var/opt/gitlab/backups/어쩌구저쩌구.tar

gitlab-backup restore BACKUP= 어쩌구저쩌구 (.tar빼고)

gitlab-ctl status (상태확인)

gitlab-ctl reconfigure

반응형