确定升级路线 https://docs.gitlab.com/ee/policy/maintenance.html#upgrading-major-versions
8.11.Z-> 8.12.0-> 8.17.7-> 9.5.10-> 10.8.7-> 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.Z->最新14.1.Z->最新14.Y.Z
12.2.5----12.10.14-> 13.0.14-> 13.1.11-> 13.8.8-> 13.12.15->最新14.0.12->最新14.1.8->最新14.5.2
4.停部分服务
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
5. 备份 gitlab-rake gitlab:backup:create 默认地址在/var/opt/gitlab/backups/
GitLab 默认的备份目录是:/var/opt/gitlab/backups/,建议选择一个空间充足的目录进行配置。我们可以通过修改/etc/gitlab/gitlab.rb文件中的如下内容来调整备份路径:
(暂不用考虑)
# 备份目录
gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
设置权限
# mkdir -p /data/gitlab/backups
# chown -R git.git /data/gitlab/backups
# chmod -R 777 /data/gitlab/backups
6.备份配置文件
cp /etc/gitlab/gitlab.rb /var/opt/gitlab/backups/12.2.5
cp /etc/gitlab/gitlab-secrets.json /var/opt/gitlab/backups/12.2.5
cp /var/opt/gitlab/nginx/conf nginx /var/opt/gitlab/backups/12.2.5 nginx配置文件
cp /etc/postfix/main.cfpostfix /var/opt/gitlab/backups/12.2.5 邮件配置备份
7. 升级后启动之前的三个服务,等几分钟后查看页面及数据是否正常
升级 rpm -Uvh gitlab-ce-12.10.14-ce.0.el7.x86_64.rpm 升级过程中会自动备份部分数据库内容
检查-配置文件
cd /etc/gitab
gitlab.rb (url,
gitlab-ctl start puma
gitlab-ctl start sidekiq
gitlab-ctl start nginx
检查开启服务状态 gitlab-ctl status
查看服务器版本 cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
查看页面
9. 重复停服务,备份,升级,起服务,直到目标版本
10如升级失败, 恢复命令完成后,可以check检查一下恢复情况
先赋权 备份文件
停服务
恢复 gitlab-rake gitlab:backup:restore BACKUP=备份文件编号
检查恢复情况 gitlab-rake gitlab:check SANITIZE=true
检查配置文件
重启