티스토리 뷰

백업진행

https://jmholly.tistory.com/entry/%EA%B9%83%EB%9E%A9-gitlab-backup%ED%95%98%EA%B8%B0-%EA%B7%B8%EB%A6%AC%EA%B3%A0-cron

 

[깃랩] gitlab backup하기 그리고 cron

backup된 압축파일이 위치한 경로 cd /var/opt/gitlab/backups backup 만들기 # gitlab 버전 12.2 이상 gitlab-backup create cron 으로 깃랩 백업하기 # 5일마다 2시에 gitlab backup 0 2 */5 * * root gitlab-ba..

jmholly.tistory.com

 

 

백업파일 옮기기

마이그레이션 대상 서버에

  • 백업파일
  • /etc/gitlab/gitlab-secrets.json  (선택)
  • /etc/gitlab/gitlab.rb  (선택) -> CI/CD도 옮기려면 필요

을 옮긴다

물론 디렉토리도 같아야 한다.

 

복원전 프로세스 종료

gitlab-ctl stop unicorn
gitlab-ctl stop puma
gitlab-ctl stop sidekiq

gitlab-ctl status

 

다음의 프로세스들이 잘 종료되었는지 확인한다.

 

복원명령 수행

_gitlab_backup.tar 앞까지 지정한다.

gitlab-backup restore BACKUP=백업대상지정
 
#예) 만약 164_2022_03_17_14.7.1_gitlab_backup.tar 인경우
#gitlab-backup restore BACKUP=164_2022_03_17_14.7.1

 

Unpacking backup ... tar: 1111111111111111_gitlab_backup.tar: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
unpacking backup failed
다음과 같은 에러가 나는 경우 sudo권한을 준다

 

GitLab version mismatch:
  Your current GitLab version (14.8.3) differs from the GitLab version in the backup!
  Please switch to the following version and try again:
  version: 14.7.1

다음과 같은 에러가 나는 경우 downgrade나 upgrade를 한다.

sudo gitlab-ctl stop puma

# Stop sidekiq
sudo gitlab-ctl stop sidekiq

# If on Ubuntu: remove the current package
sudo dpkg -r gitlab-ee

# If on Centos: remove the current package
sudo yum remove gitlab-ee

# (Replace with gitlab-ce if you have GitLab FOSS installed)



#Identify the GitLab version you want to downgrade to:
# Ubuntu
sudo apt-cache madison gitlab-ee

# CentOS:
sudo yum --showduplicates list gitlab-ee

# (Replace with gitlab-ce if you have GitLab FOSS installed)

# Ubuntu
sudo apt install gitlab-ee=13.0.5-ee.0

# CentOS:
sudo yum install gitlab-ee-13.0.5-ee.0.el8


#필요에 따라서
sudo gitlab-ctl restart redis

sudo gitlab-ctl reconfigure

 

 

복원 후 리빌드

gitlab-ctl reconfigure
gitlab-ctl restart
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함