# Manage access for a migration from GitLab to GitHub

Set up the required access for migrating from GitLab to GitHub.

To migrate repositories from GitLab to GitHub, you need sufficient access to the **source** (a project on GitLab) and the **destination** (an organization on GitHub). After you complete the steps in this article, your access and permissions will be ready for your migration.

## Decide who will perform the migration

If the person who will perform the migration is **not** a GitHub organization owner, a GitHub organization owner must first grant them the migrator role.

* If you're a GitHub organization owner, and intend to perform the migration yourself, you can continue reading this guide.
* If you wish to assign the migrator role to someone else, do that now. Then, the migrator should perform the rest of the steps in these guides. See [Granting the migrator role](/ja/migrations/using-github-enterprise-importer/migrate-from-gitlab/grant-the-migrator-role).

## Create a personal access token (classic) on GitHub

Next, you will need to create a personal access token (classic) which the GL2GH extension of the GitHub CLI will use to communicate with GitHub. GitHub
personal access token (classic)に必要なスコープは、あなたの役割と実行したいタスクによって異なります。

> \[!NOTE]
> personal access token (classic) のみを使用でき、fine-grained personal access token は使用できません。つまり、組織が "組織へのアクセスをGitHub Enterprise Importerに制限する" ポリシーを使用している場合、personal access tokens (classic)を使用することはできません。 詳しくは、「[Enterprise 内の個人用アクセス トークンに対するポリシーの適用](/ja/enterprise-cloud@latest/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-personal-access-tokens-in-your-enterprise#restricting-access-by-personal-access-tokens)」をご覧ください。

| タスク                             | 組織の所有者                                                                                                                                                                                                                               | 移行ツール                                                                                                                                                                                                                                |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| リポジトリ移行用の移行ロールを割り当てる            | `admin:org`                                                                                                                                                                                                                          | <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-dash" aria-label="Not applicable" role="img"><path d="M2 7.75A.75.75 0 0 1 2.75 7h10a.75.75 0 0 1 0 1.5h-10A.75.75 0 0 1 2 7.75Z"></path></svg> |
| リポジトリの移行の実行 (移行先の Organization) |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |
| `repo`、`admin:org`、`workflow`   |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |
| `repo`、`read:org`、`workflow`    |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |
| 移行ログのダウンロード                     |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |
| `repo`、`admin:org`、`workflow`   |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |
| `repo`、`read:org`、`workflow`    |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |
| マネキンの回収                         |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |
| `repo`、`admin:org`、`workflow`   | <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-dash" aria-label="Not applicable" role="img"><path d="M2 7.75A.75.75 0 0 1 2.75 7h10a.75.75 0 0 1 0 1.5h-10A.75.75 0 0 1 2 7.75Z"></path></svg> |                                                                                                                                                                                                                                      |

To learn how to create the token, see [個人用アクセス トークンを管理する](/ja/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).

## Create a personal access token on GitLab

Your GitLab personal access token must have the `api` and `read_repository` scopes.

For self-managed GitLab instances, the token must belong to an **administrator**, so that the export is complete and user attribution is preserved.

To learn how to create the token, see [Personal access tokens](https://docs.gitlab.com/user/profile/personal_access_tokens/) in the GitLab documentation.

## Configure IP allow lists on GitHub

If you use GitHub's IP allow list feature, you must add the GitHub IP ranges below to the allow list for the destination organization. See [組織に対する許可 IP アドレスを管理する](/ja/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization) or [IP 許可リストを使用して Enterprise へのネットワーク トラフィックを制限する](/ja/enterprise-cloud@latest/admin/configuring-settings/hardening-security-for-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list).

If your destination organization is on **GitHub.com**, you will need to allow the following IP addresses:

* 192.30.252.0/22
* 185.199.108.0/22
* 140.82.112.0/20
* 143.55.64.0/20
* 135.234.59.224/28 (2025 年 7 月 28 日に追加)
* 2a0a:a440::/29
* 2606:50c0::/32
* 20.99.172.64/28 (2025 年 7 月 28 日に追加)

If your destination organization is on **GHE.com**, the ranges you need to allow depend on your data residency region. You can get an up-to-date list of IP ranges used by GitHub Enterprise Importer with the `/meta` endpoint of the REST API. The `github_enterprise_importer` key in the response contains a list of IP ranges used for migrations.

## Allow migrations to bypass repository rulesets

移行先の組織または企業でルールセットが有効になっている場合、移行されたリポジトリの履歴がそれらのルールに違反する可能性があります。 ルールセットを無効にせずに移行を許可するには、該当する各ルールセットのバイパス リストに "Repository migrations" を追加します。  このバイパスは、移行中にのみ適用されます。 完了すると、すべての新しいコントリビューションにルールセットが適用されます。

バイパスを構成するには:

1. 各エンタープライズまたは組織のルール セットに移動します。
2. \[バイパス リスト] セクションで、\[バイパスの **追加**] をクリックします。
3. **\[リポジトリの移行] を選択します**。

詳細については、「[組織内のリポジトリのルールセットを作成する](/ja/organizations/managing-organization-settings/creating-rulesets-for-repositories-in-your-organization)」および「[リポジトリ移行のルールセットのバイパス設定](/ja/enterprise-cloud@latest/migrations/troubleshooting/setting-ruleset-bypasses-for-repository-migrations)」を参照してください。

## Enable exports on GitLab

The GitLab projects you want to migrate must be enabled for exports. See [Enable project export](https://docs.gitlab.com/administration/settings/import_and_export_settings/#enable-project-export) and [Sidekiq configuration for imports](https://docs.gitlab.com/administration/sidekiq/configuration_for_imports/) in the GitLab documentation.