-
Access Rights:
- Ensure you have sufficient access rights (Owner or Maintainer) to the project in the source GitLab instance.
- Ensure you have access to create repositories in the destination GitLab instance.
-
GitLab Versions:
- Confirm both GitLab instances are compatible. Ideally, they should be on the same or a close version to avoid issues during import/export.
-
Check for Features:
- Identify features that won't transfer, such as CI/CD configurations, runners, or container registry content. Plan to recreate these in the destination.
-
Install Git:
- Ensure Git is installed on your local machine.
-
Go to the Source GitLab Instance:
- Navigate to the project you want to transfer.
-
Export the Project:
- In the project’s settings, go to Settings > General > Advanced.
- Scroll to the Export project section and click Export project.
- GitLab will create a downloadable
.tar.gz
file containing all the project data (code, issues, merge requests, and more).
-
Download the Export File:
- Once the export is complete, download the file from the provided link.
-
Go to the Destination GitLab Instance:
- Log in to the destination GitLab instance.
-
Create a New Project:
- Go to Projects > New project.
- Select Import project and choose GitLab Export.
-
Upload the Export File:
- Upload the
.tar.gz
file you downloaded from the source GitLab instance.
- Upload the
-
Verify the Imported Project:
- Check if all the contents, issues, and merge requests are present in the destination project.
- Some items may not transfer and need manual setup:
- CI/CD Configurations: Copy
.gitlab-ci.yml
and validate pipelines on the destination. - Runners: Configure runners in the destination GitLab.
- Container Registry: If using a container registry, push images manually:
- Pull images from the source using
docker pull
. - Tag and push images to the destination registry using
docker tag
anddocker push
.
- Pull images from the source using
- CI/CD Configurations: Copy
- Clone the new project from the destination GitLab to your local machine:
git clone https://destination-gitlab-instance.com/username/project-name.git
- Verify that the codebase, issues, and pipelines are intact.
- If you or other team members have cloned the project locally, update the remote URL:
git remote set-url origin https://destination-gitlab-instance.com/username/project-name.git
If you only need the Git repository without issues or CI/CD:
- Clone the repository from the source:
git clone --mirror https://source-gitlab-instance.com/username/project-name.git
- Push it to the destination:
cd project-name.git
git push --mirror https://destination-gitlab-instance.com/username/project-name.git
The previous steps can be followed, additionally the namespace of the project can be changed here: Settings > General > Advanced.