Step 1: Install the GL2GH 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 GL2GH extension.
-
Install the GitHub CLI.
- GitHub CLI のインストール手順については、GitHub CLI リポジトリを参照してください。
- If you already have GitHub CLI installed, run
gh --versionto ensure you're running version 2.4.0 or newer. If you have an older version, visit the GitHub CLI repository for upgrade instructions.
-
Install the GL2GH extension.
Shell gh extension install github/gh-gl2gh
gh extension install github/gh-gl2gh -
The GL2GH extension of the GitHub CLI is updated frequently. 最新バージョンを確実に使うため、拡張機能を更新してください。
Shell gh extension upgrade github/gh-gl2gh
gh extension upgrade github/gh-gl2gh
Step 2: Set environment variables
Before you can use the GL2GH extension to migrate to GitHub Enterprise Cloud, you must create personal access tokens that can access the source and destination, then set the personal access tokens as environment variables.
-
Make sure you have your personal access tokens for both GitHub and GitLab ready. See Manage access for a migration from GitLab to GitHub if you haven't already created a token.
-
Set environment variables for the personal access tokens, replacing TOKEN in the commands below with the personal access tokens you previously created. Use
GH_PATfor the destination organization andGITLAB_PATfor the source GitLab instance.-
If you're using Terminal, use the
exportcommand.Shell export GH_PAT="TOKEN" export GITLAB_PAT="TOKEN"
export GH_PAT="TOKEN" export GITLAB_PAT="TOKEN" -
If you're using PowerShell, use the
$envcommand.Shell $env:GH_PAT="TOKEN" $env:GITLAB_PAT="TOKEN"
$env:GH_PAT="TOKEN" $env:GITLAB_PAT="TOKEN"
-
-
データ所在地付き 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"
export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com" -
PowerShell を使っている場合は、
$envコマンドを使います。Shell $env:TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
$env:TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
この変数は、--target-api-urlで実行するコマンドの GitHub CLI オプションと共に使用します。