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. Los ámbitos necesarios para su GitHubpersonal access token (classic) función dependen de su rol y de la tarea que desea completar.
Nota:
Solo puedes usar un personal access token (classic), no un fine-grained personal access token. Esto significa que no puede usar GitHub Enterprise Importer si su organización usa la directiva "Restringir el acceso de personal access tokens (classic) a sus organizaciones". Para más información, consulta Imposición de políticas para tokens de acceso personales en su empresa.
| Tarea | Propietario de la organización | Responsable de la migración |
|---|---|---|
| Asignación del rol de migrador para las migraciones de repositorios | admin:org | |
| Ejecución de una migración de repositorios (organización de destino) | ||
repo, , admin:org, workflow | ||
repo, , read:org, workflow | ||
| Descarga de un registro de migración | ||
repo, , admin:org, workflow | ||
repo, , read:org, workflow | ||
| Recuperar maniquíes | ||
repo, , admin:org, workflow |
To learn how to create the token, see Administración de tokens de acceso personal.
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 Administrar las direcciones IP permitidas en tu organización or Restricción del tráfico de red a la empresa con una lista de direcciones IP permitidas.
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 (agregado el 28 de julio de 2025)
- 2a0a:a440::/29
- 2606:50c0::/32
- 20.99.172.64/28 (agregado el 28 de julio 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
Si la organización de destino o la empresa tiene conjuntos de reglas habilitados, el historial del repositorio migrado puede infringir esas reglas. Para permitir la migración sin deshabilitar los conjuntos de reglas, agregue "Migraciones de repositorio" a la lista de omisión de cada conjunto de reglas aplicable. Esta omisión solo se aplica durante la migración. Una vez completado, los conjuntos de reglas se aplicarán a todas las nuevas contribuciones.
Para configurar la omisión:
- Vaya a cada conjunto de reglas de la empresa u organización.
- En la sección "Lista de exclusión", haga clic en Agregar exclusión.
- Seleccione Migraciones de repositorio.
Para obtener más información, vea Creación de conjuntos de reglas para repositorios de la organización y Configuración de excepciones de reglas para migraciones de repositorio.
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.