My company wanted me to combine the projects from the old GitLab servers to the new one. There are many ways on the internet, I tried several ways, finally I found this method worked well.
Download projects from the old server, for example:
# git clone –mirror git@gitlab1.example.com:group1/project1.git
Create new projects on the new GitLab server through the website
Modify the config file, change the url to the new one
# cd project1.git/
# vi config
[core]
repositoryformatversion = 0
filemode = true
bare = true
[remote “origin”]
url = git@gitlab2.example.com:group1/project1.git
fetch = +refs/*:refs/*
mirror = true
Upload the project to the new GitLab server
# git push origin –mirror
Leave a comment