Use this API to schedule and track repository storage moves for groups, projects, and snippets. Project moves cover wiki and design repositories, and group moves cover group wikis. Moving repositories can help you migrate to Gitaly Cluster (Praefect).
To ensure data integrity, GitLab places the group, project, or snippet in a temporary read-only state for the duration of the move. During this time, users receive this message if they try to push new commits:
The repository is temporarily read-only. Please try again later.This API requires you to authenticate yourself as an administrator.
States
As GitLab processes a storage move, it transitions through different states. Values of state are:
initial: The record has been created, but the background job has not yet been scheduled.scheduled: The background job has been scheduled.started: The repositories are being copied to the destination storage.replicated: The repositories have been moved.failed: The repositories failed to copy, or the checksums did not match.finished: The repositories have been moved, and the repositories on the source storage have been deleted.cleanup failed: The repositories have been moved, but the repositories on the source storage could not be deleted.
List all project repository storage moves
GET /api/v4/project_repository_storage_moves
Lists all project repository storage moves.
Parameters
| Name | Type | Description |
|---|---|---|
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 | — |
Create repository storage moves for all projects on a storage shard
POST /api/v4/project_repository_storage_moves
Creates repository storage moves for each project repository stored on the source storage shard. This endpoint migrates all projects at once.
Request body (application/json)
| Property | Type | Description |
|---|---|---|
destination_ | String | The destination storage shard |
source_Required | String | The source storage shard Minimum length: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
202 | Accepted | — |
400 | Bad Request | — |
Retrieve a project repository storage move
GET /api/v4/project_repository_storage_moves/{repository_storage_move_id}
Retrieves a specified project repository storage move.
Parameters
| Name | Type | Description |
|---|---|---|
repository_Path, | Integer | The ID of a project repository storage move |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
List all repository storage moves for a project
GET /api/v4/projects/{id}/repository_storage_moves
Lists all repository storage moves for a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
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 | — |
404 | Not Found | — |
Create a repository storage move for a project
POST /api/v4/projects/{id}/repository_storage_moves
Creates a repository storage move for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
destination_ | String | The destination storage shard |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Retrieve a repository storage move for a project
GET /api/v4/projects/{id}/repository_storage_moves/{repository_storage_move_id}
Retrieves a specified repository storage move for a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
repository_Path, | Integer | The ID of a project repository storage move |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
List all snippet repository storage moves
GET /api/v4/snippet_repository_storage_moves
Lists all snippet repository storage moves. By default, GET requests return 20 results at a time because the API results are paginated.
Parameters
| Name | Type | Description |
|---|---|---|
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 | — |
Schedule repository storage moves for all snippets on a storage shard
POST /api/v4/snippet_repository_storage_moves
Schedules repository storage moves for each snippet repository stored on the source storage shard. This endpoint migrates all snippets at once.
Request body (application/json)
| Property | Type | Description |
|---|---|---|
destination_ | String | The destination storage shard |
source_Required | String | The source storage shard Minimum length: 1 |
Responses
| Code | Description | Schema |
|---|---|---|
202 | Accepted | — |
400 | Bad Request | — |
Retrieve a snippet repository storage move
GET /api/v4/snippet_repository_storage_moves/{repository_storage_move_id}
Retrieves a specified snippet repository storage move.
Parameters
| Name | Type | Description |
|---|---|---|
repository_Path, | Integer | The ID of a snippet repository storage move |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
List all repository storage moves for a snippet
GET /api/v4/snippets/{id}/repository_storage_moves
Lists all repository storage moves for a specified snippet. By default, GET requests return 20 results at a time because the API results are paginated.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | The ID of a snippet |
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 | — |
404 | Not Found | — |
Schedule a repository storage move for a snippet
POST /api/v4/snippets/{id}/repository_storage_moves
Schedules a repository storage move for a specified snippet.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | The ID of a snippet |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
destination_ | String | The destination storage shard |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Retrieve a repository storage move for a snippet
GET /api/v4/snippets/{id}/repository_storage_moves/{repository_storage_move_id}
Retrieves a repository storage move for a specified snippet.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | The ID of a snippet |
repository_Path, | Integer | The ID of a snippet repository storage move |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesBasicSnippet
| Property | Type | Description |
|---|---|---|
author | APIEntities | — |
created_ | String (date- | Example:2012- |
description | String | Example:Ruby test snippet |
http_ | String | Example:https: |
id | Integer (int64) | Example:1 |
project_ | Integer (int64) | Example:1 |
raw_ | String | Example:http: |
ssh_ | String | Example:ssh: |
title | String | Example:test |
updated_ | String (date- | Example:2012- |
visibility | String | Example:public |
web_ | String | Example:http: |
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesProjectIdentity
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2020- |
description | String | Example:desc |
id | Integer (int64) | Example:1 |
name | String | Example:project1 |
name_ | String | Example:John Doe / |
path | String | Example:project1 |
path_ | String | Example:namespace1/ |
APIEntitiesProjectsRepositoryStorageMove
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2020- |
destination_ | String | Example:storage1 |
error_ | String | Example:Failed to move repository |
id | Integer (int64) | Example:1 |
project | APIEntities | — |
source_ | String | Example:default |
state | String | Example:scheduled |
APIEntitiesSnippetsRepositoryStorageMove
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2020- |
destination_ | String | Example:storage1 |
error_ | String | Example:Failed to move repository |
id | Integer (int64) | Example:1 |
snippet | APIEntities | — |
source_ | String | Example:default |
state | String | Example:scheduled |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | Example:https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | Example:1 |
locked | Boolean | — |
name | String | Example:Administrator |
public_ | String | Example:john@example. |
state | String | Example:active |
username | String | Example:admin |
web_ | String | Example:https: |