sb-mig
Reference

Command Matrix

Coverage checklist for every public sb-mig command form and option family.

Command matrix

This page is the coverage checklist for the public CLI surface in sb-mig@6.2.0-beta.1.

Top level

Command formReads StoryblokWrites filesWrites Storyblok
sb-migNoNoNo
sb-mig --helpNoNoNo
sb-mig helpNoNoNo
sb-mig <command> --helpNoNoNo
sb-mig --versionNoNoNo

sync

Command formRequired selectorOptional flagsWrites Storyblok
sb-mig sync components --all--all--presets, --dry-runYes unless --dry-run
sb-mig sync components --all --ssot--all --ssot--presets, --dry-run, --yesYes unless --dry-run; destructive
sb-mig sync components <component...>component names--presets, --packageName, --dry-runYes unless --dry-run
sb-mig sync roles --all--all--dry-runYes unless --dry-run
sb-mig sync roles <role...>role names--dry-runYes unless --dry-run
sb-mig sync datasources --all--all--dry-runYes unless --dry-run
sb-mig sync datasources <datasource...>datasource names--dry-runYes unless --dry-run
sb-mig sync plugins <plugin...>plugin names--dry-runYes unless --dry-run
sb-mig sync content --all--all--from, --to, --syncDirection, --dry-run, --yesDepends on direction
sb-mig sync content --stories--stories--from, --to, --syncDirection, --dry-run, --yesDepends on direction
sb-mig sync content --assets--assets--from, --to, --syncDirection, --dry-runDepends on direction

Content sync directions:

DirectionValid withDestructive behavior
fromSpaceToFile--all, --stories, --assetsNo target deletion; writes local backup files.
fromFileToSpace--all, --stories for stories; assets not implementedNon-dry story sync backs up and deletes target stories before write.
fromSpaceToSpace--all, --stories, --assetsNon-dry story sync backs up and deletes target stories before write.
fromAWSToSpace--stories; --all calls story path and unsupported asset pathImports Content Hub/AWS story data into target space.

migrate

Command formRequired selectorOptional flagsWrites Storyblok
sb-mig migrate content --all--all, --migration--from, --to, --withSlug, --startsWith, --migrate-from, --fromFilePath, --publicationMode, --publicationLanguages, --languagePublishStatePath, --migrationComponentAlias, --migrationComponents, --fileName, --dry-run, --yesYes unless --dry-run
sb-mig migrate presets --all--all, exactly one --migration--from, --to, --migrate-from, --fromFilePath, --migrationComponentAlias, --migrationComponents, --fileName, --dry-run, --yesYes unless --dry-run
sb-mig migrate continuenone (auto-discovers the dry-run manifest)--manifest, --yesYes (replays a prior content --dry-run)

Content migration constraints:

CombinationStatus
--publicationMode preserve-layers --from A --to AValid. Default and safest in-place production mode.
--publicationMode preserve-layers --from A --to BRejected. Preserve-layers currently requires same source and target space.
--publicationMode preserve-layers --migrate-from fileRejected. Preserve-layers needs Story Versions API access from a source space.
--publicationMode collapse-draft --publicationLanguages default,fr,deValid. Publishes selected languages for stories/languages that were publishable in source state.
--publicationMode save-onlyValid. Saves only and never publishes.
--publicationMode save-only --publicationLanguages ...Rejected. Save-only does not publish languages.
--publicationMode save-only --languagePublishStatePath ...Rejected. Save-only does not use publish-state maps.
--publish, --publishLanguages, --preservePublishedLayerRejected legacy flags.
migrate content <component-name...>Help lists this form, but current built 6.1.1-beta.1 rejects it. Use --all --migrationComponents <migration>:<component...>.

Preset migration constraints:

CombinationStatus
one --migrationValid.
multiple --migration valuesRejected for presets.
--publicationModeRejected for presets.
--publicationLanguagesRejected for presets.
--languagePublishStatePathRejected for presets.

inspection

Beta: Needle in a haystack

applies to inspect component-usage.

