Gitlab 升级、备份与恢复

1.Gitlab的 rpm 包下载(下载到/usr/local/src)

wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.5.2-ce.0.el6.x86_64.rpm    

2.Gitlab数据备份

gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
gitlab-rake gitlab:backup:create
ls /var/opt/gitlab/backup #备份位置

3.Gitlab升级过程

注意:gitlab 升级前必须进行数据备份操作
rpm -Uvh gitlab-ce-10.5.2-ce.0.el6.x86_64.rpm
gitlab-ctl reconfigure
gitlab-ctl restart [nginx]

4.Gitlab 版本信息

# head -1 /opt/gitlab/version-manifest.txt

5.Gitlab 恢复

required: linux系统版本一致,gitlab 版本一致
(1)  Prepare:
    yum install -y curl policycoreutils-python openssh-server cronie
    yum install postfix && service postfix start && chkconfig postfix on
(2) Install:
    rpm -ivh gitlab-ce-10.5.2-ce.0.el6.x86_64.rpm
(3) Postpare:
gitlab-ctl reconfigure # 重置或生成新的数据目录/var/opt/gitlab
gitlab-ctl  restart 
(4) 数据还原
Next, restore /etc/gitlab/gitlab-secrets.json  and  /etc/gitlab/gitlab.rb if necessary as mentioned above. 
Next, restore /var/opt/gitlab/.ssh to new machine’s direct
将备份的数据copy至新机器
scp 1493107454_2017_04_25_9.1.0_gitlab_backup.tar 192.168.99.116:`pwd`
chown git.git /var/opt/gitlab/backups/*.tar
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore  BACKUP=1493107454_2017_04_25_9.1.0
gitlab-ctl restart
gitlab-rake gitlab:check SANITIZE=true

6.Gitlab 邮件发送访问路径及部分logo加载问题

scp /etc/gitlab/gitlab.rb   192.168.99.116: /etc/gitlab/gitlab.rb
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
gitlab-ctl reconfigure
gitlab-ctl restart


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值