← All tags

Migrations API Reference

Move projects to or from GitHub.

22 endpoints tagged migrations, each listing its parameters and possible responses. Search or scroll the index below to jump to a specific endpoint.

No endpoints match your search.

List organization migrations

GET /orgs/{org}/migrations

Lists 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).

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
excludequerynoExclude attributes from the API response to improve performance

Responses

StatusDescriptionHas JSON body
200Responseyes

Start an organization migration

POST /orgs/{org}/migrations

Initiates the generation of a migration archive.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Responseyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

Get an organization migration status

GET /orgs/{org}/migrations/{migration_id}

Fetches the status of a migration.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
migration_idpathyesThe unique identifier of the migration.
excludequerynoExclude attributes from the API response to improve performance

Responses

StatusDescriptionHas JSON body
200* pending, which means the migration hasn't started yet. * exporting, which means the migration is in progress. * exported, which means the migration finished successfully. * failed, which means the migration failed.yes
404Resource not foundyes

Download an organization migration archive

GET /orgs/{org}/migrations/{migration_id}/archive

Fetches the URL to a migration archive.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
migration_idpathyesThe unique identifier of the migration.

Responses

StatusDescriptionHas JSON body
302Responseno
404Resource not foundyes

Delete an organization migration archive

DELETE /orgs/{org}/migrations/{migration_id}/archive

Deletes a previous migration archive. Migration archives are automatically deleted after seven days.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
migration_idpathyesThe unique identifier of the migration.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes

Unlock an organization repository

DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock

Unlocks 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.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
migration_idpathyesThe unique identifier of the migration.
repo_namepathyesrepo_name parameter

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes

List repositories in an organization migration

GET /orgs/{org}/migrations/{migration_id}/repositories

List all the repositories for this organization migration.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
migration_idpathyesThe unique identifier of the migration.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes

Get an import status

GET /repos/{owner}/{repo}/import

View the progress of an import.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
503Unavailable due to service under maintenance.yes

Start an import

PUT /repos/{owner}/{repo}/import

Start a source import to a GitHub repository using GitHub Importer.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Responseyes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes
503Unavailable due to service under maintenance.yes

Update an import

PATCH /repos/{owner}/{repo}/import

An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
503Unavailable due to service under maintenance.yes

Cancel an import

DELETE /repos/{owner}/{repo}/import

Stop an import for a repository.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
204Responseno
503Unavailable due to service under maintenance.yes

Get commit authors

GET /repos/{owner}/{repo}/import/authors

Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username hubot into something like hubot <hubot@12341234-abab-fefe-8787-fedcba987654>.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
sincequerynoA user ID. Only return users with an ID greater than this ID.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
503Unavailable due to service under maintenance.yes

Map a commit author

PATCH /repos/{owner}/{repo}/import/authors/{author_id}

Update an author's identity for the import. Your application can continue updating authors any time before you push

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
author_idpathyes

Responses

StatusDescriptionHas JSON body
200Responseyes
422Validation failed, or the endpoint has been spammed.yes
404Resource not foundyes
503Unavailable due to service under maintenance.yes

Get large files

GET /repos/{owner}/{repo}/import/large_files

List files larger than 100MB found during the import

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
503Unavailable due to service under maintenance.yes

Update Git LFS preference

PATCH /repos/{owner}/{repo}/import/lfs

You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
422Validation failed, or the endpoint has been spammed.yes
503Unavailable due to service under maintenance.yes

List user migrations

GET /user/migrations

Lists all migrations a user has started.

Parameters

NameInRequiredDescription
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes

Start a user migration

POST /user/migrations

Initiates the generation of a user migration archive.

Parameters

No parameters.

Responses

StatusDescriptionHas JSON body
201Responseyes
422Validation failed, or the endpoint has been spammed.yes
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes

Get a user migration status

GET /user/migrations/{migration_id}

Fetches a single user migration. The response includes the state of the migration, which can be one of the following values:

Parameters

NameInRequiredDescription
migration_idpathyesThe unique identifier of the migration.
excludequeryno

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes

Download a user migration archive

GET /user/migrations/{migration_id}/archive

Fetches the URL to download the migration archive as a tar.gz file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:

Parameters

NameInRequiredDescription
migration_idpathyesThe unique identifier of the migration.

Responses

StatusDescriptionHas JSON body
302Responseno
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes

Delete a user migration archive

DELETE /user/migrations/{migration_id}/archive

Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the List user migrations and Get a user migration status endpoints, will continue to be available even after an archive is deleted.

Parameters

NameInRequiredDescription
migration_idpathyesThe unique identifier of the migration.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes

Unlock a user repository

DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock

Unlocks a repository. You can lock repositories when you start a user migration. Once the migration is complete you can unlock each repository to begin using it again or delete the repository if you no longer need the source data. Returns a status of 404 Not Found if the repository is not locked.

Parameters

NameInRequiredDescription
migration_idpathyesThe unique identifier of the migration.
repo_namepathyesrepo_name parameter

Responses

StatusDescriptionHas JSON body
204Responseno
304Not modifiedno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

List repositories for a user migration

GET /user/migrations/{migration_id}/repositories

Lists all the repositories for this user migration.

Parameters

NameInRequiredDescription
migration_idpathyesThe unique identifier of the migration.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes