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

Migrating data to GitHub Enterprise Server

After generating a migration archive, you can import the data to your target GitHub Enterprise Server instance. You'll be able to review changes for potential conflicts before permanently applying the changes to your target instance.

Applying the imported data on GitHub Enterprise Server

Before you can migrate data to your GitHub Enterprise Server, you must prepare the data and resolve any conflicts. For more information, see "GitHub Enterprise Server へのデータ移行の準備."

After you prepare the data and resolve conflicts, you can apply the imported data on GitHub Enterprise Server.

  1. サイト管理者として、ターゲットの GitHub Enterprise Server インスタンスに SSH で接続します

    $ ssh -p 122 admin@HOSTNAME
  2. Using the ghe-migrator import command, start the import process. You'll need:

    $ ghe-migrator import /home/admin/MIGRATION-GUID.tar.gz -g MIGRATION-GUID -u USERNAME -p TOKEN
    
    > Starting GitHub::Migrator
    > Import 100% complete /
    • 移行ファイルをステージングする場所を指定するには、--staging-path=/full/staging/path を使用してコマンドを追加します。 既定値は /data/user/tmp です。

Reviewing migration data

By default, ghe-migrator audit returns every record. It also allows you to filter records by:

  • The types of records.
  • The state of the records.

The record types match those found in the migrated data.

Record type filters

Record typeFilter name
Usersuser
Organizationsorganization
Repositoriesrepository
Teamsteam
Milestonesmilestone
Project boardsproject
Issuesissue
Issue commentsissue_comment
Pull requestspull_request
Pull request reviewspull_request_review
Commit commentscommit_comment
Pull request review commentspull_request_review_comment
Releasesrelease
Actions taken on pull requests or issuesissue_event
Protected branchesprotected_branch

Record state filters

Record stateDescription
exportThe record will be exported.
importThe record will be imported.
mapThe record will be mapped.
renameThe record will be renamed.
mergeThe record will be merged.
exportedThe record was successfully exported.
importedThe record was successfully imported.
mappedThe record was successfully mapped.
renamedThe record was successfully renamed.
mergedThe record was successfully merged.
failed_exportThe record failed to export.
failed_importThe record failed to be imported.
failed_mapThe record failed to be mapped.
failed_renameThe record failed to be renamed.
failed_mergeThe record failed to be merged.

Filtering audited records

With the ghe-migrator audit command, you can filter based on the record type using the -m flag. Similarly, you can filter on the import state using the -s flag. The command looks like this:

$ ghe-migrator audit -m RECORD_TYPE -s STATE -g MIGRATION-GUID

For example, to view every successfully imported organization and team, you would enter:

$ ghe-migrator audit -m organization,team -s mapped,renamed -g MIGRATION-GUID
> model_name,source_url,target_url,state
> organization,https://gh.source/octo-org/,https://ghe.target/octo-org/,renamed

We strongly recommend auditing every import that failed. To do that, you will enter:

$ ghe-migrator audit -s failed_import,failed_map,failed_rename,failed_merge -g MIGRATION-GUID
> model_name,source_url,target_url,state
> user,https://gh.source/octocat,https://gh.target/octocat,failed
> repository,https://gh.source/octo-org/octo-project,https://ghe.target/octo-org/octo-project,failed

If you have any concerns about failed imports, contact GitHub Enterprise サポート.

Completing the import on GitHub Enterprise Server

After your migration is applied to your target instance and you have reviewed the migration, you''ll unlock the repositories and delete them off the source. Before deleting your source data we recommend waiting around two weeks to ensure that everything is functioning as expected.

Unlocking repositories on the target instance

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

    $ ssh -p 122 admin@HOSTNAME
  2. ghe-migrator unlock コマンドを使用して、インポートされたすべてのリポジトリのロックを解除します。 移行GUIDが必要になります。

    $ ghe-migrator unlock -g MIGRATION-GUID
    > Unlocked octo-org/octo-project

Unlocking repositories on the source

Unlocking repositories from an organization on GitHub.com

To unlock the repositories on a GitHub.com organization, you'll send a DELETE request to the migration unlock endpoint. You'll need:

  • Your access token for authentication
  • The unique id of the migration
  • The name of the repository to unlock
curl -H "Authorization: Bearer GITHUB_ACCESS_TOKEN" -X DELETE \
  -H "Accept: application/vnd.github.wyandotte-preview+json" \
  https://api.github.com/orgs/ORG-NAME/migrations/ID/repos/REPO_NAME/lock

Deleting repositories from an organization on GitHub.com

After unlocking the GitHub.com organization's repositories, you should delete every repository you previously migrated using the repository delete endpoint. You'll need your access token for authentication:

curl -H "Authorization: Bearer GITHUB_ACCESS_TOKEN" -X DELETE \
  https://api.github.com/repos/ORG-NAME/REPO_NAME

Unlocking repositories from a GitHub Enterprise Server instance

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

    $ ssh -p 122 admin@HOSTNAME
  2. ghe-migrator unlock コマンドを使用して、インポートされたすべてのリポジトリのロックを解除します。 移行GUIDが必要になります。

    $ ghe-migrator unlock -g MIGRATION-GUID
    > Unlocked octo-org/octo-project