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. GitHub CLIをインストールします。

    • GitHub CLI のインストール手順については、GitHub CLI リポジトリを参照してください。
    • GitHub CLIが既にインストールされている場合は、gh --versionを実行して、バージョン 2.4.0 以降を実行していることを確認します。 古いバージョンをお持ちの場合は、 GitHub CLI リポジトリ にアクセスしてアップグレード手順を確認してください。
  2. ADO2GH extensionをインストールします。

    Shell
    gh extension install github/gh-ado2gh
    
  3. ADO2GH extension of the GitHub CLIは毎週更新されます。 最新バージョンを確実に使うため、拡張機能を更新してください。

    Shell
    gh extension upgrade github/gh-ado2gh
    

ADO2GH extension に関するヘルプが必要なときはいつでも、コマンドで --help フラグを使用できます。 たとえば、gh ado2gh --help とすると使用可能なすべてのコマンドの一覧が表示され、gh ado2gh migrate-repo --help とすると 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. データ所在地付き GitHub Enterprise Cloudに移行する場合は、便宜上、エンタープライズのベース API URL の環境変数を設定します。

SUBDOMAINを企業のサブドメインに置き換えてください。 たとえば、企業のサブドメインが acmeされている場合、 TARGET_API_URL の値は https://api.acme.ghe.comされます。

  • ターミナルを使っている場合は、export コマンドを使います。

    Shell
    export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
    
  • PowerShell を使っている場合は、$env コマンドを使います。

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

この変数は、--target-api-urlで実行するコマンドの GitHub CLI オプションと共に使用します。