Skip to main content
Skip to content

Install and configure GitHub Enterprise Importer

Install the ADO2GH extension of the GitHub CLI and configure your environment for the migration.

Step 1: Install the ADO2GH extension of the GitHub CLI

GitHub Enterprise Importer is a collection of extensions for GitHub CLI. If this is your first migration, you'll need to install GitHub CLI and the ADO2GH extension.

  1. Instale los GitHub CLI.

    • A fin de obtener instrucciones de instalación para GitHub CLI, vea el repositorio de GitHub CLI.
    • Si ya tiene GitHub CLI instalado, ejecute gh --version para asegurarse de que está ejecutando la versión 2.4.0 o posterior. Si tiene una versión anterior, visite el GitHub CLI repositorio para obtener instrucciones de actualización.
  2. Instale los ADO2GH extension.

    Shell
    gh extension install github/gh-ado2gh
    
  3. ADO2GH extension of the GitHub CLI se actualiza semanalmente. Para asegurarte de que usas la versión más reciente, actualiza la extensión.

    Shell
    gh extension upgrade github/gh-ado2gh
    

Cada vez que necesites ayuda con ADO2GH extension, puedes usar la marca --help con un comando. Por ejemplo, gh ado2gh --help enumerará todos los comandos disponibles y gh ado2gh migrate-repo --help todas las opciones disponibles para el comando migrate-repo.

Step 2: Set environment variables

Before you can use the ADO2GH extension to migrate to GitHub Enterprise Cloud, you must create personal access tokens that can access the source and destination organizations, then set the personal access tokens as environment variables.

  1. Make sure you have your personal access tokens for both GitHub and Azure DevOps ready. See Manage access if you haven't already created a token.

  2. Set environment variables for the personal access tokens, replacing TOKEN in the commands below with the personal access tokens you previously created. Use GH_PAT for the destination organization and ADO_PAT for the source organization.

    • If you're using Terminal, use the export command.

      Shell
      export GH_PAT="TOKEN"
      export ADO_PAT="TOKEN"
      
    • If you're using PowerShell, use the $env command.

      Shell
      $env:GH_PAT="TOKEN"
      $env:ADO_PAT="TOKEN"
      
  3. Si va a migrar a Nube de GitHub Enterprise con residencia de datos, para mayor comodidad, establezca una variable de entorno para la dirección URL de API base para la empresa.

    Asegúrese de reemplazar SUBDOMAIN por el subdominio de la empresa. Por ejemplo, si el subdominio de la empresa es acme, el TARGET_API_URL valor sería https://api.acme.ghe.com.

    • Si usas Terminal, utiliza el comando export.

      Shell
      export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
      
    • Si usas PowerShell, utiliza el comando $env.

      Shell
      $env:TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
      

    Usarás esta variable con la opción --target-api-url en los comandos que ejecutes con la opción GitHub CLI.