{"meta":{"title":"REST-API-Endpunkte für Organisationsmigrationen","intro":"Verwenden Sie die REST-API, um ein oder mehrere Repositorys zu exportieren, damit Sie sie in eine andereGitHub Enterprise Server Instanz verschieben können.","product":"REST-API","breadcrumbs":[{"href":"/de/enterprise-server@3.22/rest","title":"REST-API"},{"href":"/de/enterprise-server@3.22/rest/migrations","title":"Migrationen"},{"href":"/de/enterprise-server@3.22/rest/migrations/orgs","title":"Organisationen"}],"documentType":"article"},"body":"# REST-API-Endpunkte für Organisationsmigrationen\n\nVerwenden Sie die REST-API, um ein oder mehrere Repositorys zu exportieren, damit Sie sie in GitHub Enterprise Server verschieben können.\n\n## Informationen zu Organisationsmigrationen\n\nDiese Endpunkte sind nur für authentifizierte Organisationsbesitzer verfügbar. Weitere Informationen findest du unter [Rollen in einer Organisation](/de/enterprise-server@3.22/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#organization-owners) und [Authentifizieren bei der REST-API](/de/enterprise-server@3.22/rest/authentication/authenticating-to-the-rest-api).\n\nSie können diese Endpunkte verwenden, um ein oder mehrere Repositories zu exportieren, damit Sie sie in eine andere Instanz verschieben können. Weitere Informationen finden Sie unter [Exportieren von Migrationsdaten aus GitHub.com](/de/enterprise-server@3.22/migrations/using-ghe-migrator/exporting-migration-data-from-githubcom).\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List organization migrations\n\n```\nGET /orgs/{org}/migrations\n```\n\nLists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).\nA list of repositories is only returned for export migrations.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n* **`exclude`** (array)\n  Exclude attributes from the API response to improve performance\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/migrations\n```\n\n**Response schema (Status: 200):**\n\nArray of `Migration`:\n\n* `id`: required, integer, format: int64\n* `owner`: required, any of:\n  * **null**\n  * **Simple User**\n    * `name`: string or null\n    * `email`: string or null\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `node_id`: required, string\n    * `avatar_url`: required, string, format: uri\n    * `gravatar_id`: required, string or null\n    * `url`: required, string, format: uri\n    * `html_url`: required, string, format: uri\n    * `followers_url`: required, string, format: uri\n    * `following_url`: required, string\n    * `gists_url`: required, string\n    * `starred_url`: required, string\n    * `subscriptions_url`: required, string, format: uri\n    * `organizations_url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string\n    * `received_events_url`: required, string, format: uri\n    * `type`: required, string\n    * `site_admin`: required, boolean\n    * `starred_at`: string\n    * `user_view_type`: string\n* `guid`: required, string\n* `state`: required, string\n* `lock_repositories`: required, boolean\n* `exclude_metadata`: required, boolean\n* `exclude_git_data`: required, boolean\n* `exclude_attachments`: required, boolean\n* `exclude_releases`: required, boolean\n* `exclude_owner_projects`: required, boolean\n* `org_metadata_only`: required, boolean\n* `repositories`: required, array of `Simple Repository`:\n  * `id`: required, integer, format: int64\n  * `node_id`: required, string\n  * `name`: required, string\n  * `full_name`: required, string\n  * `owner`: required, `Simple User` (see above)\n  * `private`: required, boolean\n  * `html_url`: required, string, format: uri\n  * `description`: required, string or null\n  * `fork`: required, boolean\n  * `url`: required, string, format: uri\n  * `archive_url`: required, string\n  * `assignees_url`: required, string\n  * `blobs_url`: required, string\n  * `branches_url`: required, string\n  * `collaborators_url`: required, string\n  * `comments_url`: required, string\n  * `commits_url`: required, string\n  * `compare_url`: required, string\n  * `contents_url`: required, string\n  * `contributors_url`: required, string, format: uri\n  * `deployments_url`: required, string, format: uri\n  * `downloads_url`: required, string, format: uri\n  * `events_url`: required, string, format: uri\n  * `forks_url`: required, string, format: uri\n  * `git_commits_url`: required, string\n  * `git_refs_url`: required, string\n  * `git_tags_url`: required, string\n  * `issue_comment_url`: required, string\n  * `issue_events_url`: required, string\n  * `issues_url`: required, string\n  * `keys_url`: required, string\n  * `labels_url`: required, string\n  * `languages_url`: required, string, format: uri\n  * `merges_url`: required, string, format: uri\n  * `milestones_url`: required, string\n  * `notifications_url`: required, string\n  * `pulls_url`: required, string\n  * `releases_url`: required, string\n  * `stargazers_url`: required, string, format: uri\n  * `statuses_url`: required, string\n  * `subscribers_url`: required, string, format: uri\n  * `subscription_url`: required, string, format: uri\n  * `tags_url`: required, string, format: uri\n  * `teams_url`: required, string, format: uri\n  * `trees_url`: required, string\n  * `hooks_url`: required, string, format: uri\n* `url`: required, string, format: uri\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `node_id`: required, string\n* `archive_url`: string, format: uri\n* `exclude`: array of string\n\n## Start an organization migration\n\n```\nPOST /orgs/{org}/migrations\n```\n\nInitiates the generation of a migration archive.\nBefore you can use this endpoint, you must configure a blob storage provider in the \"Migrations\" section in the Management Console. For more details, see \"Migrating repositories from GitHub Enterprise Server to GitHub Enterprise Cloud.\"\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n#### Body parameters\n\n* **`repositories`** (array of strings) (required)\n  A list of arrays indicating which repositories should be migrated.\n\n* **`lock_repositories`** (boolean)\n  Indicates whether repositories should be locked (to prevent manipulation) while migrating data.\n  Default: `false`\n\n* **`exclude_metadata`** (boolean)\n  Indicates whether metadata should be excluded and only git source should be included for the migration.\n  Default: `false`\n\n* **`exclude_git_data`** (boolean)\n  Indicates whether the repository git data should be excluded from the migration.\n  Default: `false`\n\n* **`exclude_attachments`** (boolean)\n  Indicates whether attachments should be excluded from the migration (to reduce migration archive file size).\n  Default: `false`\n\n* **`exclude_releases`** (boolean)\n  Indicates whether releases should be excluded from the migration (to reduce migration archive file size).\n  Default: `false`\n\n* **`exclude_owner_projects`** (boolean)\n  Indicates whether projects owned by the organization or users should be excluded. from the migration.\n  Default: `false`\n\n* **`org_metadata_only`** (boolean)\n  Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags).\n  Default: `false`\n\n* **`exclude`** (array of strings)\n  Exclude related items from being returned in the response in order to improve performance of the request.\n  Supported values are: repositories\n\n### HTTP response status codes\n\n* **201** - Created\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/migrations \\\n  -d '{\n  \"repositories\": [\n    \"github/Hello-World\"\n  ],\n  \"lock_repositories\": true\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer, format: int64\n* `owner`: required, any of:\n  * **null**\n  * **Simple User**\n    * `name`: string or null\n    * `email`: string or null\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `node_id`: required, string\n    * `avatar_url`: required, string, format: uri\n    * `gravatar_id`: required, string or null\n    * `url`: required, string, format: uri\n    * `html_url`: required, string, format: uri\n    * `followers_url`: required, string, format: uri\n    * `following_url`: required, string\n    * `gists_url`: required, string\n    * `starred_url`: required, string\n    * `subscriptions_url`: required, string, format: uri\n    * `organizations_url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string\n    * `received_events_url`: required, string, format: uri\n    * `type`: required, string\n    * `site_admin`: required, boolean\n    * `starred_at`: string\n    * `user_view_type`: string\n* `guid`: required, string\n* `state`: required, string\n* `lock_repositories`: required, boolean\n* `exclude_metadata`: required, boolean\n* `exclude_git_data`: required, boolean\n* `exclude_attachments`: required, boolean\n* `exclude_releases`: required, boolean\n* `exclude_owner_projects`: required, boolean\n* `org_metadata_only`: required, boolean\n* `repositories`: required, array of `Simple Repository`:\n  * `id`: required, integer, format: int64\n  * `node_id`: required, string\n  * `name`: required, string\n  * `full_name`: required, string\n  * `owner`: required, `Simple User` (see above)\n  * `private`: required, boolean\n  * `html_url`: required, string, format: uri\n  * `description`: required, string or null\n  * `fork`: required, boolean\n  * `url`: required, string, format: uri\n  * `archive_url`: required, string\n  * `assignees_url`: required, string\n  * `blobs_url`: required, string\n  * `branches_url`: required, string\n  * `collaborators_url`: required, string\n  * `comments_url`: required, string\n  * `commits_url`: required, string\n  * `compare_url`: required, string\n  * `contents_url`: required, string\n  * `contributors_url`: required, string, format: uri\n  * `deployments_url`: required, string, format: uri\n  * `downloads_url`: required, string, format: uri\n  * `events_url`: required, string, format: uri\n  * `forks_url`: required, string, format: uri\n  * `git_commits_url`: required, string\n  * `git_refs_url`: required, string\n  * `git_tags_url`: required, string\n  * `issue_comment_url`: required, string\n  * `issue_events_url`: required, string\n  * `issues_url`: required, string\n  * `keys_url`: required, string\n  * `labels_url`: required, string\n  * `languages_url`: required, string, format: uri\n  * `merges_url`: required, string, format: uri\n  * `milestones_url`: required, string\n  * `notifications_url`: required, string\n  * `pulls_url`: required, string\n  * `releases_url`: required, string\n  * `stargazers_url`: required, string, format: uri\n  * `statuses_url`: required, string\n  * `subscribers_url`: required, string, format: uri\n  * `subscription_url`: required, string, format: uri\n  * `tags_url`: required, string, format: uri\n  * `teams_url`: required, string, format: uri\n  * `trees_url`: required, string\n  * `hooks_url`: required, string, format: uri\n* `url`: required, string, format: uri\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `node_id`: required, string\n* `archive_url`: string, format: uri\n* `exclude`: array of string\n\n## Get an organization migration status\n\n```\nGET /orgs/{org}/migrations/{migration_id}\n```\n\nFetches the status of a migration.\nThe state of a migration can be one of the following values:\n\npending, which means the migration hasn't started yet.\nexporting, which means the migration is in progress.\nexported, which means the migration finished successfully.\nfailed, which means the migration failed.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`migration_id`** (integer) (required)\n  The unique identifier of the migration.\n\n* **`exclude`** (array)\n  Exclude attributes from the API response to improve performance\n\n### HTTP response status codes\n\n* **200** - pending, which means the migration hasn't started yet.\n  exporting, which means the migration is in progress.\n  exported, which means the migration finished successfully.\n  failed, which means the migration failed.\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/migrations/MIGRATION_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Start an organization migration](#start-an-organization-migration).\n\n## Download an organization migration archive\n\n```\nGET /orgs/{org}/migrations/{migration_id}/archive\n```\n\nFetches the URL to a migration archive.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`migration_id`** (integer) (required)\n  The unique identifier of the migration.\n\n### HTTP response status codes\n\n* **302** - Found\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/migrations/MIGRATION_ID/archive\n```\n\n**Response schema (Status: 302):**\n\n## Delete an organization migration archive\n\n```\nDELETE /orgs/{org}/migrations/{migration_id}/archive\n```\n\nDeletes a previous migration archive. Migration archives are automatically deleted after seven days.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`migration_id`** (integer) (required)\n  The unique identifier of the migration.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/migrations/MIGRATION_ID/archive\n```\n\n**Response schema (Status: 204):**\n\n## Unlock an organization repository\n\n```\nDELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\n```\n\nUnlocks a repository that was locked for migration. You should unlock each migrated repository and delete them when the migration is complete and you no longer need the source data.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`migration_id`** (integer) (required)\n  The unique identifier of the migration.\n\n* **`repo_name`** (string) (required)\n  repo\\_name parameter\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/migrations/MIGRATION_ID/repos/REPO_NAME/lock\n```\n\n**Response schema (Status: 204):**\n\n## List repositories in an organization migration\n\n```\nGET /orgs/{org}/migrations/{migration_id}/repositories\n```\n\nList all the repositories for this organization migration.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`migration_id`** (integer) (required)\n  The unique identifier of the migration.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/migrations/MIGRATION_ID/repositories\n```\n\n**Response schema (Status: 200):**"}