首页 > 其他 > 详细

Gitlab迁移

时间:2015-02-04 16:53:26      阅读:363      评论:0      收藏:0      [点我收藏+]

在B台服务器部署gitlab环境(版本一致)


在A服务器上打包以下数据并传至B服务器

cd /home/git

tar zcf repositories.tar.gz repositories

scp repositories.tar.gz git@183.131.1.1:/tmp/

mysqldump -h 127.0.0.1 -u gitlab -p gitlabhq_production> gitlabhq_production0204.sql

scp gitlabhq_production0204.sql git@183.131.1.1:/tmp/


B服务器上导入数据并重启gitlab服务:

cd gitlab

1. 将传入过来的repositories库下所有内容除了(root目录)拷贝到本机repositories库目录下

检查或修改文件权限:

sudo chmod -R ug+rwX,o-rwx /home/git/repositories/

chmod -R ug-s repositories

find /home/git/repositories/ -type d -print0 | sudo xargs -0 chmod g+s

2. 导入keys

替换传过来的authorized_keys文件,注意文件权限600

3. 导入数据库

mysql -h 127.0.0.1 -u gitlab -p gitlabhq_production </tmp/gitlabhq_production0204.sql

4. 生成并检测库

sudo -u git -H bundle exec rake gitlab:import:repos RAILS_ENV=production

sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

5. 重启gitlab服务.


本文出自 “E人空间” 博客,请务必保留此出处http://iceeggplant.blog.51cto.com/1446843/1611475

Gitlab迁移

原文:http://iceeggplant.blog.51cto.com/1446843/1611475

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!