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.
Prerequisites
Section titled “Prerequisites”- The command expects datasources that have previously been pulled from a space using
datasources pull. - Any flags used with
datasources pullprior (such as--suffixor--separate-files) need to be applied with the same values when pushing to ensure the files are found correctly.
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>. |
Examples
Section titled “Examples”The following examples assume that a space has been defined in a configuration file.
# Push all datasources to a spacestoryblok datasources push --from 654321# Push all datasources to a space, reading each from a separate file with a custom suffixstoryblok datasources push --from 654321 --separate-files --suffix dev# Push all datasources to a space, filtering by datasource namestoryblok datasources push --filter "colors-*"Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community