0

Our organization has a self hosted GitLab server. We want to migrate to GitHub.

Github.com's import (the one in the web app) won't work because our GitLab server is not reachable from the Internet.

After looking at some stack overflow questions it says to export the project from GitLab, but on our GitLab server there is no option to export. Is there any standard process or any way to migrate all our old repositories from GitLab self Hosted to Git-Hub? It must include all tags, commit messages and branches as they exit in Git-Lab.

Any suggessions will really appreciated, Thank you.

Inigo
  • 12,186
  • 5
  • 41
  • 70
Ajit Hogade
  • 1,072
  • 9
  • 29
  • I'm curious how you ended up resolving this. You never accepted my answer so I assume it didn't help? – Inigo Aug 05 '22 at 10:36

1 Answers1

1

If you only need to migrate "all tags, commit messages and branches", then no "migration" is really necessary, as all three of those are pure git. All you need to do is use standard git push commands to push each repo to GitHub.

(If you need to migrate Issues and other things that are not part of the git repo, then you will need to find a migration tool)

You should do this with clean clones (i.e. not the dev/test/build clones you are using now) so that GitHub gets a copy of the repo as it is on the server. If you do it with your existing working clones, you'll end up pushing local branches and tags that don't exist on your authoritative GitLab repos. You could probably can do this directly on the GitLab server and thus skip making clones -- But unless you know what you are doing it would be safer not to mess with the repos on the server directly.

I don't have time right now to write out the steps, but I shouldn't have to. Anyone responsible for this migration should be familiar enough with git to figure them out. The command is probably just git push --all --tags but you should confirm.

Inigo
  • 12,186
  • 5
  • 41
  • 70