1.升级路线
gitlab升级不能一步到位,要一个个版本渐进式升级,根据官方文档选择自己的升级路线。
官方文档:https://docs.gitlab.com/ee/update/index.html#upgrade-paths
根据文档,升级路线为:11.4.3 -> 11.11.8 -> 12.0.12 -> 12.1.17 -> 12.10.14 -> 13.0.14 -> 13.1.11 -> 13.8.8 -> 13.12.15 -> 14.0.12 -> 14.3.6 -> 14.6.2 -> 14.9.5 -> 14.10.5
2.准备
升级路线上所有安装包,容器部署的下载官方镜像文件gitlab/gitlab-ce:[version]-ce.0
https://packages.gitlab.com/gitlab/gitlab-ce
升级前务必执行备份操作
GitLab 12.2以后:
gitlab-backup create
GitLab 12.1及以前:
gitlab-rake gitlab:backup:create
如果升级过程中出现问题,退回初始版本,执行恢复操作:
关闭数据库连接服务
gitlab-ctl stop unicorn && gitlab-ctl stop sidekiq
⚠️恢复操作会清空当前gitlab数据
cd /opt/gitlab_backup
gitlab-rake gitlab:backup:restore BACKUP=1553965778_2019_03_31_10.7.3 ---#文件名会自动补全-(注意)
3.升级
11.4.3 -> 11.11.8
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
根据:https://docs.gitlab.com/omnibus/update/gitlab_11_changes.html
11.11.8大版本需要修改 gitlab.rb的2个地方:
1、增加 nginx[‘ssl_protocols’] = “TLSv1.2”
2、旧格式去掉 git_data_dir “/data/git-data” 增加新格式 git_data_dirs({ “default” => { “path” => “/data/git-data” } })
然后执行:
gitlab-ctl r