GitLab整体迁移

迁移说明

  • 旧gitlab环境地址:192.168.15.240
  • 新gitlab环境地址:192.168.15.241
  • 新旧环境的gitlab版本必须一致
  • Jenkins备份路径:/var/opt/gitlab/backups/

1、备份旧gitlab(192.168.15.240)

[root@localhost ~]# gitlab-rake gitlab:backup:create

2、复制旧gitlab备份文件到新gitlab(192.168.15.240)

[root@localhost ~]# scp /var/opt/gitlab/backups/1552914145_2019_03_18_11.4.5_gitlab_backup.tar root@192.168.15.240:/var/opt/gitlab/backups/

3、还原新gitlab(192.168.15.241)

[root@localhost ~]# gitlab-ctl stop unicorn
[root@localhost ~]# gitlab-ctl stop sidekiq
[root@localhost ~]# chmod -R 777 /var/opt/gitlab/backups
[root@localhost ~]# chmod -R 777 /opt/gitlab/embedded
[root@localhost ~]# cd /var/opt/gitlab/backups/
[root@localhost ~]# gitlab-rake gitlab:backup:restore BACKUP=1552914145_2019_03_18_11.4.5

如有提示,可收到处理一下文件:
restore handy:

[root@localhost ~]# cd /var/opt/gitlab/backups
[root@localhost backups]# tar xf uploads.tar.gz -C /var/opt/gitlab/gitlab-rails/uploads
[root@localhost backups]# tar xf builds.tar.gz -C /var/opt/gitlab/gitlab-ci/builds
[root@localhost backups]# tar xf pages.tar.gz -C /var/opt/gitlab/gitlab-rails/shared/pages
[root@localhost backups]# tar xf artifacts.tar.gz -C /var/opt/gitlab/gitlab-rails/shared/artifacts

以下命令对还原数据可靠性检测

[root@localhost backups]# gitlab-ctl reconfigure
[root@localhost backups]# gitlab-ctl restart
[root@localhost backups]# gitlab-rake gitlab:check SANITIZE=true

4、附录-注意事项

以下文件可能需要手动复制:
/var/opt/gitlab/.ssh/authorized_keys
/etc/gitlab/gitlab-secrets.json
/etc/gitlab/gitlab.rb

/var/opt/gitlab/gitlab-rails/etc/secrets.yml
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/premailer-rails-1.9.7/example/config/secrets.yml
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/graphiql-rails-1.4.10/test/dummy/config/secrets.yml
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/generators/rails/app/templates/config/secrets.
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/graphql-1.8.1/spec/dummy/config/secrets.yml
/opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/hashie-forbidden_attributes-0.1.1/test/dummy/config/secrets.yml
/opt/gitlab/embedded/service/gitlab-rails/config/secrets.yml

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值