Migration from on-prem Gitlab servers
The following instructions were developed for migrating repositories with their issues, merge requests, milestones and notes (i.e. issue and merge request comments) from self managed on premise gitlab server for academic use to github enterprise cloud, njit-academics organization, on Mac OSX 15.5. It has also been tested on a Ubuntu 24.04 LTS virtual image. It should work for migration from other gitlab servers to other github organizations on other OS's.
Requirements:¶
-
Python 3, python-gitlab and python-csv
-
JSON processor,
jq -
Optional: Consider setting up Connecting to Github with SSH. If you haven't or prefer not to, see note in migration step below.
Migration steps¶
-
Download the python and bash script.
These scripts were developed on Microsoft Co-pilot based on input specific to repositories on the academic gitlab server and njit-academics organization.
-
Extract all gitlab repo data that you have access to
- By default, this extracts data from http://git-acad.njit.edu. If you want to extract data from another site, say https://gitlab.com, then add
--url https://gitlab.com
- By default, this extracts data from http://git-acad.njit.edu. If you want to extract data from another site, say https://gitlab.com, then add
-
Import repository to your github team
- NOTE: If you do not plan on using ssh keys, comment out line 39 and uncomment line 40. You will be prompted for your github username and password. Enter your Github Personal Access Token from step 1 above for password.
- To find "your team name", you can run the command and use the path output in the previous command.
Known Issues¶
- If your repo on gitlab uses LFS, the
git push --mirrorcommand in theimport_to_github.shscript will fail. You might need to clone the repo and track large files with lfs before pushing to github. - Issues, merge requests, milestones etc will be under your gitlab account i.e. njit ucid not your github handle.