1、gitlab 、redis stop
sudo -u apache -H ./lib/support/init.d/gitlab stop
# gitlab check
cd /data/git/gitlab/
cd /data/git/gitlab/
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
cd /data/git/gitlab/
bundle exec rake gitlab:env:info RAILS_ENV=production
bundle exec rake gitlab:check RAILS_ENV=production
sudo -u apache -H bundle exec rake assets:precompile RAILS_ENV=production
sudo -u apache -H bundle exec rake cache:clear RAILS_ENV=production
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/'
`