Skip to content

Commit ef7d0f4

Browse files
boylejjCopilotdpmex4527isaacmbrown
authored
Update migration docs to include guidance for using GitHub owned blob storage (#57122)
Co-authored-by: Copilot <[email protected]> Co-authored-by: Daniel Perez <[email protected]> Co-authored-by: Isaac Brown <[email protected]> Co-authored-by: isaacmbrown <[email protected]>
1 parent f1356d1 commit ef7d0f4

File tree

5 files changed

+129
-13
lines changed

5 files changed

+129
-13
lines changed

content/migrations/using-github-enterprise-importer/migrating-between-github-products/migrating-repositories-from-github-enterprise-server-to-github-enterprise-cloud.md

Lines changed: 107 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,41 @@ To migrate your repositories from {% data variables.product.prodname_ghe_server
6969

7070
## Step 3: Set up blob storage
7171

72-
{% data reusables.enterprise-migration-tool.blob-storage-intro %}
72+
When performing a repository migration, you must store your repository data in a place that {% data variables.product.prodname_importer_proper_name %} can access. This can be accomplished by:
73+
74+
* Using local storage on the GHES instance (GHES **3.16** and later)
75+
* Using a blob storage provider
76+
77+
### Using local storage (GHES 3.16+)
78+
79+
{% data reusables.enterprise-migration-tool.local-storage-steps %}
80+
81+
### Using a blob storage provider
82+
83+
If your {% data variables.product.prodname_ghe_server %} instance is behind a firewall, you may need to set up blob storage with an external cloud service.
84+
85+
First, you must set up blob storage with a supported provider. Then, if you're using a cloud provider, you must configure your credentials for the storage provider in the {% data variables.enterprise.management_console %} or {% data variables.product.prodname_cli %}.
86+
87+
{% data reusables.enterprise-migration-tool.supported-blob-storage-providers %}
7388

7489
> [!NOTE]
7590
> You only need to configure blob storage if you use {% data variables.product.prodname_ghe_server %} versions 3.8 or higher. If you use {% data variables.product.prodname_ghe_server %} versions 3.7 or lower, skip to [Step 4: Set up a migration source in {% data variables.product.prodname_ghe_cloud %}](#step-4-set-up-a-migration-source-in-github-enterprise-cloud).
7691
>
7792
> Blob storage is required to migrate repositories with large Git source or metadata. If you use {% data variables.product.prodname_ghe_server %} versions 3.7 or lower, you will not be able to perform migrations where your Git source or metadata exports exceed 2GB. To perform these migrations, update to {% data variables.product.prodname_ghe_server %} versions 3.8 or higher.
7893
79-
### Setting up an AWS S3 storage bucket
94+
#### Setting up an AWS S3 storage bucket
8095

8196
{% data reusables.enterprise-migration-tool.set-up-aws-bucket %}
8297

83-
### Setting up an Azure Blob Storage account
98+
#### Setting up an Azure Blob Storage account
8499

85100
{% data reusables.enterprise-migration-tool.set-up-azure-storage-account %}
86101

87-
### Using local storage (GHES 3.16+)
88-
89-
{% data reusables.enterprise-migration-tool.local-storage-steps %}
90-
91-
### Configuring blob storage in the {% data variables.enterprise.management_console %} of {% data variables.location.product_location_enterprise %}
102+
#### Configuring blob storage in the {% data variables.enterprise.management_console %} of {% data variables.location.product_location_enterprise %}
92103

93104
{% data reusables.enterprise-migration-tool.blob-storage-management-console %}
94105

95-
### Allowing network access
106+
#### Allowing network access
96107

97108
If you have configured firewall rules on your storage account, ensure you have allowed access to the IP ranges for your migration destination. See [AUTOTITLE](/migrations/using-github-enterprise-importer/migrating-between-github-products/managing-access-for-a-migration-between-github-products#configuring-ip-allow-lists-for-migrations).
98109

@@ -239,6 +250,78 @@ If you're using {% data variables.product.prodname_ghe_server %} 3.8 or higher,
239250

240251
You may need to allowlist {% data variables.product.company_short %}'s IP ranges. For more information, see [AUTOTITLE](/migrations/using-github-enterprise-importer/migrating-between-github-products/managing-access-for-a-migration-between-github-products#configuring-ip-allow-lists-for-migrations).
241252

253+
### Uploading your migration archives to {% data variables.product.prodname_ghos %}
254+
255+
> [!NOTE]
256+
> Repository migrations with {% data variables.product.prodname_ghos %} are currently in {% data variables.release-phases.public_preview %} and subject to change.
257+
258+
If you're using {% data variables.product.prodname_ghos %}, you will upload your archive to {% data variables.product.prodname_ghos %} using the following process:
259+
260+
1. Create a multipart upload by submitting a POST request
261+
1. Upload archive in multiple parts up to 100MB in size as PATCH requests
262+
1. Submit a PUT request to complete the upload
263+
264+
#### 1. Create the multipart upload
265+
266+
You will submit a POST request to:
267+
268+
```http
269+
https://uploads.github.com/organizations/{organization_id}/gei/archive/blobs/uploads
270+
```
271+
272+
Include a JSON body like below with the archive name and size. The content type can remain as `"application/octet-stream"` for all uploads.
273+
274+
```json
275+
{
276+
"content_type": "application/octet-stream",
277+
"name": "git-archive.tar.gz",
278+
"size": 262144000
279+
}
280+
```
281+
282+
This will return a JSON object response as follows:
283+
284+
```json
285+
{
286+
"guid": "363b2659-b8a3-4878-bfff-eed4bcb54d35",
287+
"node_id": "MA_kgDaACQzNjNiMjY1OS1iOGEzLTQ4NzgtYmZmZi1lZWQ0YmNiNTRkMzU",
288+
"name": "git-archive.tar.gz",
289+
"size": 33287,
290+
"uri": "gei://archive/363b2659-b8a3-4878-bfff-eed4bcb54d35",
291+
"created_at": "2024-11-13T12:35:45.761-08:00"
292+
}
293+
```
294+
295+
This URI represents the uploaded archive, and will be used to enqueue migration when you start your repository migration. The response will also include the location in the response header used to upload file parts using a PATCH request in the next step:
296+
297+
```http
298+
/organizations/{organization_id}/gei/archive/blobs/uploads?part_number=1&guid=<guid>&upload_id=<upload_id>
299+
```
300+
301+
#### 2. Upload the archive in multiple parts
302+
303+
Upload up to 100 MB of your file in each part with a PATCH request using the location from the previous response header, ensuring that the raw data is uploaded in the request body without using a multipart form. If the final part of your file is less than 100 MB, upload only the remaining bytes in that last request:
304+
305+
```http
306+
https://uploads.github.com/{location}
307+
```
308+
309+
This will return an empty response body with the following location in the response header:
310+
311+
```http
312+
/organizations/{organization_id}/gei/archive/blobs/uploads?part_number=2&guid=<guid>&upload_id=<upload_id>
313+
```
314+
315+
Repeat this until the upload is complete. Ensure that you are reading up to 100 MB of the file at a time, and submitting requests to the new location values with the incremented `part_number` values.
316+
317+
#### 3. Complete the upload
318+
319+
Submit a PUT request to the "last path" value from the previous step with an empty body and your upload to GitHub-owned storage is complete. The GEI URI can be constructed with the GUID from this initial POST request in the following format:
320+
321+
```http
322+
gei://archive/{guid}
323+
```
324+
242325
## Step 7: Start your repository migration
243326

244327
{% data reusables.enterprise-migration-tool.start-repository-migration-ec %}
@@ -328,6 +411,19 @@ For {% data variables.product.pat_generic %} requirements, see [AUTOTITLE](/migr
328411

329412
## Step 4: Set up blob storage
330413

414+
### Migrating repositories with {% data variables.product.prodname_ghos %}
415+
416+
> [!NOTE]
417+
> Repository migrations with {% data variables.product.prodname_ghos %} are currently in {% data variables.release-phases.public_preview %} and subject to change.
418+
419+
If you do not want to set up and provide {% data variables.product.prodname_importer_proper_name %} with access to a customer-owned blob storage account for storing your repository archives, you can migrate repositories using {% data variables.product.prodname_ghos %}. To do so, you must be running v1.9.0 (or higher) of {% data variables.product.prodname_gei_cli %}. {% data variables.product.prodname_ghos %} does not require additional setup and is available as an option when you run {% data variables.product.prodname_gei_cli %} commands.
420+
421+
For security purposes, {% data variables.product.prodname_ghos %} is explicitly write-only, and downloads from {% data variables.product.prodname_ghos %} are not possible. After a migration is complete, the repository archives are immediately deleted. If an archive is uploaded and not used in a migration, the archive is deleted after 7 days.
422+
423+
When you use the CLI flag for {% data variables.product.prodname_ghos %}, the repository archive is automatically exported to the destination configured in the Management Console, uploaded to GitHub-owned storage, and imported to your migration destination. When using {% data variables.product.prodname_ghos %} we recommend configuring local storage. See [Using local storage (GHES 3.16+)](#using-local-storage-ghes-316-1).
424+
425+
### Migrating repositories with customer-owned blob storage
426+
331427
{% data reusables.enterprise-migration-tool.blob-storage-intro %}
332428

333429
### Setting up an AWS S3 storage bucket
@@ -419,6 +515,7 @@ gh gei generate-script --github-source-org SOURCE \
419515
| `--target-api-url TARGET-API-URL` | {% data reusables.enterprise-migration-tool.add-target-api-url %} |
420516
| `--no-ssl-verify` | {% data reusables.enterprise-migration-tool.ssl-flag %} |
421517
| `--download-migration-logs` | Download the migration log for each migrated repository. For more information about migration logs, see [AUTOTITLE](/migrations/using-github-enterprise-importer/completing-your-migration-with-github-enterprise-importer/accessing-your-migration-logs-for-github-enterprise-importer#downloading-all-migration-logs-for-an-organization). |
518+
| `--use-github-storage`| Perform a repository migration using {% data variables.product.prodname_ghos %} as the intermediate blob storage solution. |
422519

423520
### Reviewing the migration script
424521

@@ -495,6 +592,7 @@ gh gei migrate-repo --github-source-org SOURCE --source-repo CURRENT-NAME --gith
495592
| `--no-ssl-verify` | {% data reusables.enterprise-migration-tool.ssl-flag %} |
496593
| `--skip-releases` | {% data reusables.enterprise-migration-tool.skip-releases %} |
497594
| `--target-repo-visibility TARGET-VISIBILITY` | {% data reusables.enterprise-migration-tool.set-repository-visibility %} |
595+
| `--use-github-storage`| Perform a repository migration using {% data variables.product.prodname_ghos %} as the intermediate blob storage solution. |
498596

499597
#### Aborting the migration
500598

content/migrations/using-github-enterprise-importer/migrating-from-bitbucket-server-to-github-enterprise-cloud/migrating-repositories-from-bitbucket-server-to-github-enterprise-cloud.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ You will first generate an archive of the data you want to migrate and push the
9494
9595
Before you can run a migration, you need to set up a storage container with your chosen cloud provider to store your data.
9696
97+
### Using {% data variables.product.prodname_ghos %}
98+
99+
> [!NOTE]
100+
> Repository migrations with {% data variables.product.prodname_ghos %} are currently in {% data variables.release-phases.public_preview %} and subject to change.
101+
102+
If you do not want to set up and provide {% data variables.product.prodname_importer_proper_name %} with access to a blob storage account behind your firewall, you can migrate repositories with {% data variables.product.prodname_ghos %} using the `--use-github-storage` flag. To do so, you must be running v1.9.0 (or higher) of {% data variables.product.prodname_bbs2gh_cli %}.
103+
104+
For security purposes, {% data variables.product.prodname_ghos %} is explicitly write-only, and downloads from {% data variables.product.prodname_ghos %} are not possible. After a migration is complete, the repository archives are immediately deleted. If an archive is uploaded and not used in a migration, the archive is deleted after 7 days.
105+
97106
### Setting up an AWS S3 storage bucket
98107
99108
{% data reusables.enterprise-migration-tool.set-up-aws-bucket %}
@@ -143,10 +152,12 @@ gh bbs2gh migrate-repo --bbs-server-url BBS-SERVER-URL \
143152
--ssh-user SSH-USER --ssh-private-key PATH-TO-KEY
144153
# If your Bitbucket Server instance runs on Windows:
145154
--smb-user SMB-USER
146-
# If you're using AWS S3 as your blob storage provider:
155+
# If you are using AWS S3 as your blob storage provider:
147156
--aws-bucket-name AWS-BUCKET-NAME
148157
# If you are running a Bitbucket Data Center cluster or your Bitbucket Server is behind a load balancer:
149158
--archive-download-host ARCHIVE-DOWNLOAD-HOST
159+
# If you are using GitHub owned blob storage:
160+
--use-github-storage
150161
```
151162
152163
{% data reusables.enterprise-migration-tool.placeholder-table %}
@@ -208,7 +219,7 @@ gh bbs2gh migrate-repo --archive-path ARCHIVE-PATH \
208219
--bbs-server-url BBS-SERVER-URL \
209220
--bbs-project PROJECT \
210221
--bbs-repo CURRENT-NAME \
211-
# If you're using AWS S3 as your blob storage provider:
222+
# If you are using AWS S3 as your blob storage provider:
212223
--aws-bucket-name AWS-BUCKET-NAME
213224
# If you are migrating to {% data variables.enterprise.data_residency_site %}:
214225
--target-api-url TARGET-API-URL
@@ -258,6 +269,8 @@ gh bbs2gh generate-script --bbs-server-url BBS-SERVER-URL \
258269
--smb-user SMB-USER
259270
# If you are running a Bitbucket Data Center cluster or your Bitbucket Server is behind a load balancer:
260271
--archive-download-host ARCHIVE-DOWNLOAD-HOST
272+
# If you are using GitHub owned blob storage:
273+
--use-github-storage
261274
```
262275

263276
{% data reusables.enterprise-migration-tool.download-migration-logs-flag %}

data/reusables/enterprise-migration-tool/blob-storage-intro.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ You must store your repository data in a place that {% data variables.product.pr
33
First, you must set up blob storage with a supported provider. Then, if you're using a cloud provider, you must configure your credentials for the storage provider in the {% data variables.enterprise.management_console %} or {% data variables.product.prodname_cli %}.
44

55
{% data reusables.enterprise-migration-tool.supported-blob-storage-providers %}
6-
* Local storage on the GHES instance (GHES **3.16** and later)
6+
7+
* Local storage on the GHES instance (GHES **3.16** and later). We recommend using this option with {% data variables.product.prodname_ghos %}.

data/reusables/enterprise-migration-tool/local-storage-steps.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
When you run a migration with local storage, archive data is written to the disk on {% data variables.location.product_location_enterprise %}, without the need for a cloud storage provider. {% data variables.product.prodname_importer_proper_name %} will automatically retrieve the stored archive from {% data variables.product.prodname_ghe_server %}, unless you have blocked egress traffic from {% data variables.product.prodname_ghe_server %}.
1+
When you run a migration with local storage, archive data is written to the disk on {% data variables.location.product_location_enterprise %}, without the need for a cloud storage provider.
2+
3+
* If you do not have firewall rules blocking egress traffic from {% data variables.product.prodname_ghe_server %}, {% data variables.product.prodname_importer_proper_name %} can automatically retrieve the stored archive from {% data variables.product.prodname_ghe_server %}.
4+
* If you do have firewall rules in place and don't want to allow access to {% data variables.product.prodname_importer_proper_name %}, you can upload your archive data to {% data variables.product.prodname_ghos %} for {% data variables.product.prodname_importer_proper_name %} to access. To do so manually, see [Uploading your migration archives to GitHub-owned blob storage](/migrations/using-github-enterprise-importer/migrating-between-github-products/migrating-repositories-from-github-enterprise-server-to-github-enterprise-cloud?tool=api#uploading-your-migration-archives-to-github-owned-blob-storage) in the API version of this article.
25

36
1. From an administrative account on {% data variables.product.prodname_ghe_server %}, in the upper-right corner of any page, click {% octicon "rocket" aria-label="Site admin" %}.
47
{% data reusables.enterprise_site_admin_settings.management-console %}

data/variables/product.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ prodname_ado2gh_cli_short: ADO2GH extension
5151
prodname_bbs2gh: BBS2GH
5252
prodname_bbs2gh_cli: BBS2GH extension of the GitHub CLI
5353
prodname_bbs2gh_cli_short: BBS2GH extension
54+
prodname_ghos: GitHub-owned blob storage
5455

5556
# GitHub Education
5657
prodname_education: 'GitHub Education'

0 commit comments

Comments
 (0)