@sanity/migrate
Version:
Tooling for running data migrations on Sanity.io projects
162 lines • 5.09 kB
JSON
{
"commands": {
"migration:create": {
"aliases": [],
"args": {
"title": {
"description": "Title of migration",
"name": "title",
"required": false
}
},
"description": "Create a new migration within your project",
"examples": [
{
"command": "<%= config.bin %> <%= command.id %>",
"description": "Create a new migration, prompting for title and options"
},
{
"command": "<%= config.bin %> <%= command.id %> \"Rename field from location to address\"",
"description": "Create a new migration with the provided title, prompting for options"
}
],
"flags": {},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "migration:create",
"pluginAlias": "@sanity/migrate",
"pluginName": "@sanity/migrate",
"pluginType": "core",
"strict": true,
"isESM": true,
"relativePath": [
"dist",
"commands",
"migration",
"create.js"
]
},
"migration:list": {
"aliases": [],
"args": {},
"description": "List available migrations",
"examples": [
{
"command": "<%= config.bin %> <%= command.id %>",
"description": "List all available migrations in the project"
}
],
"flags": {},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "migration:list",
"pluginAlias": "@sanity/migrate",
"pluginName": "@sanity/migrate",
"pluginType": "core",
"strict": true,
"isESM": true,
"relativePath": [
"dist",
"commands",
"migration",
"list.js"
]
},
"migration:run": {
"aliases": [],
"args": {
"id": {
"description": "ID",
"name": "id",
"required": false
}
},
"description": "Run a migration against a dataset",
"examples": [
{
"command": "<%= config.bin %> <%= command.id %> <id>",
"description": "dry run the migration"
},
{
"command": "<%= config.bin %> <%= command.id %> <id> --no-dry-run --project xyz --dataset staging",
"description": "execute the migration against a dataset"
},
{
"command": "<%= config.bin %> <%= command.id %> <id> --from-export=production.tar.gz --no-dry-run --project xyz --dataset staging",
"description": "execute the migration using a dataset export as the source"
}
],
"flags": {
"api-version": {
"description": "API version to use when migrating. Defaults to v2024-01-29.",
"name": "api-version",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"concurrency": {
"description": "How many mutation requests to run in parallel. Must be between 1 and 10. Default: 6.",
"name": "concurrency",
"default": 6,
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"confirm": {
"description": "Prompt for confirmation before running the migration (default: true). Use --no-confirm to skip.",
"name": "confirm",
"allowNo": true,
"type": "boolean"
},
"dataset": {
"description": "Dataset to migrate. Defaults to the dataset configured in your Sanity CLI config.",
"name": "dataset",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"dry-run": {
"description": "By default the migration runs in dry mode. Use --no-dry-run to migrate dataset.",
"name": "dry-run",
"allowNo": true,
"type": "boolean"
},
"from-export": {
"description": "Use a local dataset export as source for migration instead of calling the Sanity API. Note: this is only supported for dry runs.",
"name": "from-export",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"progress": {
"description": "Display progress during migration (default: true). Use --no-progress to hide output.",
"name": "progress",
"allowNo": true,
"type": "boolean"
},
"project": {
"description": "Project ID of the dataset to migrate. Defaults to the projectId configured in your Sanity CLI config.",
"name": "project",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "migration:run",
"pluginAlias": "@sanity/migrate",
"pluginName": "@sanity/migrate",
"pluginType": "core",
"strict": true,
"isESM": true,
"relativePath": [
"dist",
"commands",
"migration",
"run.js"
]
}
},
"version": "5.2.0"
}