summaryrefslogtreecommitdiff
path: root/doc/user/project/import/github.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/project/import/github.md')
-rw-r--r--doc/user/project/import/github.md174
1 files changed, 83 insertions, 91 deletions
diff --git a/doc/user/project/import/github.md b/doc/user/project/import/github.md
index 329d91916e8..a190edb179d 100644
--- a/doc/user/project/import/github.md
+++ b/doc/user/project/import/github.md
@@ -7,66 +7,56 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Import your project from GitHub to GitLab **(FREE)**
-Using the importer, you can import your GitHub repositories to GitLab.com or to
-your self-managed GitLab instance.
-
-The following aspects of a project are imported:
-
-- Repository description (GitLab.com & 7.7+)
-- Git repository data (GitLab.com & 7.7+)
-- Issues (GitLab.com & 7.7+)
-- Pull requests (GitLab.com & 8.4+)
-- Wiki pages (GitLab.com & 8.4+)
-- Milestones (GitLab.com & 8.7+)
-- Labels (GitLab.com & 8.7+)
-- Release note descriptions (GitLab.com & 8.12+)
-- Pull request review comments (GitLab.com & 10.2+)
-- Pull request reviews (GitLab.com & 13.7+)
-- Pull request "merged by" information (GitLab.com & 13.7+)
-- Regular issue and pull request comments
-- [Git Large File Storage (LFS) Objects](../../../topics/git/lfs/index.md)
-- Pull request comments replies in discussions ([GitLab.com & 14.5+](https://gitlab.com/gitlab-org/gitlab/-/issues/336596))
-- Diff Notes suggestions ([GitLab.com & 14.7+](https://gitlab.com/gitlab-org/gitlab/-/issues/340624))
-
-References to pull requests and issues are preserved (GitLab.com & 8.7+), and
-each imported repository maintains visibility level unless that [visibility
-level is restricted](../../public_access.md#restrict-use-of-public-or-internal-projects),
-in which case it defaults to the default project visibility.
-
-The namespace is a user or group in GitLab, such as `gitlab.com/janedoe` or
-`gitlab.com/customer-success`. You can do some bulk actions to move projects to
-different namespaces in the rails console.
-
-This process does not migrate or import any types of groups or organizations
-from GitHub to GitLab.
-
-## Use cases
-
-The steps you take depend on whether you are importing from GitHub.com or
-GitHub Enterprise. The steps also depend on whether you are importing to GitLab.com or
-self-managed GitLab instance.
-
-- If you're importing to GitLab.com, you can alternatively import GitHub repositories
- using a [personal access token](#use-a-github-token). We do not recommend
- this method, as it does not associate all user activity (such as issues and
- pull requests) with matching GitLab users.
-- If you're importing to a self-managed GitLab instance, you can alternatively use the
- [GitHub Rake task](../../../administration/raketasks/github_import.md) to import
- projects without the constraints of a [Sidekiq](../../../development/sidekiq_style_guide.md) worker.
-- If you're importing from GitHub Enterprise to your self-managed GitLab instance:
- - You must first enable [GitHub integration](../../../integration/github.md).
- - To import projects from GitHub Enterprise to GitLab.com, use the [Import API](../../../api/import.md).
- - If GitLab is behind a HTTP/HTTPS proxy you must populate the [allowlist for local requests](../../../security/webhooks.md#allowlist-for-local-requests)
- with `github.com` and `api.github.com` to solve the hostname. For more information, read the issue
- [Importing a GitHub project requires DNS resolution even when behind a proxy](https://gitlab.com/gitlab-org/gitlab/-/issues/37941)
-- If you're importing from GitHub.com to your self-managed GitLab instance,
- setting up GitHub integration is not required. You can use the [Import API](../../../api/import.md).
-
-## How it works
+You can import your GitHub repositories:
+
+- From either GitHub.com or GitHub Enterprise.
+- To either GitLab.com or a self-managed GitLab instance.
+
+This process does not migrate or import any types of groups or organizations from GitHub to GitLab.
+
+The namespace is a user or group in GitLab, such as `gitlab.com/sidney-jones` or
+`gitlab.com/customer-success`. You can use bulk actions in the rails console to move projects to
+different namespaces.
+
+If you are importing to a self-managed GitLab instance, you can use the
+[GitHub Rake task](../../../administration/raketasks/github_import.md) instead. This allows you to import projects
+without the constraints of a [Sidekiq](../../../development/sidekiq/index.md) worker.
+
+If you are importing from GitHub Enterprise to a self-managed GitLab instance:
+
+- You must first enable [GitHub integration](../../../integration/github.md).
+- To import projects from GitHub Enterprise to GitLab.com, use the [Import API](../../../api/import.md).
+- If GitLab is behind a HTTP/HTTPS proxy, you must populate the [allowlist for local requests](../../../security/webhooks.md#allowlist-for-local-requests)
+ with `github.com` and `api.github.com` to solve the hostname. For more information, read the issue
+ [Importing a GitHub project requires DNS resolution even when behind a proxy](https://gitlab.com/gitlab-org/gitlab/-/issues/37941).
+
+If you are importing from GitHub.com to a self-managed GitLab instance:
+
+- Setting up GitHub integration is not required.
+- You can use the [Import API](../../../api/import.md).
+
+When importing projects:
+
+- If a user referenced in the project is not found in the GitLab database, the project creator is set as the author and
+ assignee. The project creator is usually the user that initiated the import process. A note on the issue mentioning the
+ original GitHub author is added.
+- The importer creates any new namespaces (or groups) if they do not exist, or, if the namespace is taken, the
+ repository is imported under the namespace of the user who initiated the import process. The namespace or repository
+ name can also be edited, with the proper permissions.
+- The importer also imports branches on forks of projects related to open pull requests. These branches are
+ imported with a naming scheme similar to `GH-SHA-username/pull-request-number/fork-name/branch`. This may lead to
+ a discrepancy in branches compared to those of the GitHub repository.
+
+For additional technical details, refer to the [GitHub Importer](../../../development/github_importer.md)
+developer documentation.
+
+For an overview of the import process, see the video [Migrating from GitHub to GitLab](https://youtu.be/VYOXuOg9tQI).
+
+## Prerequisites
When issues and pull requests are being imported, the importer attempts to find
-their GitHub authors and assignees in the database of the GitLab instance (note
-that pull requests are called "merge requests" in GitLab).
+their GitHub authors and assignees in the database of the GitLab instance. Pull requests are called _merge requests_ in
+GitLab.
For this association to succeed, each GitHub author and assignee in the repository
must meet one of the following conditions prior to the import:
@@ -75,32 +65,9 @@ must meet one of the following conditions prior to the import:
- Have a GitHub account with a [public-facing email address](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address)
that matches their GitLab account's email address.
- NOTE:
- GitLab content imports that use GitHub accounts require that the GitHub
- public-facing email address is populated so that all comments and
- contributions are properly mapped to the same user in GitLab. GitHub
- Enterprise (on premise) does not require this field to be populated to use the
- product, so you may have to add it on existing accounts for the imported
- content to be properly mapped to the user in the new system. Refer to GitHub
- documentation for instructions on how to add this email address.
-
-If a user referenced in the project is not found in the GitLab database, the project creator (typically the user
-that initiated the import process) is set as the author/assignee, but a note on the issue mentioning the original
-GitHub author is added.
-
-The importer creates any new namespaces (groups) if they do not exist, or, if the namespace is taken, the
-repository is imported under the namespace of the user who initiated the import process. The namespace/repository
-name can also be edited, with the proper permissions.
-
-The importer will also import branches on forks of projects related to open pull requests. These branches will be
-imported with a naming scheme similar to `GH-SHA-username/pull-request-number/fork-name/branch`. This may lead to
-a discrepancy in branches compared to those of the GitHub repository.
-
-For additional technical details, you can refer to the
-[GitHub Importer](../../../development/github_importer.md "Working with the GitHub importer")
-developer documentation.
-
-For an overview of the import process, see the video [Migrating from GitHub to GitLab](https://youtu.be/VYOXuOg9tQI).
+GitLab content imports that use GitHub accounts require that the GitHub public-facing email address is populated. This means
+all comments and contributions are properly mapped to the same user in GitLab. GitHub Enterprise does not require this
+field to be populated so you may have to add it on existing accounts.
## Import your GitHub repository into GitLab
@@ -108,10 +75,12 @@ For an overview of the import process, see the video [Migrating from GitHub to G
Before you begin, ensure that any GitHub users who you want to map to GitLab users have either:
-- A GitLab account that has logged in using the GitHub icon
- \- or -
+- A GitLab account that has logged in using the GitHub icon.
- A GitLab account with an email address that matches the [publicly visible email address](https://docs.github.com/en/rest/reference/users#get-a-user) in the profile of the GitHub user
+If you are importing to GitLab.com, you can alternatively import GitHub repositories using a [personal access token](#use-a-github-token).
+We do not recommend this method, as it does not associate all user activity (such as issues and pull requests) with matching GitLab users.
+
User-matching attempts occur in that order, and if a user is not identified either way, the activity is associated with
the user account that is performing the import.
@@ -119,10 +88,10 @@ NOTE:
If you are using a self-managed GitLab instance or if you are importing from GitHub Enterprise, this process requires that you have configured
[GitHub integration](../../../integration/github.md).
-1. From the top navigation bar, click **+** and select **New project**.
+1. From the top navigation bar, select **+** and select **New project**.
1. Select the **Import project** tab and then select **GitHub**.
1. Select the first button to **List your GitHub repositories**. You are redirected to a page on [GitHub](https://github.com) to authorize the GitLab application.
-1. Click **Authorize GitlabHQ**. You are redirected back to the GitLab Import page and all of your GitHub repositories are listed.
+1. Select **Authorize GitlabHQ**. You are redirected back to the GitLab Import page and all of your GitHub repositories are listed.
1. Continue on to [selecting which repositories to import](#select-which-repositories-to-import).
### Use a GitHub token
@@ -134,14 +103,13 @@ associate all user activity (such as issues and pull requests) with matching Git
If you are an administrator of a self-managed GitLab instance or if you are importing from
GitHub Enterprise, you cannot use a personal access token.
The [GitHub integration method (above)](#use-the-github-integration) is recommended for all users.
-Read more in the [How it works](#how-it-works) section.
If you are not using the GitHub integration, you can still perform an authorization with GitHub to grant GitLab access your repositories:
1. Go to <https://github.com/settings/tokens/new>
1. Enter a token description.
1. Select the repository scope.
-1. Click **Generate token**.
+1. Select **Generate token**.
1. Copy the token hash.
1. Go back to GitLab and provide the token to the GitHub importer.
1. Hit the **List Your GitHub Repositories** button and wait while GitLab reads your repositories' information.
@@ -161,7 +129,7 @@ your GitHub repositories are listed.
you can filter projects by name. If filter is applied, **Import all repositories** only imports matched repositories.
1. The **Status** column shows the import status of each repository. You can choose to leave the page open and it will
update in real-time or you can return to it later.
-1. Once a repository has been imported, click its GitLab path to open its GitLab URL.
+1. Once a repository has been imported, select its GitLab path to open its GitLab URL.
![GitHub importer page](img/import_projects_from_github_importer_v12_3.png)
@@ -197,6 +165,30 @@ Reducing the time spent in cloning a repository can be done by increasing networ
performance (by using high performance SSDs, for example) of the disks that store the Git repositories (for your GitLab instance).
Increasing the number of Sidekiq workers does *not* reduce the time spent cloning repositories.
+## Imported data
+
+The following items of a project are imported:
+
+- Repository description.
+- Git repository data.
+- Issues.
+- Pull requests.
+- Wiki pages.
+- Milestones.
+- Labels.
+- Release note descriptions.
+- Pull request review comments.
+- Regular issue and pull request comments.
+- [Git Large File Storage (LFS) Objects](../../../topics/git/lfs/index.md).
+- Pull request reviews (GitLab.com and GitLab 13.7 and later).
+- Pull request "merged by" information (GitLab.com and GitLab 13.7 and later).
+- Pull request comments replies in discussions ([GitLab.com and GitLab 14.5 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/336596)).
+- Diff Notes suggestions ([GitLab.com and GitLab 14.7 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/340624)).
+
+References to pull requests and issues are preserved. Each imported repository maintains visibility level unless that
+[visibility level is restricted](../../public_access.md#restrict-use-of-public-or-internal-projects), in which case it
+defaults to the default project visibility.
+
## Alternative way to import notes and diff notes
When GitHub Importer runs on extremely large projects not all notes & diff notes can be imported due to GitHub API `issues_comments` & `pull_requests_comments` endpoints limitation.