Migrate through a manifest file
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Import Git repositories based on a manifest file like the one used by the Android repository. Use the manifest to import a project with many repositories like the Android Open Source Project (AOSP).
Prerequisites
- Manifest import source enabled. If not enabled, ask your GitLab administrator to enable it. The Manifest import source is enabled by default on GitLab.com.
- The Maintainer or Owner role on the destination top-level group to import to. You might want to create a new top-level group for the import.
Manifest file format
The manifest file must be an XML file up to 1 MB in size. The file must have:
- One
remotetag with areviewattribute that contains a URL to a Git server. projecttags with anameandpathattribute.
GitLab builds the URL to the repository by combining the URL from the remote tag with a project name.
The path attribute is used to represent the project path in GitLab.
For example:
<manifest>
<remote review="https://android.googlesource.com/" />
<project path="build/make" name="platform/build" />
<project path="build/blueprint" name="platform/build/blueprint" />
</manifest>In this example, GitLab creates the following projects:
| GitLab | Import URL |
|---|---|
https://gitlab.com/<group_name>/build/make | https://android.googlesource.com/platform/build |
https://gitlab.com/<group_name>/build/blueprint | https://android.googlesource.com/platform/build/blueprint |
Import the repositories
To import repositories by using a manifest file:
- In the upper-right corner, select Create new ( ) and New project/repository.
- Select Import project.
- Select Manifest file.
- Select a group you want to import to.
- Choose an XML-formatted manifest file to use.
- Select List available repositories. You are redirected to the import status page with a projects list based on the manifest file.
- To import:
- All projects for the first time, select Import all repositories.
- Individual projects again, select Re-import. Specify a new name and select Re-import again. Re-importing creates a new copy of the source project.