Skip to main content
Version: 5.13.0

Import and Export Gitlab Projects Effectively

This guide demonstrates how to easily import and export projects and groups within GitLab, discusses essentials, such as permissions and email notifications, and walks you through each export and import step.

Prerequisites

  • A GitLab account with Owner permissions for the project or group you wish to import/export
  • An email account linked to your GitLab account for receiving notifications

Exporting in GitLab

Group Export

Steps

  1. Log In: Access GitLab using an account that holds Owner permissions for the group you want to export.

  2. Navigate to Group: Go to Menu > Groups and select the group you wish to export.

  3. Access Settings: From the left sidebar, navigate to Settings > General.

  4. Start Export: In the "Advanced" section, click Export Group.

    • Note: If an export already exists, the button will say Regenerate export.
    • Caution: You will receive a warning that export is deprecated in favor of migration between GitLab instances. Proceed, since the goal is to export to a file. Group Export Step
  5. Wait: An export process will begin, and you will receive an email upon its completion.

  6. Download Export:

    a. Use the link in the email. Copying/pasting is likely required.

    b. Alternatively, refresh Settings > General, expand the Advanced section, and click Download export.

Possible Issues

If the export process takes too long, contact your GitLab administrator for assistance.

Project Export

Repeat the same steps as for Group Export, but navigate to Menu > Projects in step 2 and select your project.

Project Export Step

Bare Clone

  1. Generate Access Token: If you have not already, generate an access token for your user account. Only read_repository permissions are required.

  2. Get HTTPS URL: Navigate to your project, click Clone, and copy the Clone with HTTPS URL.

  3. Execute Clone: Run the following command, replacing the URL, as necessary.

    git clone --bare <your-https-url>
  4. Authentication: If prompted, input your username and generated access token.

  5. Create Archive:

    tar -czf your-archive-name.tar.gz your-bare-repo.git

Importing in GitLab

Group Import

  1. Log In: Access GitLab with an account that holds Owner permissions.

  2. Start Import: Click Groups at the top right, then Import group.

  3. Configure: Fill out the group name and modify the URL, as needed.

  4. Upload File: Click Choose file... and upload the previously exported file.

  5. Confirm: Click Import. The process may take a while, and you can refresh the page to check progress.

  6. Completion: Your group should now be imported.

Project Import

Follow the steps outlined in Group Import, but go to Projects > Import project instead of Import group for starting the import.


Validation

To ensure the export and import were successful:

  • Verify that all the project or group files, issues, and members were transferred.
  • Make sure to check your email for notifications confirming a successful process.