Group relations export API
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
The group relations export API partially exports a group’s structure as separate files for each top-level relation (for example, milestones, boards, and labels).
The group relations export API is primarily used in group migration by direct transfer and your GitLab instance must meet certain prerequisites.
This API can’t be used with the group import and export API.
Schedule new export
Start a new group relations export:
POST /groups/:id/export_relations
Attribute | Type | Required | Description |
---|---|---|---|
id |
integer/string | yes | ID of the group. |
batched |
boolean | no | Whether to export in batches. |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/export_relations"
{
"message": "202 Accepted"
}
Export status
View the status of the relations export:
GET /groups/:id/export_relations/status
Attribute | Type | Required | Description |
---|---|---|---|
id |
integer/string | yes | ID of the group. |
relation |
string | no | Name of the project top-level relation to view. |
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" \
"https://gitlab.example.com/api/v4/groups/1/export_relations/status"
The status can be one of the following:
0
:started
1
:finished
-1
:failed
[
{
"relation": "badges",
"status": 1,
"error": null,
"updated_at": "2021-05-04T11:25:20.423Z",
"batched": true,
"batches_count": 1,
"batches": [
{
"status": 1,
"batch_number": 1,
"objects_count": 1,
"error": null,
"updated_at": "2021-05-04T11:25:20.423Z"
}
]
},
{
"relation": "boards",
"status": 1,
"error": null,
"updated_at": "2021-05-04T11:25:20.085Z",
"batched": false,
"batches_count": 0
}
]
Export download
Download the finished relations export:
GET /groups/:id/export_relations/download
Attribute | Type | Required | Description |
---|---|---|---|
id |
integer/string | yes | ID of the group. |
relation |
string | yes | Name of the group top-level relation to download. |
batched |
boolean | no | Whether the export is batched. |
batch_number |
integer | no | Number of export batch to download. |
curl --header "PRIVATE-TOKEN: <your_access_token>" --remote-header-name \
--remote-name "https://gitlab.example.com/api/v4/groups/1/export_relations/download?relation=labels"
ls labels.ndjson.gz
labels.ndjson.gz
Related topics
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support