Skip to content

Instantly share code, notes, and snippets.

@syakuis
Last active June 23, 2017 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syakuis/5dde519d74c01decdf76a1267f6c3b10 to your computer and use it in GitHub Desktop.
Save syakuis/5dde519d74c01decdf76a1267f6c3b10 to your computer and use it in GitHub Desktop.
GitLab Upgrade 8.11.x to 9.3.0 with Centos : Gitlab 업그레이드

관련링크

백업: https://docs.gitlab.com/ce/raketasks/backup_restore.html#restore
업그래이드: http://docs.gitlab.com/omnibus/update/README.html

백업

$ sudo gitlab-rake gitlab:backup:create

백업 파일은 /etc/gitlab/gitlab.rb 열어보면 gitlab_rails['backup_path'] = "/var/opt/gitlab/backups" 설정이 있다 주석처리되어 있다. 기본설정 값이다.

백업이 완료되면 etc/gitlab 폴더도 백업해둔다.

업그래이드

yum 으로 다시 gitlab 를 설치하면 된다.

sudo gitlab-ctl stop

sudo yum install gitlab-ce

혹시 오류가 발생하면 sudo tuch ... 를 실행하라고 한다. 실행후 다시 설치를 시도 한다.

설치가 완료되면 업그레이드 작업을 시작한다.

 sudo gitlab-ctl start
 
 sudo gitlab-ctl reconfigure

복원

  • 백업한 곳의 gitlab 버전과 복원하는 곳의 gitlab 버전은 동일해야 한다.
$ sudo gitlab-ctl reconfigure 혹은 sudo gitlab-ctl start
 
// 백업 파일을 gitlab 백업폴더에 저장한다. (백업폴더는 gitlab 설정파일에서 확인할 수 있다.)
$ sudo cp 1493107454_2017_04_25_9.1.0_gitlab_backup.tar /var/opt/gitlab/backups/

// gitlab 일부 서비스를 중지한다.
$ sudo gitlab-ctl stop unicorn
$ sudo gitlab-ctl stop sidekiq
# Verify
$ sudo gitlab-ctl status

// 백업파일명에서 _gitlab_backup.tar 제외하고 입력한다.
$ sudo gitlab-rake gitlab:backup:restore BACKUP=1493107454_2017_04_25_9.1.0

// 구동한다.
$ sudo gitlab-ctl start
$ sudo gitlab-rake gitlab:check SANITIZE=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment