GitHub Enterprise Server ソースリポジトリをエクスポートする
ソースリポジトリをロックした後、1 つずつ、またはテキストファイル中のリポジトリ URL のリストを使用して一括でエクスポートできます。 そして、インポートプロセスのための単一の移行アーカイブを作成します。
Note: Locking a repository prevents users from pushing to the repository or modifying a repository's resources, like issues, labels, milestones, wikis, and comments. New teams and collaborators can't be associated with a locked repository.
If you're performing a trial run, you don't need to lock repositories. Otherwise, it's highly recommended. 詳細は「移行について」を参照してください。
-
SSH into GitHub Enterprise Server インスタンス.
$ ssh -p 122 admin@HOSTNAME -
エクスポートするリポジトリを準備するには、
ghe-migrator addコマンドをリポジトリの URL と一緒に使用します:-
リポジトリをロックする場合は、コマンドの末尾に
--lockを付けます。 トライアル実行を行う場合は、--lockは必要ありません。$ ghe-migrator add https://hostname/username/reponame --lock -
コマンドの後ろに
--exclude_attachmentsを付けると添付ファイルを除外できます。 添付ファイルは大きくなる場合があり、最終的なマイグレーションアーカイブを不必要に膨らませてしまう場合があります。 -
エクスポートする複数のリポジトリを同時に準備するには、各リポジトリ URL を 1 行ずつ記載したテキストファイルを作成し、
ghe-migrator addコマンドに-iフラグとテキストファイルのパスを付けて実行します。$ ghe-migrator add -i PATH/TO/YOUR/REPOSITORY_URLS.txt
-
-
入力を求められたら、GitHub Enterprise Server ユーザ名を入力します:
Enter username authorized for migration: admin -
個人用アクセストークンを求められたら、「GitHub Enterprise Serverソースインスタンスの準備」で作成したアクセストークンを入力します。
Enter personal access token: ************** -
ghe-migrator addが終了すると、このエクスポートと追加されたリソースのリストを識別するために生成されたユニークな"移行GUID"が出力されます。 生成されたGUIDは、後のghe-migrator add及びghe-migrator exportのステップで同じエクスポートに対して処理を続けるようghe-migratorに伝えるために使います。> 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既存の移行GUIDに対して新しいリポジトリを追加するたびに、既存のエクスポートが更新されます。 If you run
ghe-migrator addagain 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. -
ソースリポジトリをロックした場合、
ghe-migrator target_urlコマンドを使ってリポジトリの新しい場所へリンクするカスタムのロックメッセージをリポジトリのページに設定できます。 ソースリポジトリのURL、ターゲットリポジトリのURL、そしてステップ5の移行GUIDを渡してください。$ ghe-migrator target_url https://hostname/username/reponame https://target_hostname/target_username/target_reponame -g MIGRATION_GUID -
同じエクスポートにさらにリポジトリを追加するには、
ghe-migrator addコマンドに-gフラグを付けて実行します。 これで新しいリポジトリの URL とステップ 5 の移行 GUID を渡します。$ ghe-migrator add https://hostname/username/other_reponame -g MIGRATION_GUID --lock -
リポジトリを追加し終えたなら、
-gフラグとステップ5の移行GUIDと共にghe-migrator exportを使い、移行アーカイブを生成してください。$ ghe-migrator export -g MIGRATION_GUID> Archive saved to: /data/github/current/tmp/MIGRATION_GUID.tar.gz- To specify where migration files should be staged append the command with
--staging-path=/full/staging/path. Defaults to/data/user/tmp.
- To specify where migration files should be staged append the command with
-
Close the connection to GitHub Enterprise Server インスタンス:
$ exit > logout > Connection to hostname closed. -
scpコマンドを使って移行アーカイブを使用中のコンピュータにコピーしてください。 アーカイブファイルの名前には移行GUIDが含まれます。$ scp -P 122 admin@hostname:/data/github/current/tmp/MIGRATION_GUID.tar.gz ~/Desktop -
To import the archived migration data to a GitHub Enterprise Server instance, see "Importing migration data to GitHub Enterprise Server".