doc/user/import/bitbucket_server.md
{{< details >}}
{{< /details >}}
{{< history >}}
bitbucket_server_user_mapping_by_username. Disabled by default.{{< /history >}}
Import your projects from Bitbucket Server to GitLab.
The Bitbucket Server importer imports a subset of items from Bitbucket Server.
| Bitbucket Server item | Imported |
|---|---|
| Repository description | {{< yes >}} |
| Git repository data | {{< yes >}} |
| Pull requests, including comments, user mentions, reviewers, and merge events | {{< yes >}} |
| LFS objects | {{< yes >}} |
| Comments on code<sup>1</sup> | {{< yes >}} |
| Threads<sup>2</sup> | {{< yes >}} |
| Project filters<sup>3</sup> | {{< yes >}} |
| Attachments in Markdown | {{< no >}} |
| Task lists | {{< no >}} |
| Emoji reactions | {{< no >}} |
| Pull request approvals | {{< no >}} |
| Approval rules for pull requests | {{< no >}} |
Footnotes:
The Bitbucket Server importer supports post-migration mapping of user contributions for GitLab.com and GitLab Self-Managed. The importer also supports an alternative method of mapping.
When Bitbucket Server items are imported:
When closed or merged pull requests are imported, commit SHAs that do not exist in the repository are fetched from Bitbucket Server to make sure pull requests have commits tied to them:
refs/merge-requests/<iid>/head.refs/keep-around/<SHA>.If the source commit does not exist in the repository, a commit containing the SHA in the commit message is used instead.
Every import from Bitbucket Server is different, which affects the duration of imports you perform. However, to help estimate the duration of your import, a project comprised of the following data is likely to take 8 hours to import:
To import your Bitbucket Server repositories:
You can disable the bitbucket_server_user_mapping feature flag to use the alternative user contribution mapping method
for imports.
For imports to GitLab.com, you must use the post-migration method instead.
[!flag] The availability of this feature is controlled by a feature flag. This feature is not recommended and is unavailable for migrations to GitLab.com. Problems that are found in this mapping method are unlikely to be fixed. Use the post-migration method instead that doesn't have these limitations.
For more information, see issue 512213.
Using the alternative method, the importer tries to match a Bitbucket Server user's email address with a confirmed email address in the GitLab user database. If no such user is found:
Mentions on pull request descriptions and notes are matched to user profiles on a Bitbucket Server by using the user's email address. If a user with the same email address is not found on GitLab, the mention is made static. For a user to be matched, they must have a GitLab role that provides at least read access to the project.
If the project is public, GitLab only matches users who are invited to the project.
The importer creates any new namespaces (groups) if they don't exist. If the namespace is taken, the repository imports under the namespace of the user who started the import process.
The following sections contain solutions for problems you might encounter.
If the GUI-based import tool does not work, you can try to:
See the troubleshooting section for Bitbucket Cloud.
If the project import completes but LFS objects can't be downloaded or cloned, you may be using a password or personal access token containing special characters. For more information, see issue 337769.
If a project import fails with an error message such as Importing the project failed: Import URL is blocked, even though the initial connection to the Bitbucket
server succeeded, the Bitbucket server or a reverse proxy might not be configured correctly.
To troubleshoot this problem, use the Projects API to check for the newly-created project and locate the import_url value of the project.
This value indicates the URL provided by the Bitbucket server to use for the import. If this URL isn't publicly resolvable, you can get unresolvable address errors.
To fix this problem, ensure that the Bitbucket server is aware of any proxy servers because proxy servers can impact how Bitbucket constructs and uses URLs. For more information, see proxy and secure Bitbucket.
If a project import fails with an error message containing JSON::NestingError, the Bitbucket Server response contains deeply nested objects that exceed the max_http_response_json_depth setting.
To resolve this issue, increase the maximum allowed nesting depth in JSON HTTP responses from outbound requests.