1. 获取现在gitlab版本

[root@MiWiFi-R1350-srv ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 
8.8.5

2. 升级计划

​gitlab 不支持大版本之间直接升级,需要升级到当前版本的最新版本,然后再升级下一个版本。​

升级版本次序为:

​8.8.5 -> 8.17.7 -> 9.5.10 -> 10.8.7 -> 11.3.4->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.6.2​

3.升级过程

  1. 备份文件
gitlab-rake gitlab:backup:create

会在​​/var/opt/gitlab/backups​​​下生成一个以时间戳命名的​​tar​​文件

  1. 下载升级包
    下载地址:​​​https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=&filter=rpms&filter=rpms&dist=el%2F7​​​ 跨版本升级说明:​​https://docs.gitlab.com/ee/update/​
  • 预先下载如下升级包
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-8.17.7-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-9.5.0-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-10.8.7-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.11.8-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-12.0.12-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-12.1.17-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-12.10.14-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.0.14-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.0.14-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.8.8-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-14.0.12-ce.0.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-14.6.2-ce.0.el7.x86_64.rpm/download.rpm

停机处理:

gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx

以上每个版本升级完毕后都需要登录验证新版本是否正常运行,如正常运行则继续升级。