How to migrate from gitmaster to gitlab

This document explains how to migrate away from gitmaster.atlas.aei.uni-hannover.de to the new gitlab.aei.uni-hannover.de:

TL;DR

- Gitmaster (powered by the Gitorious software suite) is being discontinued

- New hosting can be found at https://gitlab.aei.uni-hannover.de (powered by the new Gitlab software suite)

- Remember to move a complete mirror of your repository to the new machine (all remote branches/refs/tags etc)

- Gitmaster will be shutdown June 2016

- Most important change is the lack of "Teams" in Gitlab, but the new system includes tools to alleviate potential problems

- Changed terminology: Repository -> Project, Project -> Group

- For assistance contact alexander.post@aei.mpg.de or atlas_admin@aei.mpg.de

Registering a new account

Head to https://gitlab.aei.uni-hannover.de and you will see something like this:

Screen_Shot_2016-01-28_at_15.16.11.png

Fill out the 4 fields in the bottom right corner with the respective information (preferably your FULL name) and hit "Sign up"

A short while later you will receive an E-Mail to the address you supplied asking you to confirm your account. You can do this by simply clicking on the link in the E-Mail's body. This will also automatically log you into your newly created account and you will see something like this:

Screen_Shot_2016-01-28_at_15.29.56.png

Adding your ssh public key

In order to be able to work with the git repositories via ssh you need to link your ssh public-key to your gitlab account, just like you did previously on gitmaster. To do this click on "Profile Settings" in the sidebar. Next click on "SSH Keys" followed by "Add SSH Key" in the top right. On this page you have to enter your public ssh key and a "Title" which is just a short identifier for you in case you want to add multiple keys.

Screen_Shot_2016-01-28_at_15.42.07.png

If you don't know how to locate your public ssh-key you can output it on the command line via
ssh-keygen -y
This will prompt you for your private key's location (Note: Make sure to point it to the key you want to use for git) and passphrase and output your public key for you. Just copy and paste the output into the form on the website and click "Add key"

Creating a project and migrating your repositories

Note: This is only necessary if you are the owner of a repo/project on gitmaster. Not everyone that has currently checked out a repository has to push it to the new system.

Now you need to create a new project (previously called repository) on gitlab so on your dashboard simply click "New project". As the project path just enter the name of the repository you want to migrate and add a short description in the designated text box. Choose the visibility-level of your project (default is private) and click "Create Project". After a few seconds you will be greeted by something like this:

Screen_Shot_2016-01-28_at_15.56.18.png

Make a note of your project's path, in the case above it is alex_ligo/alextestproject.git because it will be important in the next step.

From this point forward you should avoid/prohibit pushing to the old repository on gitmaster

To move your git repository from the old server to the new one you need to clone it from gitmaster and push it onto gitlab. We're going to do this whole procedure in a temporary directory so your local working copy won't be touched until the very end. To get a local copy of your whole repository including all tags and branches run
cd /tmp
git clone --mirror git@gitmaster.atlas.aei.uni-hannover.de:<PATH TO YOUR REPOSITORY ON GITMASTER>.git
cd <Directory where your OLD repo was just cloned>
git remote set-url origin git@gitlab.aei.uni-hannover.de:<PATH TO YOUR REPOSITORY ON GITLAB>.git
git push -f --mirror origin

This process might take some time depending on the size of your git repository. After this has finished you should go back into your local working copy of the repository (the directory you've been working in before the migration) and update the git-remote via

Note: This assumes your upstream repository is identified by the name origin

cd /path/to/your/working/copy
git remote set-url origin git@gitlab.aei.uni-hannover.de:<PATH TO YOUR REPOSITORY ON GITLAB>.git

This should bring you up to date with the new remote repository and allow you to remove the temporary you created

cd /tmp
rm <Directory where your OLD repo was just cloned>

After you finished running to above commands the migration process is done for this repository. Just repeat the previous steps for any repositories you have left.

Need help?

If you have problems with any steps of the process or the new UI/functionality feel free to contact me at alexander.post@aei.mpg.de or atlas_admin@aei.mpg.de

FAQ

Q: Can't you just migrate my user account/repository/team/misc

A: Sorry but the old and new system aren't compatible to automate the process. If you need any help you know how to contact us!

Q: Where's the team functionality?

A: Gitlab does not support teams like Gitorious did but you can easily batch-copy groups of people between projects.

Q: I don't receive those spiffy emails on push anymore?!

A: That's not really a question. The Emails-on-Push functionality now has to be granted by the group/project owner. It's in the project setting and can be highly customised.

Q: Will my repositories still be private?

A: Projects in Gitlab are private by default. If anything, your repo will be more secure than before … you can set the projects to private (strict), internal (only registered users can access it) and public. You can also customise access levels of your project's members.

-- AlexPost - 28 Jan 2016
Topic revision: r11 - 07 Jun 2016, AlexPost
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback