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. Installez le GitHub CLI.

    • Pour obtenir des instructions d’installation pour GitHub CLI, consultez le dépôt GitHub CLI.
    • Si vous avez GitHub CLI déjà installé, exécutez gh --version pour vous assurer que vous exécutez la version 2.4.0 ou ultérieure. Si vous avez une version antérieure, consultez le GitHub CLI référentiel pour obtenir des instructions de mise à niveau.
  2. Installez le ADO2GH extension.

    Shell
    gh extension install github/gh-ado2gh
    
  3. La ADO2GH extension of the GitHub CLI est mise à jour chaque semaine. Pour être sûr d’utiliser la version la plus récente, mettez à jour l’extension.

    Shell
    gh extension upgrade github/gh-ado2gh
    

Dès que vous avez besoin d’aide sur ADO2GH extension, vous pouvez utiliser l’indicateur --help avec une commande. Par exemple, gh ado2gh --help liste toutes les commandes disponibles et gh ado2gh migrate-repo --help liste toutes les options disponibles pour la commande 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 vous effectuez une migration vers GitHub Enterprise Cloud avec résidence des données, par commodité, définissez une variable d’environnement pour l’URL de l’API de base pour votre entreprise.

    Vérifiez que vous remplacez SUBDOMAIN par le sous-domaine de votre entreprise. Par exemple, si le sous-domaine de votre entreprise est acme, la TARGET_API_URL valeur est https://api.acme.ghe.com.

    • Si vous utilisez le Terminal, utilisez la commande export.

      Shell
      export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
      
    • Si vous utilisez PowerShell, utilisez la commande $env.

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

    Vous allez utiliser cette variable avec l’option --target-api-url dans les commandes que vous exécutez avec le GitHub CLI.