본문 바로가기

리눅스

[GitLab] Omnibus GitLab 백업 및 복원

반응형

GitLab 컨테이너 backup/restore(백업 및 복원)

설정 확인

docker exec -it gitlab cat /etc/gitlab/gitlab.rb

Gitlab Backup

GitLab 12.2 이상 : docker exec -t <container name> gitlab-backup create
GitLab 12.2 이하 :docker exec -t <container name> gitlab-rake gitlab:backup:create

$ docker exec -t gitlab gitlab-backup create
--output--
1623113641_2021_06_08_13.12.2_gitlab_backup.tar


$ docker exec -t gitlab gitlab-backup create BACKUP=dump GZIP_RSYNCABLE=yes
--output--
dump_gitlab_backup.tar

Gitlab Restore

# Stop the processes that are connected to the database
docker exec -it <name of container> gitlab-ctl stop puma
docker exec -it <name of container> gitlab-ctl stop sidekiq

# Verify that the processes are all down before continuing
docker exec -it <name of container> gitlab-ctl status

# Run the restore
docker exec -it <name of container> gitlab-backup restore BACKUP=11493107454_2018_04_25_10.6.4-ce

# Restart the GitLab container
docker restart <name of container>

# Check GitLab
docker exec -it <name of container> gitlab-rake gitlab:check SANITIZE=true

###puma, sidekiq 서비스 멈춤
$ docker exec -it gitlab gitlab-ctl stop puma
$ docker exec -it gitlab gitlab-ctl stop sidekiq


###gitlab-ctl 상태 확인
$ docker exec -it gitlab gitlab-ctl status


###1623113641_2021_06_08_13.12.2 파일로 복원
$ docker exec -it gitlab gitlab-backup restore BACKUP=1623113641_2021_06_08_13.12.2


###gitlab 컨테이너 재기동
docker restart gitlab


#상태 체크
$ docker exec -it gitlab gitlab-rake gitlab:check SANITIZE=true

** 배업 파일명 : 11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar 파일명

리스토어 시 11493107454_2018_04_25_10.6.4까지만 기재하면 됩니다.

 

https://docs.gitlab.com/ee/raketasks/backup_restore.html#restore-gitlab

 

728x90
반응형