gitlab 迁移

1、gitlab  、redis  stop
    sudo -u apache -H ./lib/support/init.d/gitlab stop
2、清理新机器gitlab实验的数据:
mysql:
cd /home/git/gitlab
bundle exec rake gitlab:setup RAILS_ENV=production
其他:删除文件目录即可

3、scp redis 数据  (/var/lib/redis/dump.rdb)
4、scp repositories 数据
tar czf repositories-0.1.0.tar.gz  repositories
修改hooks/update软链接
5、scp  gitlab-satellites 数据
6、导mysql数据:
     200
     mysqldump -u gitlab -h IP -Pport-p gitlabhq_production -q > gitlab.sql
     
     scp gitlab.sql git@IP:~/

     
     //新建数据库用下面
     //mysql>CREATE DATABASE `gitlabhq_production` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */
     //mysql>use gitlabhq_production
     mysql>source /home/git/gitlab.sql
7、最新gitlab 用的数据库结构和老的不兼容,需要升级:
      bundle exec rake db:migrate RAILS_ENV=production
   bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production

8、启动gitlab server
     ./gitlab.sh start


# gitlab check
cd /data/git/gitlab/
bundle exec rake gitlab:env:info RAILS_ENV=production
bundle exec rake gitlab:check RAILS_ENV=production


cd /data/git/gitlab/
sudo -u apache -H bundle exec rake assets:precompile RAILS_ENV=production
sudo -u apache -H bundle exec rake cache:clear RAILS_ENV=production

cd /data/git/gitlab/
sudo -u apache -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u apache -H bundle exec rake gitlab:check RAILS_ENV=production

本地操作:
git remote set-url origin `git remote -v | grep origin | head -n 1 | awk '{print $2}' | sed 's/ git.staff.domob.cn/git.domob-inc.cn/' `



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值