gitlab版本升级,随笔记录。

3.1#cat /var/opt/gitlab/gitlab-rails/VERSION
10.8.3

3.1#yum list  | grep gitlab-ce
gitlab-ce.x86_64                        10.8.3-ce.0.el7                installed

gitlab从10.8版本升级到12.1版本,不能跨版本升级。官网下载对应版本的rpm包,rpm -Uvh 安装。

注意:一定要先备份数据,再升级操作。


gitlab数据备份
3.1#gitlab-rake gitlab:backup:create
3.1#pwd
/var/opt/gitlab/backups
3.1#ls
1565356481_2019_08_09_10.8.3_gitlab_backup.tar

gitlab从11.11版本升级到12.1时会有一个警告信息,说是备份的数据没有包含gitlab.rb文件,需要手工备份,恢复数据时候会用。
3.1#pwd
/etc/gitlab
3.1#ls
gitlab.rb  gitlab.rb~  gitlab-secrets.json  trusted-certs
3.1#cp gitlab.rb /var/opt/gitlab/backups/
3.1#cp /etc/gitlab/gitlab-secrets.json /var/opt/gitlab/backups/

还原备份
3.1#gitlab-rake gitlab:backup:restore BACKUP=备份版本号

 


停掉相关服务
gitlab-ctl stop  sidekiq
gitlab-ctl stop  unicorn
gitlab-ctl stop  nginx

 

升级安装gitlab

rpm -Uvh .....

 

升级完成后需要重新加载配置

gitlab-ctl reconfigure


3.1#gitlab-ctl  restart



posted @ 2019-08-15 16:06  song宁静致远  阅读(435)  评论(0编辑  收藏  举报