Environment Introduction:
CentOS 6.7
Gitlab : 6.3.1
Requirement:Gitlab migrating from a server to B server
First, deploy the Gitlab environment on the B server
Reference to "Gitlab complete construction (version 6.3.1)"
Second, backing up data on a server
1). Packaging Warehouse Files
#su-git$cd/home/git/$tarzcvf repositories.tar.gz./repositories
2). backing up SQL files
$mysqldump-uroot-pxxxx gitlabhq_production >/tmp/gitlabhq_production.sql
3). Backup Keys
$CP/home/git/.ssh/authorized_keys/tmp/authorized_keys
4). Copy the 1-3-step file to Server B
$scprepositories. tar.gz gitlabhq_production.sql Authorized_keys [email protected]:/tmp/
Third, import data on the B server
s) . import warehouses, check permissions
$CD/HOME/GIT$TARZXVF repositories.tar.gz
Direct re-empowerment if permissions are abnormal
$chown-R git.git/home/git/repositories/
2). Import Database
$mysql-uroot-pxxx Gitlabhq_production < Gitlabhq_production.sql
3). Import Keys
$catauthorized _keys >>/home/git/.ssh/authorized_keys
4. Import a file into Ruby
$CD/home/git/gitlab/$bundleexec rake gitlab:import:repos rails_env=production$bundleexec rake gitlab:satellites: Create Rails_env=production
5). Detection
$bundleexec Rake Gitlab:check rails_env=production
If the detection is not abnormal, you can restart the Gitlab service
#/etc/init.d/gitlab restart
Iv. Verifying git Pull/push and exception resolution
1). git Pull
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7D/F7/wKiom1bzrN_iT_2NAAB__9Q2EiY397.png "title=" 1.png " alt= "Wkiom1bzrn_it_2naab__9q2eiy397.png"/>
2). git push
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7D/F7/wKiom1bzrOfRZsVoAACL4i8c71c039.png "title=" 2.png " Style= "Float:none;" alt= "Wkiom1bzrofrzsvoaacl4i8c71c039.png"/>
If error:
Git.exe push--progress "origin" Master:master
Counting Objects:3, done.
Delta compression using up to 4 threads.
Compressing objects:100% (2/2), done.
Writing objects:100% (3/3), Bytes | 0BYTES/S, done.
Total 3 (delta 0), reused 0 (Delta 0)
Remote:GitLab:An unexpected erroroccurred (Redis-cli returned 1).
Remote:error:hook declined to Updaterefs/heads/master
To Http://192.168.4.251/caoyang/test1121.git
! [Remote rejected] master-and master (Hook declined)
Error:failed to push some refs to ' http://192.168.4.251/caoyang/test1121.git '
Shielded/home/git/gitlab-shell/config.yml 28 Line Redis Configuration
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7D/F3/wKioL1bzrYrTyBIsAAA77y-Nj4g360.png "title=" 3.png " alt= "Wkiol1bzryrtybisaaa77y-nj4g360.png"/>
This article is from the "Little Mo Growth Road" blog, please be sure to keep this source http://309173854.blog.51cto.com/7370240/1754872
Gitlab Full Migration