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 os GitHub CLI.

    • Para obter instruções de instalação para GitHub CLI, veja o repositório GitHub CLI.
    • Se você já tiver GitHub CLI instalado, execute gh --version para garantir que esteja executando a versão 2.4.0 ou mais recente. Se você tiver uma versão mais antiga, visite o GitHub CLI repositório para obter instruções de atualização.
  2. Instale os ADO2GH extension.

    Shell
    gh extension install github/gh-ado2gh
    
  3. O ADO2GH extension of the GitHub CLI é atualizado semanalmente. Para garantir que você esteja usando a última versão, atualize a extensão.

    Shell
    gh extension upgrade github/gh-ado2gh
    

Sempre que precisar de ajuda com a ADO2GH extension, use o sinalizador --help com um comando. Por exemplo, gh ado2gh --help listará todos os comandos disponíveis, e gh ado2gh migrate-repo --help listará todas as opções disponíveis para o 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. Se você estiver migrando para GitHub Enterprise Cloud com residência de dados, por conveniência, defina uma variável de ambiente para a URL de API base para sua empresa.

    Certifique-se de substituir SUBDOMAIN pelo subdomínio da sua empresa. Por exemplo, se o subdomínio da sua empresa for acme, o TARGET_API_URL valor será https://api.acme.ghe.com.

    • Se você estiver usando o Terminal, use o comando export.

      Shell
      export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
      
    • Se você estiver usando o PowerShell, use o comando $env.

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

    Você usará essa variável com a opção --target-api-url em comandos executados com o GitHub CLI.