Skip to content

Migration/transfer of GitLab groups/projects

You can transfer/migrate groups/projects in a group from GitLab Pilot in SCC to KIT-GitLab with different ways.

Pilot GitLab in SCC: https://git.scc.kit.edu   ➠   KIT-GitLab : https://gitlab.kit.edu

You can migrate projects/group mainly with two approaches either export file or direct transfer. In addition you can also transfer projects under your account using standard git command or direct downloading from the Web UI

To export groups recursively and import them one-by-one under correct name and path, this script helps users who want to migrate their entire group structure.

Note: Advanced user can also consider to utilize congregate, which is an automation wrapper for the export/import around the GitLab APIs.


Project transfer

1. Direct transfer for project

KIT-GitLab

  1. Create a new project: on the top bar you can find new project alt text, and then select Import project.

    alt text

  2. Select repository by URL or GitLab export

    alt text

  3. Require the credential of pilot gitlab and please fill out your new project and URL.

    alt text

    • The repository must be accessible over http://, https:// or git://.
    • When using the http:// or https:// protocols, please provide the exact URL to the repository. HTTP redirects will not be followed. e.g. https://git.scc.kit.edu/ab1234/your_project.git (please do not forget postfix ".git" at the end)
    • If your HTTP repository is not publicly accessible, add your credentials.
    • The import will time out after 180 minutes. For repositories that take longer, use a clone/push combination.
  4. Select Create project

  5. Once imported, repositories can be mirrored over SSH.

The success or failures of the import via direct transfer can be seen at gitlab.kit.edu/import/bulk_imports/history.


2. Export file for project

Pilot GitLab

  1. Go to Projects in the sidebar
  2. Navigate Settings ➜ General ➜ Advanced

    alt text

  3. Click Export project

  4. After starting export project, a download link will be sent by email and made available on the same page.

KIT-GitLab

  1. Create a new project same process as introduced in the direct transfer for project session
  2. Select import project and click Gitlab export alt text
  3. Give project name and URL, and choose generated export file

    alt text

  4. Select Import project


3. Git-clone

In your local machine:

You need to use git clone to copy your project in your local machine.

For cloning project in a group with https connection:

git clone https://<username>:<personal_access_token>@gitlab.kit.edu/kit/group/your_project.git

You can also access a project with ssh:

git clone ssh://git@gitlab.kit.edu/kit/group/your_project.git

For more information, please find the git usage on the KIT-GitLab documentation page GitLab first step


4. Downloading

You can download your project with (zip / gz / bz2 / tar) file format from Pilot Gitlab in SCC , then you should create a new project and push all contents after uncompressing to KIT-GitLab repository.

If you have a private project in user namespace, then this would be a simplest way transferring your project to new GitLab repository.


Group transfer

1. Direct transfer for group

Note: Importing groups with projects is in Beta. This feature is not ready for production use. If you use this function, then carefully check whether all projects and repositories have been fully adopted. Details about the error may available at https://gitlab.kit.edu/import/bulk_imports/history when the status of the import is 'Complete'.

Pilot GitLab

  • Create a personal access token with api and read_repository scopes in the user settings of the source Pilot GitLab.

KIT-GitLab

To create a subgroup, fill out the form at this link docs.gitlab.kit.edu/group. A detailed description of the process can be found at https://docs.gitlab.kit.edu/en/organization/#create_group. Or you need to have a permission in your institute (OU group), please make a request to OU group owner for access.

After creating the new group, you will receive an e-mail from the system that the group has been created.

Further subgroups and projects can be created or migrated below this new group. You can also import groups into existing groups where you have the owner role:

  1. On your group page, select "New subgroup" on the top bar.

    alt text

  2. Select the "import an existing group" link.

    alt text

  3. Enter the URL of pilot GitLab (https://git.scc.kit.edu) and personal access token for your source GitLab instance. Select "Connect instance"

    alt text

  4. All available importing groups will be displayed, select source group, and click "Import with projects", optionally you can also choose "Import without projects".

    alt text

Note: Subgroup "kit/scc/sys" is already registered in new GitLab and therefore "sys" cannot be created, but "gitlab" subgroup can be imported.


2. Export file for group

Pilot GitLab

  1. Go to Groups in the sidebar
  2. Select group, then navigate Settings ➜ General ➜ Advanced

    alt text

  3. Click Export group, then will be generated an export file.

  4. After starting "export group", a download link will be sent by email and made available on the same page.

KIT-GitLab

  1. Download export file in your local machine.
  2. Create new group in your OUs, and select "import group" (not "create group").
  3. Please go to the session "Import group from file".
  4. Upload generated export file to KIT-GitLab.

    alt text

  5. Select Import

Transfer user's contribution on Wiki and Issue Board

It is possible to migrate user's contribution in projects and the associated information from one gitlab instance to another e.g. from the pilot operation to the new KIT GitLab instance. Wiki and Issue Board can be transferred correctly with their authors (creators and comments) and assignees, instead of the migrating owner suddenly talking to himself in all issues.

Requirements:

  • User exists in the pilot gitlab being migrated from
  • User exists in the new gitlab being migrated to
  • User has to set his mail to 'public' in pilot and new gitlab through profile setting
  • User Settings - Edit Profile - Main Settings - Public email

    alt text alt text

  • The public email is identical in both gitlab instances

After migration project/group with setting same public email, you will find correctly assinged comments form contributors.

alt text alt text

1. User's contribution on group

  • Migration of a group with its projects via direct transfer allows to transfer the issues and wiki
  • Via export and import (File Export) does not allow transferring user's contribution correctly. GitLab does not support this feature currently.

2. User's contribution on project

  • For individual projects/repository you must use export and import (File Export) instead of direct transfer.
  • Use "GitLab Export" rather than "Repository by URL" at import project session.