1.在升级前必定要作好备份,记录本身当前gitlab-ce的版本号。git
查看当前gitlab版本号gitlab
yum list | grep gitlab-ce
2.备份文件url
gitlab-rake gitlab:backup:create
在目录/var/opt/gitlab/backups/下会生成一个备份文件如:1552552057_gitlab_backup.tar,其中1552552057即为这次备份都版本号。
还原备份(失败)
命令: gitlab-rake gitlab:backup:restore BACKUP=备份版本号
3.配置gitlab-yum 本地源
如清华的镜像:
https://mirrors.tuna.tsinghua...rest
[root@localhost ~]# cat << EOF > /etc/yum.repos.d/gitlab-ce.repo > [gitlab-ce] > name=gitlab-ce > baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/ > repo_gpgcheck=0 > gpgcheck=0 > enable=1 > gpgkey=https://packages.gitlab.com/gpg.key > EOF
4.yum install安装code
升级Gitlab(注意:因为升级不能跨越大版本号,所以只能升级到当前大版本号到最高版本,方可升级到下一个大版本号)
依次执行下面指令逐步升级,在每一步安装成功后若是发现界面500,不可访问,那么执行gitlab-ctl reconfigure指令刷新配置文件。(必定保证数据能够正常访问方可执行下一步升级指令)get
升级过程当中有可能会升级PostgreSQL,命令:sudo gitlab-ctl pg-upgrade
yum install gitlab-ce-10.8.7-ce.0.el7 yum install gitlab-ce-11.0.0-ce.0.el7 yum install gitlab-ce-11.11.5-ce.0.el7 yum install gitlab-ce-12.0.0-ce.0.el7 ... yum update
查看当前版本号it
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION