v1

latestOpenAPI 3.1.02026-07-2618690613.4 KB
Models

Migrate a model

Copy a model from one Omni connection to another by reading the source model's YAML at a specific Git ref and writing it to the target model. Supports same-organization and cross-organization migrations.

This API:

  1. Reads the full model YAML from the source model's git repository at the specified gitRef (merged with the default branch).
  2. If branchName is provided and the branch already exists on the target model, the API writes to that branch. If the branch doesn't exist, one is created.
  3. Writes the YAML to the target model or branch, replacing its model definition.

Requirements

To successfully migrate a model:

  • The user performing the migration must have:
    • For the source model - Querier, Modeler, or Connection Admin permissions
    • For the target model - Modeler or Connection Admin permissions
    • For cross-organization migrations - The user must be a member of both organizations
  • The source model must have git configured. This is required so the API can read the model YAML from the repository.
  • The target model should have an identical schema model to the source model at the instant the git ref was committed.
post/v1/models/{modelId}/migrate

Path parameters

modelIdstring uuid required

The shared model ID to read YAML from.

Request body

gitRefstring required

Git reference (branch name, tag, or commit SHA) to read the source model YAML from.

targetModelIdstring uuid required

The shared model ID to write the YAML to.

branchNamestring

Required if the target model has git enabled.. Branch name on the target model. If the branch doesn't exist, it will be created.

commitMessagestring

Git commit message.

deleteViewsAndTopicsMissingFromSourceboolean

Controls how views and topics present in the target model but missing from the source model are handled. When true (default), these views and topics are marked as ignored: true. When false, they are inherited from the parent model instead.

Example request

{
  "gitRef": "main",
  "targetModelId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "branchName": "migrate-from-prod",
  "commitMessage": "Migrate model from production",
  "deleteViewsAndTopicsMissingFromSource": true
}

Response

Model migrated successfully

successboolean

Whether the migration completed successfully.

Example response

{
  "success": true
}