---
title: datasources push
description: Uploads datasources and their entries from a local directory to a Storyblok space.
url: https://www.storyblok.com/docs/tooling/cli/datasources-push
---

# 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

-   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.

## Usage

```bash
storyblok datasources push [flags]
```

## 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>`. |

> [!TIP]
> To sync datasources between spaces, `pull` them from the origin space and then `push` them with `--space` set to the target space and `--from` set to the origin space.

## Examples

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

```bash
# 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-*"
```

## Pagination

-   [Previous: datasources pull](/docs/tooling/cli/datasources-pull)
-   [Next: languages pull](/docs/tooling/cli/languages-pull)
