# Configure blob storage

Archives from GitLab need to be temporarily stored so GitHub can read them.

For most customers, we recommend storing archives with GitHub-owned blob storage. This is the simplest path and does not require any extra configuration.

However, you may want to configure storage with an external provider if you have firewall requirements or need to retain archives after the migration is complete.

## Choosing where to stage archives

The GL2GH extension exports each GitLab project to an archive, then uploads the archive to blob storage that GitHub can read from. You choose the storage backend when you run a migration.

| Storage option                          | How to select it                                                                                                                                        | Notes                                                                                                                             |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| GitHub-owned blob storage (recommended) | `--use-github-storage`                                                                                                                                  | No setup required. GitHub deletes the archive automatically after a successful migration, or seven days after a failed migration. |
| AWS S3                                  | `--aws-bucket-name` (with the `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY` environment variables, and optionally `AWS_SESSION_TOKEN`) | You own the bucket and its lifecycle. GitHub does not delete archives from your storage.                                          |
| Azure Blob Storage                      | `AZURE_STORAGE_CONNECTION_STRING` environment variable (for a single `migrate-repo` command, you can instead use `--azure-storage-connection-string`)   | Only storage-account access-key connection strings are supported (not SAS). GitHub does not delete archives from your storage.    |

## Configuring blob storage

If you are using GitHub-owned blob storage, you do not need to configure anything. You will use the `--use-github-storage` flag to select this method with the CLI. However, you may want to set the `GITHUB_OWNED_STORAGE_MULTIPART_MEBIBYTES` variable (default 100 MiB, minimum 5 MiB) to a lower number if you have a slow or proxied connection.

If you are using external blob storage, you will need to set this up.

### Setting up an AWS S3 storage bucket

AWS で、S3 バケットを設定します。 詳しくは、AWS のドキュメント「[バケットの作成](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)」をご覧ください。

次のアクセス許可を持つ AWS アクセス キーと秘密鍵も必要です。

```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:ListBucketMultipartUploads",
                "s3:AbortMultipartUpload",
                "s3:ListBucket",
                "s3:DeleteObject",
                "s3:ListMultipartUploadParts"
            ],
            "Resource": [
                "arn:aws:s3:::github-migration-bucket",
                "arn:aws:s3:::github-migration-bucket/*"
            ]
        }
    ]
}
```

> \[!NOTE]
> GitHub Enterprise Importer は、移行の完了後に AWS からアーカイブを削除しません。 ストレージ コストを減らすため、一定期間後にアーカイブが自動削除されるよう構成することをお勧めします。 詳しくは、AWS のドキュメントの「[バケットのライフサイクル設定の指定](https://docs.aws.amazon.com/AmazonS3/latest/userguide/how-to-set-lifecycle-configuration-intro.html)」をご覧ください。

移行を実行する準備ができたら、リージョン、アクセス キー、シークレット キー、セッション トークンなどの AWS 資格情報を GitHub CLI に提供します (必要な場合)。 引数として渡すことも、`AWS_REGION`、`AWS_ACCESS_KEY_ID`、`AWS_SECRET_ACCESS_KEY`、`AWS_SESSION_TOKEN` という環境変数を設定することもできます。

また、`--aws-bucket-name` 引数を使って S3 バケットの名前で渡す必要があります。

### Setting up an Azure Blob Storage storage account

Azure でストレージ アカウントを作成し、接続文字列を記録しておきます。 詳しくは、Microsoft Docs の「[ストレージ アカウント アクセス キーを管理する](https://learn.microsoft.com/en-gb/azure/storage/common/storage-account-keys-manage?tabs=azure-portal#regenerate-access-keys)」をご覧ください。

> \[!NOTE]
> GitHub Enterprise Importer は、移行の完了後に Azure Blob Storage からアーカイブを削除しません。 ストレージ コストを減らすため、一定期間後にアーカイブが自動削除されるよう構成することをお勧めします。 詳しくは、Microsoft Docs の「[データ ライフサイクルを自動管理してコストを最適化する](https://learn.microsoft.com/en-us/azure/storage/blobs/lifecycle-management-overview)」をご覧ください。

移行を実行する準備ができたら、接続文字列を引数として GitHub CLI に渡すか、`AZURE_STORAGE_CONNECTION_STRING` という名前の環境変数を使って渡すことができます。

### Allowing network access

If you have configured firewall rules on your storage account, ensure you have allowed access to the IP ranges for your migration destination. See [Manage access for a migration from GitLab to GitHub](/ja/migrations/using-github-enterprise-importer/migrate-from-gitlab/manage-access#configure-ip-allow-lists-on-github).