Linux下Gitlab從8升級到11
備份&升級
1. 在升級前一定要做好備份,記錄自己當前gitlab-ca到版本號。
檢視當前gitlab版本號
yum list | grep gitlab-ce
gitlab-ce.x86_64 8.9.1-ce.1.el6 @gitlab-ce
備份檔案
gitlab-rake gitlab:backup:create
在目錄/var/opt/gitlab/backups/下會生成一個備份檔案如:1537856454_gitlab_backup.tar,其中1537856454即為此次備份都版本號。
還原備份
gitlab-rake gitlab:backup:restore BACKUP=備份版本號
2.升級Gitlab(注意:由於升級不能跨越大版本號,因此只能升級到當前大版本號到最高版本,方可升級到下一個大版本號)
- 依次執行下面指令逐步升級,在每一步安裝成功後如果發現介面500,不可訪問,那麼執行```gitlab-ctl reconfigure```指令重新整理配置檔案。(一定保證資料可以正常訪問方可執行下一步升級指令)
yum install gitlab-ce-8.17.8-ce.0.el6 yum install gitlab-ce-9.5.9-ce.0.el6 yum install gitlab-ce-10.8.0-ce.0.el6 yum install gitlab-ce-11.3.0-ce.0.el6
檢視當情版本號
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
FAQ
- [ERROR] OpenSSL::Cipher::CipherError (bad decrypt):
gitlab-rails runner "Project.where.not(import_url: nil).each { |p| p.import_data.destroy if p.import_data }"
- [ERROR] Error executing action `run` on resource 'ruby_block[directory resource: /var/opt/gitlab/git-data/repositories]'
chmod -R 2770 /var/opt/gitlab/git-data