Skip to content

datasources push

Uploads datasources and their entries from a local directory to a Storyblok space. The command will create new datasources and entries or update existing ones based on name matching.

  • The command expects datasources that have previously been pulled from a space using datasources pull.
  • Any flags used with datasources pull prior (such as --suffix or --separate-files) need to be applied with the same values when pushing to ensure the files are found correctly.
Terminal window
storyblok datasources push [flags]
Flag Type Description
--space integer Required. The ID of the Storyblok space to push datasources to.
--from, -f integer Optional. The ID of the source space from which the datasources were originally pulled. If not provided, the origin space equals the target space specified via --space.
--filter, -fi string Optional. Glob pattern to filter datasources by their name (e.g., colors* will match all datasources starting with colors).
--separate-files, -sf boolean Optional. Read datasources from individual files, rather than a consolidated datasources.json file.
--suffix, -su string Optional. Specify a custom suffix for datasource files.
--path, -p string Optional. Specify a custom path for datasource files. Defaults to .storyblok/datasources/<space-id>.

The following examples assume that a space has been defined in a configuration file.

Terminal window
# Push all datasources to a space
storyblok datasources push --from 654321
# Push all datasources to a space, reading each from a separate file with a custom suffix
storyblok datasources push --from 654321 --separate-files --suffix dev
# Push all datasources to a space, filtering by datasource name
storyblok datasources push --filter "colors-*"

Was this page helpful?

What went wrong?

This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.