Command formRequired selectorOptional flagsWrites Storyblok
sb-mig inspect component-usage --from <space> --all --query <query>--all, --query--outputPathNo
sb-mig inspect component-usage --from <space> --withSlug <slug> --query <query>one or more --withSlug, --query--outputPathNo
sb-mig inspect component-usage --from <space> --startsWith <prefix> --query <query>--startsWith, --query--outputPathNo
sb-mig language-publish-state --from <space>--from--accessToken, --languages, --withSlug, --startsWith, --fileName, --outputPathNo
sb-mig story-versions --from <space> --storyId <id>--from, --storyId--showContent, --page, --perPage, --raw, --outputPathNo
sb-mig story-versions --from <space> --withSlug <slug>--from, --withSlug--showContent, --page, --perPage, --raw, --outputPathNo
sb-mig published-layer-export --from <space> --all--from, one selector--fileName, --outputPath, --versionsPerPage, --maxVersionPagesNo
sb-mig published-layer-export --from <space> --storyId <id>--from, one or more --storyId--fileName, --outputPath, --versionsPerPage, --maxVersionPagesNo
sb-mig published-layer-export --from <space> --withSlug <slug>--from, one or more --withSlug--fileName, --outputPath, --versionsPerPage, --maxVersionPagesNo
sb-mig published-layer-export --from <space> --startsWith <prefix>--from, --startsWith--fileName, --outputPath, --versionsPerPage, --maxVersionPagesNo

Inspection constraints:

CombinationStatus
inspect component-usage --query <query> --allValid. Scans all non-folder stories.
inspect component-usage --query <query> --withSlug <slug>Valid. --withSlug is repeatable.
inspect component-usage --query <query> --startsWith <prefix>Valid. Scans non-folder stories under a prefix.
inspect component-usage --all --withSlug <slug>Rejected. Pass exactly one story selection mode.
inspect component-usage --all --startsWith <prefix>Rejected. Pass exactly one story selection mode.
inspect component-usage without --queryRejected. Query file name or path is required.
inspect component-usage --dry-runNot supported. The command is already read-only.

backup, revert, remove

Command formRequired selectorOptional flagsWrites Storyblok
sb-mig backup components --all--allnoneNo
sb-mig backup components <component>component namenoneNo
sb-mig backup component-groups --all--allnoneNo
sb-mig backup component-groups <group>group namenoneNo
sb-mig backup roles --all--allnoneNo
sb-mig backup roles <role>role namenoneNo
sb-mig backup datasources --all--allnoneNo
sb-mig backup datasources <datasource>datasource namenoneNo
sb-mig backup presets --all--allnoneNo
sb-mig backup presets <preset-id>preset IDnoneNo
sb-mig backup component-presets --all--all--metadataNo
sb-mig backup component-presets <component>component namenoneNo
sb-mig backup plugins --all--allnoneNo
sb-mig backup plugins <plugin>plugin namenoneNo
sb-mig backup stories --all--allnoneNo
sb-mig revert content --from <file> --to <space>--from, --to--yesYes
sb-mig remove components --all--allnoneYes
sb-mig remove components <component...>component namesnoneYes
sb-mig remove story --all --from <space>--all, --fromnoneYes, destructive and no prompt
sb-mig remove rolesnonenoneNo-op warning
sb-mig remove datasourcesnonenoneNo-op warning

utilities

Command formRequired selectorOptional flagsWrites Storyblok
sb-mig copy stories --source <story> --destination <folder>--source--from, --to, --destination, --mode, --dry-run, --outputPathYes unless --dry-run
sb-mig copy stories --source <folder> --destination <folder>--source--from, --to, --destination, --mode, --dry-run, --outputPathYes unless --dry-run
sb-mig copy stories --source <folder>/* --destination <folder>--source--from, --to, --destination, --dry-run, --outputPathYes unless --dry-run
sb-mig copy assets --all--all--from, --to, --dry-run, --outputPathYes unless --dry-run
sb-mig copy assets --asset <id-or-file>--asset--from, --to, --dry-run, --outputPathYes unless --dry-run
sb-mig copy assets --assetFolder <id-or-path>--assetFolder--from, --to, --dry-run, --outputPathYes unless --dry-run
sb-mig copy assets --referenced-by-stories --source <story-or-folder>--referenced-by-stories, --source--from, --to, --mode, --dry-run, --outputPathYes unless --dry-run
sb-mig discover components --all--all--write, --fileNo
sb-mig discover migrations --all--allnoneNo
sb-mig migrations recognize --from <version>--from--toNo
sb-mig init project --spaceId <id> --oauthToken <token> --region <region>--spaceId, --oauthToken, --region--gtmTokenYes
sb-mig debugnonenoneNo

On this page