> For AI agents: the complete Sanity documentation index is available at [https://www.sanity.io/docs/llms.txt](https://www.sanity.io/docs/llms.txt).

# Migrations CLI command reference

Create, list, and run content migrations

**npm**

```shell
npx sanity migrations --help
```

**pnpm**

```shell
pnpm dlx sanity migrations --help
```

**yarn**

```shell
yarn dlx sanity migrations --help
```

**bun**

```shell
bunx sanity migrations --help
```

## Commands

### `create`

**CLI output**

```sh
USAGE
  $ sanity migrations create [TITLE]

ARGUMENTS
  [TITLE]  Title of migration

DESCRIPTION
  Create a new migration within your project

EXAMPLES
  Create a new migration, prompting for title and options

    $ sanity migrations create

  Create a new migration with the provided title, prompting for options

    $ sanity migrations create "Rename field from location to address"
```

### `list`

**CLI output**

```sh
USAGE
  $ sanity migrations list

DESCRIPTION
  List available migrations

EXAMPLES
  List all available migrations in the project

    $ sanity migrations list
```

### `run`

**CLI output**

```sh
USAGE
  $ sanity migrations run [ID] [--api-version <value>] [--concurrency <value>] [--confirm] [--dataset <value>] [--dry-run] [--from-export <value>] [--progress] [--project <value>]

ARGUMENTS
  [ID]  ID

FLAGS
      --api-version=<value>  API version to use when migrating. Defaults to v2024-01-29.
      --concurrency=<value>  How many mutation requests to run in parallel. Must be between 1 and 10. Default: 6.
      --confirm              Prompt for confirmation before running the migration (default: true). Use --no-confirm to skip.
      --dataset=<value>      Dataset to migrate. Defaults to the dataset configured in your Sanity CLI config.
      --dry-run              By default the migration runs in dry mode. Use --no-dry-run to migrate dataset.
      --from-export=<value>  Use a local dataset export as source for migration instead of calling the Sanity API. Note: this is only supported for dry runs.
      --progress             Display progress during migration (default: true). Use --no-progress to hide output.
      --project=<value>      Project ID of the dataset to migrate. Defaults to the projectId configured in your Sanity CLI config.

DESCRIPTION
  Run a migration against a dataset

EXAMPLES
  dry run the migration

    $ sanity migrations run <id>

  execute the migration against a dataset

    $ sanity migrations run <id> --no-dry-run --project xyz --dataset staging

  execute the migration using a dataset export as the source

    $ sanity migrations run <id> --from-export=production.tar.gz --no-dry-run --project xyz --dataset staging
```



## Related changelog entries

Entries are listed newest first; each link points to the full entry as markdown. Follow one when you need to know what changed, when, or why — for example, to summarize recent updates, explain behavior that differs from older documentation, or check whether a fix has shipped.

- [Sanity Studio v5.18.0: Fixes Next.js session management and multiple bugfixes and improvements](https://www.sanity.io/docs/changelog/studio-NS4xNy4x.md) — March 24, 2026
- [Sanity Studio v3.27.0: New CLI Commands, Content Migration Tooling, Schema Validation, and Enhanced Localization & Validation Support](https://www.sanity.io/docs/changelog/34ea89ee-82cd-401e-8250-846068d11a2d.md) — January 31, 2024