Use this API to start and track offline transfer exports and imports, which migrate data between GitLab instances that cannot reach each other over a network.

List all offline transfer exports

GET /api/v4/offline_exports

Lists all offline transfer exports. For more information, see https://docs.gitlab.com/user/group/import/offline_transfer_migrations/

Parameters

NameTypeDescription
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20
sort
Query
StringReturn offline transfer exports sorted in created by asc or desc order
Allowed values: asc, desc
Default: desc
status
Query
StringReturn offline transfer exports with specified status
Allowed values: created, started, finished, failed

Responses

CodeDescriptionSchema
200OK—
400Bad Request—

Start a new offline transfer export

POST /api/v4/offline_exports

Initiates a new offline transfer export. For more information, see https://docs.gitlab.com/user/group/import/offline_transfer_migrations/

Request body (application/json)

PropertyTypeDescription
aws_s3_configurationObjectAWS S3 object storage configuration
aws_s3_configuration.aws_access_key_id
Required
StringAWS S3 access key ID
aws_s3_configuration.aws_secret_access_key
Required
StringAWS S3 secret access key
aws_s3_configuration.path_styleBooleanUse path-style URLs instead of virtual-hosted-style URLs
Default: false
aws_s3_configuration.region
Required
StringAWS S3 object storage region
bucket
Required
StringName of the object storage bucket where export data is stored
entities
Required
Array of objectsList of entities to export
entities[].full_path
Required
StringRelative path of the entity to export
Example: 'source/full/path' not 'https://example.com/source/full/path'
gcs_adc_configurationObjectGoogle Cloud Storage configuration using Application Default Credentials. Available on GitLab Self-Managed or GitLab Dedicated, and must be enabled by an administrator. Only administrators can use these credentials, and the bucket name must start with “gitlab-offline-transfer-”. For more information, see https://docs.gitlab.com/administration/settings/import_and_export_settings/#allow-application-default-credentials-for-offline-transfer
gcs_adc_configuration.google_project
Required
StringGoogle Cloud project ID
gcs_configurationObjectGoogle Cloud Storage configuration using a service account JSON key
gcs_configuration.google_json_key_string
Required
StringGoogle Cloud service account JSON key contents
gcs_configuration.google_project
Required
StringGoogle Cloud project ID
gcs_hmac_configurationObjectGoogle Cloud Storage configuration using S3-interoperability HMAC keys
gcs_hmac_configuration.google_storage_access_key_id
Required
StringGCS HMAC access key ID
gcs_hmac_configuration.google_storage_secret_access_key
Required
StringGCS HMAC secret
gcs_hmac_configuration.path_styleBooleanUse path-style URLs instead of virtual-hosted-style URLs
Default: true
gcs_hmac_configuration.region
Required
StringGCS bucket region
s3_compatible_configurationObjectMinIO or other S3-compatible object storage configuration
s3_compatible_configuration.aws_access_key_id
Required
StringS3-compatible access key ID
s3_compatible_configuration.aws_secret_access_key
Required
StringS3-compatible secret access key
s3_compatible_configuration.endpoint
Required
StringObject storage location endpoint
s3_compatible_configuration.path_styleBooleanUse path-style URLs instead of virtual-hosted-style URLs
Default: true
s3_compatible_configuration.region
Required
StringS3-compatible object storage region

Responses

CodeDescriptionSchema
201Created—
400Bad Request—

Get offline transfer export details

GET /api/v4/offline_exports/{id}

Retrieves details of an offline transfer export. For more information, see https://docs.gitlab.com/user/group/import/offline_transfer_migrations/

Parameters

NameTypeDescription
id
Path, required
IntegerThe ID of user’s offline transfer export

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
404Not Found—

Start a new offline transfer import

POST /api/v4/offline_imports

Initiates a new offline transfer import from object storage. For more information, see https://docs.gitlab.com/user/group/import/offline_transfer_migrations/

Request body (application/json)

PropertyTypeDescription
aws_s3_configurationObjectAWS S3 object storage configuration
aws_s3_configuration.aws_access_key_id
Required
StringAWS S3 access key ID
aws_s3_configuration.aws_secret_access_key
Required
StringAWS S3 secret access key
aws_s3_configuration.path_styleBooleanUse path-style URLs instead of virtual-hosted-style URLs
Default: false
aws_s3_configuration.region
Required
StringAWS S3 object storage region
bucket
Required
StringName of the object storage bucket where export data is stored
entitiesArray of objectsList of entities to import
entities[].destination_namespace
Required
StringFull path of the destination namespace
entities[].destination_slugStringDestination slug for the imported entity
entities[].source_full_path
Required
StringFull path of the entity on the source instance
entities[].source_type
Required
StringType of the entity to import
Allowed values: group_entity, project_entity
Minimum length: 1
export_prefix
Required
StringPrefix of the export within the bucket
gcs_adc_configurationObjectGoogle Cloud Storage configuration using Application Default Credentials. Available on GitLab Self-Managed or GitLab Dedicated, and must be enabled by an administrator. Only administrators can use these credentials, and the bucket name must start with “gitlab-offline-transfer-”. For more information, see https://docs.gitlab.com/administration/settings/import_and_export_settings/#allow-application-default-credentials-for-offline-transfer
gcs_adc_configuration.google_project
Required
StringGoogle Cloud project ID
gcs_configurationObjectGoogle Cloud Storage configuration using a service account JSON key
gcs_configuration.google_json_key_string
Required
StringGoogle Cloud service account JSON key contents
gcs_configuration.google_project
Required
StringGoogle Cloud project ID
gcs_hmac_configurationObjectGoogle Cloud Storage configuration using S3-interoperability HMAC keys
gcs_hmac_configuration.google_storage_access_key_id
Required
StringGCS HMAC access key ID
gcs_hmac_configuration.google_storage_secret_access_key
Required
StringGCS HMAC secret
gcs_hmac_configuration.path_styleBooleanUse path-style URLs instead of virtual-hosted-style URLs
Default: true
gcs_hmac_configuration.region
Required
StringGCS bucket region
import_allObjectImport every top-level group in the export, recreating the source instance structure
import_all.destination_namespace
Required
StringFull path of the destination namespace the source structure is recreated under. Use an empty string to recreate it at the instance root
Example: destination-group/subgroup
s3_compatible_configurationObjectMinIO or other S3-compatible object storage configuration
s3_compatible_configuration.aws_access_key_id
Required
StringS3-compatible access key ID
s3_compatible_configuration.aws_secret_access_key
Required
StringS3-compatible secret access key
s3_compatible_configuration.endpoint
Required
StringObject storage location endpoint
s3_compatible_configuration.path_styleBooleanUse path-style URLs instead of virtual-hosted-style URLs
Default: true
s3_compatible_configuration.region
Required
StringS3-compatible object storage region

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesBulkImport
400Bad request—
401Unauthorized—
404Not found—
422Unprocessable entity—
429Too many requests—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesBulkImport

PropertyTypeDescription
created_atString (date-time)Example: 2012-05-28T04:42:42-07:00
has_failuresBooleanExample: false
idInteger (int64)Example: 1
source_typeStringExample: gitlab
source_urlStringExample: https://source.gitlab.com/
statusStringAllowed values: created, started, finished, timeout, failed
Example: finished
updated_atString (date-time)Example: 2012-05-28T04:42:42-07:00