Create a migration
POST/v1/migrations
This route allows you to create a migration in your Port organization. You can use this to migrate data from one blueprint to another.
Note that it is not possible to directly change the data type of an existing property via the UI or the API. The type field setting of a property (number, string, etc.) is permanent and cannot be changed after creation.
However, you can create a new property with the desired type and migrate the old values to it. Refer to the documentation for more information on how to change a property's type.
Request
Request body schema (JSON)
{
"title": "Body",
"body": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sourceBlueprint": {
"type": "string",
"description": "The identifier of the blueprint from which the migration will be performed."
},
"mapping": {
"type": "object",
"description": "The definition used to map the data from the source blueprint into the target blueprint.",
"properties": {
"blueprint": {
"type": "string",
"description": "The identifier of the target blueprint."
},
"filter": {
"type": "string",
"description": "An optional set of [conditions](https://docs.port.io/governance/standards-and-compliance/concepts-and-structure/#filter-elements) to filter the entities that will be migrated."
},
"itemsToParse": {
"type": "string",
"description": "A `jq` query that evaluates to an array of items, used to create multiple entities at once. See more information [here](https://docs.port.io/context-lake/ingestion/configure-mapping/overview#items-to-parse)."
},
"entity": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"description": "A `jq` expression used to get data from the source blueprint, to be used as an identifier for the entity."
},
"title": {
"type": "string",
"description": "A `jq` expression used to get data from the source blueprint, to be used as the title of the entity."
},
"icon": {
"type": "string",
"description": "The icon of the entity."
},
"team": {
"type": "string",
"description": "The team the entity belongs to."
},
"properties": {
"type": "object",
"description": "An object containing the properties of the entity and their values, in `\"key\":\"value\"` pairs where the `key` is the property's identifier, and the `value` is its value.",
"additionalProperties": {
"type": "string"
}
},
"relations": {
"type": "object",
"description": "An object containing the relations of the entity and their values, in `\"key\":\"value\"` pairs where the `key` is the relation's identifier, and the `value` is the related entity's identifier for single-relations, or an array of identifiers for many-relations.<br/>You can also use a [search query](https://docs.port.io/context-lake/ingestion/configure-mapping/configuration-methods#mapping-relations-using-search-queries) to define relations based on a property of the related entity.",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"required": [
"entity"
]
}
},
"required": [
"sourceBlueprint",
"mapping"
],
"additionalProperties": false
}
}
},
"required": true
}
}Responses
- 401
- 404
- 413
- 422
Default Response
A resource with the provided identifier was not found
Request body is too large (limit is 1MiB)
The json provided does not match the route's schema
Responses (JSON)
{
"responses": {
"401": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"404": {
"description": "A resource with the provided identifier was not found",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "A resource with the provided identifier was not found"
}
}
}
},
"413": {
"description": "Request body is too large (limit is 1MiB)",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false,
"description": "Request body is too large (limit is 1MiB)"
}
}
}
},
"422": {
"description": "The json provided does not match the route's schema",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "The json provided does not match the route's schema"
}
}
}
}
}
}