- Prerequisite for GitLab self-managed
- How it works
- Requirements for user-mapped contributions
- Import your Bitbucket repositories
Import your projects from Bitbucket Cloud to GitLab with minimal effort.
The Bitbucket importer can import:
- Repository description
- Git repository data
- Issue comments
- Pull requests
- Pull request comments
- References to pull requests and issues are preserved.
- Repository public access is retained. If a repository is private in Bitbucket, it’s created as private in GitLab as well.
To import your projects from Bitbucket Cloud, the Bitbucket Cloud integration must be enabled. If it isn’t enabled, ask your GitLab administrator to enable it. By default it’s enabled on GitLab.com.
When issues/pull requests are being imported, the Bitbucket importer uses the Bitbucket nickname of the author/assignee and tries to find the same Bitbucket identity in GitLab. If they don’t match or the user is not found in the GitLab database, the project creator (most of the times the current user that started the import process) is set as the author, but a reference on the issue about the original Bitbucket author is kept.
The importer will create any new namespaces (groups) if they don’t exist or in the case the namespace is taken, the repository will be imported under the user’s namespace that started the import process.
For user contributions to be mapped, each user must complete the following before the project import:
Verify that the username in the Bitbucket account settings matches the public name in the Atlassian account settings. If they don’t match, modify the public name in the Atlassian account settings to match the username in the Bitbucket account settings.
Connect your Bitbucket account in GitLab profile social sign-in.
- Sign in to GitLab.
- On the top bar, select New ().
- Select New project/repository.
- Select Import project.
- Select Bitbucket Cloud.
Log in to Bitbucket and grant GitLab access to your Bitbucket account.
Select the projects that you’d like to import or import all projects. You can filter projects by name and select the namespace each project will be imported for.
Be sure to sign in to the correct account.
If you’ve accidentally started the import process with the wrong account, follow these steps:
Revoke GitLab access to your Bitbucket account, essentially reversing the process in the following procedure: Import your Bitbucket repositories.
Sign out of the Bitbucket account. Follow the procedure linked from the previous step.
For user mapping to work, the username in the Bitbucket account settings must match the public name in the Atlassian account settings. If these names match but user mapping still fails, the user may have modified their Bitbucket username after connecting their Bitbucket account in the GitLab profile social sign-in.
To fix this, the user must verify that their Bitbucket external UID in the GitLab database matches their current Bitbucket public name, and reconnect if there’s a mismatch:
In the API’s response, the
identitiesattribute contains the Bitbucket account that exists in the GitLab database. If the
extern_uiddoesn’t match the current Bitbucket public name, the user should reconnect their Bitbucket account in the GitLab profile social sign-in.
Following reconnection, the user should use the API again to verify that their
extern_uidin the GitLab database now matches their current Bitbucket public name.
The importer must then delete the imported project and import again.