Skip to main content

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.

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. Os escopos necessários para sua GitHubpersonal access token (classic) função dependem da função e da tarefa que você deseja concluir.

Observação

Você só pode usar um personal access token (classic), não um fine-grained personal access token. Isso significa que você não poderá usar GitHub Enterprise Importer se sua organização usar a política "Restringir personal access tokens (classic) o acesso às suas organizações". Para saber mais, confira Como impor políticas para tokens de acesso pessoal na empresa.

TarefaProprietário da organizaçãoMigrador
Como atribuir a função de migrador para migrações de repositórioadmin:org
Como executar uma migração de repositório (organização de destino)
repo, admin:org, workflow
repo, read:org, workflow
Como baixar um log de migração
repo, admin:org, workflow
repo, read:org, workflow
Como recuperar manequins
repo, admin:org, workflow

To learn how to create the token, see Gerenciar seus tokens de acesso pessoal.

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 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 Gerenciar endereços IP permitidos para sua organização or Como restringir o tráfego de rede para sua empresa com uma lista de permissões de IP.

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 (adicionado em 28 de julho de 2025)
  • 2a0a:a440::/29
  • 2606:50c0::/32
  • 20.99.172.64/28 (adicionado em 28 de julho de 2025)

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

Se a organização de destino ou a empresa tiver conjuntos de regras habilitados, o histórico do repositório migrado poderá violar essas regras. Para permitir a migração sem desabilitar seus conjuntos de regras, adicione "Migrações de repositório" à lista de bypass para cada conjunto de regras aplicável. Esse bypass se aplica somente durante a migração. Após a conclusão, os conjuntos de regras serão aplicados em todas as novas contribuições.

Para configurar o bypass:

  1. Navegue até cada conjunto de regras da empresa ou da organização.
  2. Na seção "Lista de bypass", clique em Adicionar bypass.
  3. Selecione migrações de repositório.

Para obter mais informações, consulte Criar conjuntos de regras para repositórios na sua organização e Configuração de exceções de regras para migrações de repositório.

Enable exports on GitLab

The GitLab projects you want to migrate must be enabled for exports. See Enable project export and Sidekiq configuration for imports in the GitLab documentation.