Skip to main 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. Installieren Sie GitHub CLI.

    • Installationsanweisungen für GitHub CLI findest du im GitHub CLI-Repository.
    • Wenn Sie GitHub CLI bereits installiert haben, führen Sie gh --version aus, um zu bestätigen, dass Sie Version 2.4.0 oder höher verwenden. Wenn Sie über eine ältere Version verfügen, besuchen Sie das GitHub CLI Repository , um Upgradeanweisungen zu erhalten.
  2. Installieren Sie ADO2GH extension.

    Shell
    gh extension install github/gh-ado2gh
    
  3. Die ADO2GH extension of the GitHub CLI wird wöchentlich aktualisiert. Aktualisieren die Erweiterung, um sicherzustellen, dass du die neueste Version verwendest.

    Shell
    gh extension upgrade github/gh-ado2gh
    

Wenn du Hilfe zur ADO2GH extension benötigst, kannst du immer das Flag --help mit einem Befehl verwenden. Mit gh ado2gh --help listest du z. B. alle verfügbaren Befehle auf, und mit gh ado2gh migrate-repo --help zeigst du alle Optionen an, die für den Befehl migrate-repo verfügbar sind.

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. Wenn Sie auf GitHub Enterprise-Cloud mit Datenresidenz migrieren, legen Sie zur Vereinfachung eine Umgebungsvariable für die Basis-API-URL für Ihr Unternehmen fest.

    Stellen Sie sicher, dass Sie SUBDOMAIN durch die Unterdomäne Ihres Unternehmens ersetzen. Wenn die Unterdomäne Ihres Unternehmens beispielsweise "acme" lautet, wäre der Wert von "TARGET_API_URL" "https://api.acme.ghe.com".

    • Wenn du ein Terminal verwendest, führe den Befehl export aus.

      Shell
      export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
      
    • Wenn du PowerShell verwendest, führe den Befehl $env aus.

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

    Sie verwenden diese Variable mit der --target-api-url-Option in Befehlen, die Sie mit der GitHub CLI ausführen.