gitlab从12.3.9升级为14.7.3

官方的升级指引:

https://docs.gitlab.com/ee/update/index.html#upgrade-paths

升级路径:

12.3.9 -> 12.10.14 -> 13.0.14 -> 13.12.15 -> 14.0.11 -> 14.1.8 -> 14.4.5 -> 14.7.3

如果使用YUM方式,可以设置使用官方YUM源,非必要步骤
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash

下载安装包,下载到/opt/gitlab_soft
cd /opt/gitlab_soft
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.10.14-ce.0.el7.x86_64.rpm
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.0.14-ce.0.el7.x86_64.rpm
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-14.0.12-ce.0.el7.x86_64.rpm
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-14.1.8-ce.0.el7.x86_64.rpm
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-14.4.5-ce.0.el7.x86_64.rpm
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-14.7.3-ce.0.el7.x86_64.rpm

1、关闭服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx

2、备份gitlab:
创建备份文件夹
mkdir -p /opt/backup/local220217_1/opt/
备份运行文件
cp -r /opt/gitlab /opt/backup/local220217_1/opt/
cp -r /etc/gitlab /opt/backup/local220217_1/etc/
备份数据库,默认会在/var/opt/gitlab/backups文件夹下生成备份文
gitlab-rake gitlab:backup:create

3、设置跳过自动备份
touch /etc/gitlab/skip-auto-backup

4、修改配置文件/etc/gitlab/gitlab.rb
unicorn['worker_memory_limit_min'] = "1024 * 1 << 20"
unicorn['worker_memory_limit_max'] = "1280 * 1 << 20"

5、切换到有安装包的目录
cd /opt/gitlab_soft

6、升级为12.10.14
rpm -Uvh gitlab-ce-12.10.14-ce.0.el7.x86_64.rpm
gitlab-ctl reconfigure 【如果提示redis报错,执行6.1步骤】
sudo gitlab-ctl pg-upgrade
gitlab-ctl restart

6.1、【非必要步骤】如果redis报错,则暂停redis服务,删除临时文件
暂停redis服务
gitlab-ctl stop nginx
删除redis数据文件
rm -rf /var/opt/gitlab/redis/dump.rdb
启动redis服务
gitlab-ctl start redis

7、升级为13.0.14
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
修改配置文件/etc/gitlab/gitlab.rb将设置unicorn为false
注意把unicorn其他相关的配置也要使用##注释去掉,另外,puma默认开启,无需配置
rpm -Uvh gitlab-ce-13.0.14-ce.0.el7.x86_64.rpm
gitlab-ctl restart 【如果提示postgresql数据库报错,执行7.1步骤】

7.1、如果提示postgresql数据库报错,可能数据库目录权限不足
##gitlab-ctl stop
##chmod 755 /var/opt/gitlab/postgresql
##systemctl restart gitlab-runsvdir
##gitlab-ctl reconfigure
##gitlab-ctl restart


8、升级为13.12.15
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
rpm -Uvh gitlab-ce-13.12.15-ce.0.el7.x86_64.rpm
gitlab-ctl restart
##gitlab-ctl pg-upgrade
##gitlab-ctl reconfigure
##gitlab-ctl restart

9、升级为14.0.12
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
rpm -Uvh gitlab-ce-14.0.12-ce.0.el7.x86_64.rpm
gitlab-ctl restart postgresql
gitlab-ctl reconfigure
gitlab-ctl restart

10、升级为14.1.8
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
rpm -Uvh gitlab-ce-14.1.8-ce.0.el7.x86_64.rpm
gitlab-ctl restart

11、升级为14.4.5
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
rpm -Uvh gitlab-ce-14.4.5-ce.0.el7.x86_64.rpm
gitlab-ctl restart

12、升级为14.7.3
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
rpm -Uvh gitlab-ce-14.7.3-ce.0.el7.x86_64.rpm
gitlab-ctl restart


13、删除跳过自动备份的设置
rm /etc/gitlab/skip-auto-backup

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值