github / gh-gei

Migration CLI for GitHub to GitHub migrations
MIT License
328 stars 89 forks source link

Support for Migrating from Bitbucket to GitHub Enterprise Server #1209

Open poerty opened 10 months ago

poerty commented 10 months ago

Description

Hello! We are in the process of migrating thousands of repositories from Bitbucket to GitHub Enterprise Cloud. However, due to legal and security reasons, some repositories need to be transferred to GitHub Enterprise Server.

Currently, in bbs2gh, the gh CLI only supports GitHub Enterprise Cloud and github.com as targets. Is it possible to also include support for GitHub Enterprise Server?

It seems feasible to call the GraphQL API in GitHub Enterprise Server, but it would be really helpful if gh-gei could support this.

Ideal solution Add support for a --ghes-api-url option in the gh bbs2gh migrate-repo operation. This might be related to the following code: https://github.com/github/gh-gei/blob/main/src/bbs2gh/Commands/MigrateRepo/MigrateRepoCommand.cs#L215

timrogers commented 10 months ago

Hi there 👋 We would like to support migrations to GitHub Enterprise Server (GHES) with GitHub Enterprise Importer (bbs2gh), but this isn't supported today, and it isn't something that we'll be adding in the next 6 months.

The changes to the CLI themselves would be simple - as you point out! - but we need to also make changes to GitHub Enterprise Server itself so it can handle and import the data.

GitHub does have other options for migrations from Bitbucket Server to GHES which you might want to consider.

poerty commented 10 months ago

Hi there 👋 We would like to support migrations to GitHub Enterprise Server (GHES) with GitHub Enterprise Importer (bbs2gh), but this isn't supported today, and it isn't something that we'll be adding in the next 6 months.

The changes to the CLI themselves would be simple - as you point out! - but we need to also make changes to GitHub Enterprise Server itself so it can handle and import the data.

GitHub does have other options for migrations from Bitbucket Server to GHES which you might want to consider.

Thank you for the detailed explanation. I wasn't aware of the specific behaviors of GitHub Enterprise Server, especially how they differ from the cloud version.

I will explore the migration options you mentioned. 👍

matankatz commented 3 months ago

Hi There, is there any update on supporting BBS to GHES using gei? I'm trying to execute it, and currently I see that it failing on executing the graphql, due to wrong endpoint. I configured --target-api-url https://SERVERNAME/api/v3.

I get the following logs: [2024-08-25 11:11:21] [INFO] VERBOSE: true [2024-08-25 11:11:21] [INFO] TARGET API URL: https://********/api/v3 [2024-08-25 11:11:21] [DEBUG] HTTP GET: https://********/api/v3/repos/dummy/test-repo [2024-08-25 11:11:21] [DEBUG] GITHUB REQUEST ID: e4cf80ae-6216-4b80-ab2a-e80301117524 [2024-08-25 11:11:21] [DEBUG] RESPONSE (NotFound): {"message":"Not Found","documentation_url":"https://docs.github.com/enterprise-server@3.13/rest/repos/repos#get-a-repository"} [2024-08-25 11:11:21] [INFO] Creating Migration Source... [2024-08-25 11:11:21] [DEBUG] HTTP POST: https://********/api/v3/graphql [2024-08-25 11:11:22] [DEBUG] HTTP BODY: {"query":"query($login: String!) {organization(login: $login) { login, id, name } }","variables":{"login":"dummy"}} [2024-08-25 11:11:22] [DEBUG] GITHUB REQUEST ID: 85b49a27-05c6-4487-9b7e-b0e04ae361e8 [2024-08-25 11:11:22] [DEBUG] RESPONSE (NotFound): {"message":"Not Found","documentation_url":"https://docs.github.com/enterprise-server@3.13/rest"} [2024-08-25 11:11:22] [DEBUG] [HTTP ERROR 404] System.Net.Http.HttpRequestException: GitHub API error: {"message":"Not Found","documentation_url":"https://docs.github.com/enterprise-server@3.13/rest"}

ArinGhazarian commented 3 months ago

👋 @matankatz,

There has been no update to this and gh-gei still doesn't support migrations to GHES.

Tribute12 commented 1 month ago

Commenting for support. This would be a great addition to support my organization's move from Bitbucket Server to GitHub Enterprise Server.