本篇文章主要介绍了"gitlab完整迁移",主要涉及到方面的内容,对于企业开发感兴趣的同学可以参考一下:
环境介绍:CentOS 6.7gitlab:6.3.1需求:gitlab从A服务器迁移至B服务器第一、在B服务器上部署gitlab环境参考《GitLab完整搭建...
环境介绍:
CentOS 6.7
gitlab:6.3.1
需求:gitlab从A服务器迁移至B服务器
第一、在B服务器上部署gitlab环境
参考《GitLab完整搭建(版本6.3.1)》
第二、备份A服务器上的数据
1).打包仓库文件
#su- git
$cd/home/git/
$tarzcvf repositories.tar.gz ./repositories
2).备份sql文件
$mysqldump-uroot -pxxxx gitlabhq_production > /tmp/gitlabhq_production.sql
3).备份keys
$cp/home/git/.ssh/authorized_keys /tmp/authorized_keys
4).复制1-3步的文件到B服务器
$scprepositories.tar.gz gitlabhq_production.sql authorized_keys root@B:/tmp/
第三、在B服务器上导入数据
1).导入仓库,检查权限
$cd/home/git
$tarzxvf repositories.tar.gz
如果权限有异常,直接重新赋权
$chown-R git.git /home/git/repositories/
2).导入数据库
$mysql-uroot -pxxx gitlabhq_production < gitlabhq_production.sql
3).导入keys
$catauthorized_keys >> /home/git/.ssh/authorized_keys
4.将文件导入ruby
$cd/home/git/gitlab/
$bundleexec rake gitlab:import:repos RAILS_ENV=production
$bundleexec rake gitlab:satellites:create RAILS_ENV=production
5).检测
$bundleexec rake gitlab:check RAILS_ENV=production
如果检测没有异常,可以重启gitlab服务
#/etc/init.d/gitlab restart
第四、验证git pull/push与异常解决
1). git pull

2). git push