Use this API to migrate groups and projects by using direct transfer, and to import repositories from external sources.
Before migrating by direct transfer, see the prerequisites.
User contribution mapping is not supported when you import projects to a personal namespace. All contributions are assigned to the personal namespace owner and cannot be reassigned.
List all group or project migrations
GET /api/v4/bulk_imports
Lists all group or project migrations.
Parameters
| Name | Type | Description |
|---|---|---|
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
sortQuery | String | Return Gitasc or desc orderAllowed values: asc,descDefault: desc |
statusQuery | String | Return Git Allowed values: created,started,finished,timeout,failed,canceled |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
503 | Service unavailable | — |
Start a group or project migration
POST /api/v4/bulk_imports
Starts a group or project migration. To migrate a project, specify entities[project_entity].
Request body (application/x-www-form-urlencoded)
| Property | Type | Description |
|---|---|---|
configurationRequired | Object | The source Git |
configuration.Required | String | Access token to the source Git |
configuration.Required | String | Source Git |
entitiesRequired | Array of objects | List of entities to import |
entities[]. | String | Deprecated: Example: 'destination_ |
entities[].Required | String | Destination namespace for the entity Example: 'destination_ |
entities[]. | String | Destination slug for the entity Example: 'destination_ |
entities[]. | Boolean | The option to migrate memberships or not Default: true |
entities[]. | Boolean | Indicates group migration should include nested projects Default: true |
entities[].Required | String | Relative path of the source entity to import Example: 'source/ |
entities[].Required | String | Source entity type Allowed values: group_,project_Minimum length: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
422 | Unprocessable entity | — |
503 | Service unavailable | — |
List all group or project migration entities
GET /api/v4/bulk_imports/entities
Lists all group or project migration entities.
Parameters
| Name | Type | Description |
|---|---|---|
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
sortQuery | String | Return Gitasc or desc orderAllowed values: asc,descDefault: desc |
statusQuery | String | Return all Git Allowed values: created,started,finished,timeout,failed,canceled |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
503 | Service unavailable | — |
Retrieve a group or project migration
GET /api/v4/bulk_imports/{import_id}
Retrieves details of a group or project migration.
Parameters
| Name | Type | Description |
|---|---|---|
import_Path, | Integer | The ID of user’s Git |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
503 | Service unavailable | — |
Cancel a migration
POST /api/v4/bulk_imports/{import_id}/cancel
Cancels a direct transfer migration. This feature was introduced in GitLab 17.1.
Parameters
| Name | Type | Description |
|---|---|---|
import_Path, | Integer | The ID of user’s Git |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service unavailable | — |
List all group or project migration entities
GET /api/v4/bulk_imports/{import_id}/entities
Lists all group or project migration entities for a specified migration.
Parameters
| Name | Type | Description |
|---|---|---|
import_Path, | Integer | The ID of user’s Git |
statusQuery | String | Return import entities with specified status Allowed values: created,started,finished,timeout,failed,canceled |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
503 | Service unavailable | — |
Retrieve a group or project migration entity
GET /api/v4/bulk_imports/{import_id}/entities/{entity_id}
Retrieves details of a group or project migration entity.
Parameters
| Name | Type | Description |
|---|---|---|
import_Path, | Integer | The ID of user’s Git |
entity_Path, | Integer | The ID of Git |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
503 | Service unavailable | — |
List all failed import records for a migration entity
GET /api/v4/bulk_imports/{import_id}/entities/{entity_id}/failures
Lists all failed import records for a group or project migration entity. This feature was introduced in GitLab 16.6.
Parameters
| Name | Type | Description |
|---|---|---|
import_Path, | Integer | The ID of user’s Git |
entity_Path, | Integer | The ID of Git |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
503 | Service unavailable | — |
Import GitHub gists into GitLab snippets
POST /api/v4/import/github/gists
Imports personal GitHub gists into GitLab snippets. You can import gists with up to 10 files. GitHub gists with more than 10 files are skipped. You should manually migrate these GitHub gists. If any gists cannot be imported, an email is sent with a list of gists that were not imported.
Request body (application/json)
| Property | Type | Description |
|---|---|---|
personal_Required | String | Git |
Responses
| Code | Description | Schema |
|---|---|---|
202 | Accepted | — |
400 | Bad Request | — |
401 | Unauthorized | — |
422 | Unprocessable Entity | — |
429 | Too Many Requests | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesBulkImport
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2012- |
has_ | Boolean | Example:false |
id | Integer (int64) | Example:1 |
source_ | String | Example:gitlab |
source_ | String | Example:https: |
status | String | Allowed values:created,started,finished,timeout,failedExample: finished |
updated_ | String (date- | Example:2012- |
APIEntitiesBulkImportsEntity
| Property | Type | Description |
|---|---|---|
bulk_ | Integer (int64) | Example:1 |
created_ | String (date- | Example:2012- |
destination_ | String | Example:some_ |
destination_ | String | Example:destination_ |
destination_ | String | Example:destination_ |
destination_ | String | Example:destination_ |
entity_ | String | Allowed values:group,project |
failures | Array of APIEntities | — |
has_ | Boolean | Example:false |
id | Integer (int64) | Example:1 |
migrate_ | Boolean | Example:true |
migrate_ | Boolean | Example:true |
namespace_ | Integer (int64) | Example:1 |
parent_ | Integer (int64) | Example:1 |
project_ | Integer (int64) | Example:1 |
source_ | String | Example:source_ |
stats | Object | — |
status | String | Allowed values:created,started,finished,timeout,failedExample: created |
updated_ | String (date- | Example:2012- |
APIEntitiesBulkImportsEntityFailure
| Property | Type | Description |
|---|---|---|
correlation_ | String | Example:dfcf583058ed4508e4c7 |
exception_ | String | Example:Exception |
exception_ | String | Example:error message |
relation | String | Example:label |
source_ | String | Example:title |
source_ | String | Example:https: |