---
title: "Migrate a dataset to a data model (Beta)"
method: POST
path: "/v2/datasets/{datasetId}/migrate"
tags: ["Datasets"]
---

# Migrate a dataset to a data model (Beta)

`POST /v2/datasets/{datasetId}/migrate`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/datasets/{datasetId}/migrate`
- Auth: HTTP bearer

Migrate a dataset (deprecated) to a data model. The response always includes the dataset's link details and its link and reference counts. For more information on how datasets are migrated to data models, see [Migrate a dataset to a data model](https://help.sigmacomputing.com/docs/migrate-a-dataset-to-a-data-model).

**Beta**: This documentation describes a public beta feature and is subject to the [Beta features](/docs/sigma-product-releases#beta-features) disclaimer.

### Usage notes
- Retrieve the **datasetId** by calling the [/v2/datasets](https://help.sigmacomputing.com/reference/list-datasets) endpoint.
- To skip the migration and return only the dataset's link details and its link and reference counts, pass `dryRun: true`.

### Usage scenarios
- **Plan dataset migration**: Pass `dryRun: true` to review the datasets and connection tables linked to the dataset, and how many documents reference it, before you migrate.
- **Migrate datasets in bulk**: If you want to migrate several datasets, you can use this endpoint to programmatically migrate the datasets returned by [/v2/datasets](https://help.sigmacomputing.com/reference/list-datasets) with a `migrationStatus` of `not-migrated`.

## Path parameters

- `datasetId` string, required

## Request body

- object
  - `shouldUpdateReferences` boolean, required: Whether to update references in workbooks that use this dataset to point to the new data model.
  - `destFolderId` string: Optional destination folder ID where the data model should be created. If not provided, the data model will be created in the same folder as the dataset.
  - `dryRun` boolean: If true, do not perform the migration. Only return the link details and the link and reference counts. Defaults to false.

## Response `200`

The response body.

- DatasetsMigrateDatasetToDataModelResponse200
  - `dataModelId` string, nullable, required: ID of the newly-created data model. Null when `dryRun` is true.
  - `links` V2DatasetsDatasetIdMigratePostResponsesContentApplicationJsonSchemaLinksItems[], required: All datasets or connection tables linked to this dataset. Each can be a source, target, or part of a series of links.
    - `source` union, required: The dataset or table that is the source of the link.
      - V2DatasetsDatasetIdMigratePostResponsesContentApplicationJsonSchemaLinksItemsSource0: A linked dataset.
        - `type` 'dataset', required
        - `datasetId` string, required: ID of the dataset.
      - V2DatasetsDatasetIdMigratePostResponsesContentApplicationJsonSchemaLinksItemsSource1: A linked connection table.
        - `type` 'table', required
        - `tableId` string, required: ID of the connection table.
    - `target` union, required: The dataset or table the link targets.
      - V2DatasetsDatasetIdMigratePostResponsesContentApplicationJsonSchemaLinksItemsTarget0: A linked dataset.
        - `type` 'dataset', required
        - `datasetId` string, required: ID of the dataset.
      - V2DatasetsDatasetIdMigratePostResponsesContentApplicationJsonSchemaLinksItemsTarget1: A linked connection table.
        - `type` 'table', required
        - `tableId` string, required: ID of the connection table.
  - `linkCount` number, double, required: Number of links the dataset has to other datasets.
  - `referenceCount` number, double, required: Number of documents that reference this dataset.

---

[API](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api.md) - [All operations](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/revisions/fb6036208c49?raw)
