Move repo from plain git to GitLab server

gitgitlabrepository

I have two servers, an older server running plain git with three repositories under /opt/. These projects are now to be moved over to a new server where I choose to run gitlab for the sake of the GUI and to be able to invite friends to learn programming and have an easier place to view and manage projects.

However, when moving over I want to keep the revisions of my old code bases. Somehow I thought just doing scp -r old-server.net:/opt/project.git /gitlab/ would suffice but this fails.

I navigated to gitlab and created a new repo just to get the folder structure which created a wiki and a code-folder called /gitlab/project.git with the same folder structure as it is on the old server (without the code obviously) and the project loads fine in gitlab, but then i did rm -rf project.git and did the scp ... and now i get a 500 We're sorry, but something went wrong..

My guess is that the revisions and perhaps an URL in the server-folder is wrong, but I can't find anything by going through the files manually or via the docs on gitlab.

Anyone done something similar?

Thank you in advance!

Best Answer

Add the new gitlab remote to your existing repository and push:

git remote add gitlab url-to-gitlab-repo

git push gitlab master