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
'리눅스' 카테고리의 다른 글
파일 디스크립터(File Descriptor) 및 설정(ulimit) (0) | 2021.06.08 |
---|---|
GitLab Omnibus를 Docker 컨테이너로 올리는 방법 (0) | 2021.06.08 |
[Docker] OpenLDAP-phpLDAPadmin 컨테이너로 올리기 (0) | 2021.06.07 |
리눅스 curl 명령어 (0) | 2021.06.04 |
sipcalc 명령어 (0) | 2021.06.03 |