Skip to main content
ドキュメントへの更新が頻繁に発行されており、このページの翻訳はまだ行われている場合があります。 最新の情報については、「英語のドキュメント」を参照してください。

Exporting migration data from GitHub Enterprise Server

To change platforms or move from a trial instance to a production instance, you can export migration data from a GitHub Enterprise Server instance by preparing the instance, locking the repositories, and generating a migration archive.

Preparing the GitHub Enterprise Server source instance

  1. Verify that you are a site administrator on the GitHub Enterprise Server source. The best way to do this is to verify that you can SSH into the instance.

  2. repo および admin:org スコープを使用してアクセス トークンを生成する on the GitHub Enterprise Server source instance.

  3. ダウンタイムを最小化するには、ソースインスタンスからエクスポートしたいリポジトリのリストを作成してください。 各行にそれぞれのリポジトリのURLをリストアップしたテキストファイルを使えば、複数のリポジトリをエクスポートに一度に追加できます。

Exporting the GitHub Enterprise Server source repositories

注: リポジトリをロックすると、リポジトリへのすべての書き込みアクセスができなくなります。 ロックされたリポジトリには、新しいTeamやコラボレータを関連づけることはできません。

トライアル実行をしているなら、リポジトリをロックする必要はありません。 使用中のリポジトリからデータを移行する場合、GitHub はリポジトリをロックすることを強くお勧めします。 詳しくは、「ghe-migrator について」を参照してください。

  1. お使いの GitHub Enterprise Server インスタンス に SSH で接続します。 インスタンスが複数のノードで構成されている場合は (高可用性や geo レプリケーションが構成されている場合など)、プライマリ ノードに SSH 接続します。 クラスターを使用する場合は、任意のノードに SSH 接続できます。 SSH アクセスについて詳しくは、「管理シェル (SSH) にアクセスする」をご覧ください。

    $ ssh -p 122 admin@HOSTNAME
  2. To prepare a repository for export, use the ghe-migrator add command with the repository's URL:

    • If you're locking the repository, append the command with --lock. If you're performing a trial run, --lock is not needed.
      $ ghe-migrator add https://HOSTNAME/USERNAME/REPO-NAME --lock
    • You can exclude file attachments by appending --exclude_attachments to the command. 添付ファイルは大きくなる場合があり、最終的なマイグレーションアーカイブを不必要に膨らませてしまう場合があります。
    • To prepare multiple repositories at once for export, create a text file listing each repository URL on a separate line, and run the ghe-migrator add command with the -i flag and the path to your text file.
      $ ghe-migrator add -i PATH/TO/YOUR/REPOSITORY_URL.txt
  3. When prompted, enter your GitHub Enterprise Server username:

    Enter username authorized for migration:  admin
  4. When prompted for a personal access token, enter the access token you created in "Preparing the GitHub Enterprise Server source instance":

    Enter personal access token:  **************
  5. When ghe-migrator add has finished it will print the unique "Migration GUID" that it generated to identify this export as well as a list of the resources that were added to the export. You will use the Migration GUID that it generated in subsequent ghe-migrator add and ghe-migrator export steps to tell ghe-migrator to continue operating on the same export.

    > 101 models added to export
    > Migration GUID: EXAMPLE-MIGRATION-GUID
    > Number of records in this migration:
    > users                        |  5
    > organizations                |  1
    > repositories                 |  1
    > teams                        |  3
    > protected_branches           |  1
    > pull_request_reviews         |  1
    > milestones                   |  1
    > issues                       |  3
    > pull_requests                |  5
    > pull_request_review_comments |  4
    > commit_comments              |  2
    > issue_comments               | 10
    > issue_events                 | 63
    > releases                     |  3
    > attachments                  |  4
    > projects                     |  2

    Each time you add a new repository with an existing Migration GUID it will update the existing export. If you run ghe-migrator add again without a Migration GUID it will start a new export and generate a new Migration GUID. Do not re-use the Migration GUID generated during an export when you start preparing your migration for import.

  6. To add more repositories to the same export, use the ghe-migrator add command with the -g flag. You'll pass in the new repository URL and the Migration GUID from Step 5:

    $ ghe-migrator add https://HOSTNAME/USERNAME/OTHER-REPO-NAME -g MIGRATION-GUID --lock
  7. When you've finished adding repositories, generate the migration archive using the ghe-migrator export command with the -g flag and the Migration GUID from Step 5:

    $ ghe-migrator export -g MIGRATION-GUID
    > Archive saved to: /data/github/current/tmp/MIGRATION-GUID.tar.gz
    • 移行ファイルをステージングする場所を指定するには、--staging-path=/full/staging/path を使用してコマンドを追加します。 既定値は /data/user/tmp です。
  8. Close the connection to お使いの GitHub Enterprise Server インスタンス:

    $ exit
    > logout
    > Connection to HOSTNAME closed.
  9. Copy the migration archive to your computer using the scp command. The archive file will be named with the Migration GUID:

    $ scp -P 122 admin@HOSTNAME:/data/github/current/tmp/MIGRATION-GUID.tar.gz ~/Desktop
  10. GitHub Enterprise Server インスタンスにインポートするためにアーカイブされた移行データを準備するには、「GitHub Enterprise Server へのデータ移行の準備」を参照してください。