Pulling
Pulling snapshots a source instance into the committed files that diff and push later apply:
d6s sync pull --from staging
What a default pull exports
A pull touches two axes, and the success output reports each:
◇ Pulled from staging — https://staging.example.com
Schema 24 collections → directus/default/schema
Resources 206 records in 10 resources → directus/default/data
Exact counts depend on your project.
- Schema: a full snapshot of every collection, field, and relation, including custom fields on system collections and collection folders.
- Resources: records of 10
directus_*configuration resource types, listed below.
Users and translations are excluded by default. Opt in with --users and --translations, or --all.
Configuration resources
Resource selection follows a dependency graph: selecting a resource pulls in what it needs.
| Resource | In default pull | Select directly | Pulls in | Notes |
|---|---|---|---|---|
roles | Yes | --roles | policies | |
policies | Yes | --policies | access, permissions | See the warning below before selecting policies on their own. |
access | Yes, with roles and policies | — | — | Grants attached to users are dropped when users are out of scope; a mirror push does not delete them on the target. |
permissions | Yes, with policies | — | — | Row counts are verified against the server. If the source hides rows (unlicensed custom permission rules), the export is marked incomplete. |
flows | Yes | --flows | operations | |
operations | Yes, with flows | — | — | |
dashboards | Yes | --dashboards | panels | |
panels | Yes, with dashboards | — | — | Panels have no natural key, so a first push into a matching target can duplicate once; the id map prevents repeats. |
settings | Yes | --settings | — | Singleton. License and AI credentials, branding images (logos, backgrounds, favicon), and the default storage folder are stripped. |
folders | Yes | --folders | — | The media-library folder tree. Distinct from collection folders (Data Studio sidebar groups), which sync as schema. |
users | Opt-in | --users | roles, policies | Secret columns (password, token, tfa_secret, and others) are stripped. |
translations | Opt-in | --translations | — | Mirror pushes of translations are not currently supported, which is why they are opt-in. |
--roles, not --policies alone
A selection that pulls policies without roles is not independently pushable when access rows reference roles: access rows carry role foreign keys, and with no roles in scope a push to a fresh target fails. Select --roles instead; it pulls policies and their children too.Selecting resources
Three ways to change the default set:
- Positive selection:
--flows --rolesnarrows the pull to those resources plus their dependencies. - Subtraction:
--no-flowskeeps the default set and removes flows. - Everything:
--alladdsusersandtranslationson top of the default set.
Positive selections cannot be combined with --all or with --no- subtractions.
Resource selection changes only the resources axis: a pull with --flows still snapshots the full schema. Schema has its own scoping.
Scoping the schema
d6s sync pull --from staging --collections articles,authors
The Schema line reads (scoped to: articles, authors) and only those collections' schema files refresh. --exclude-collections inverts the scope: snapshot everything except the named collections.
Two warnings a scoped pull can raise:
- Out-of-scope references. If the scoped snapshot points at something you omitted (a relation target, a group parent, a many-to-any collection), the pull warns, because pushing that snapshot to a fresh target can fail. It warns; it never widens the scope for you. Add the missing collections to
--collectionsyourself. - A name the server didn't return. A
--collectionsname absent from the returned snapshot (usually a typo) draws a warning naming the gap. The partial snapshot still commits, but never silently.
Skipping schema entirely
Schema and resources are independent axes, and resource selection never narrows the schema snapshot. To make a configuration-only project explicit, opt out of schema:
d6s sync pull --from staging --no-schema
To make it permanent, set "schema": false on the project in directus.config.json. Such a project carries no schema authority: pull skips the snapshot, and push and diff for that project never touch schema. Reports say schemaSkipped, so automation can tell a skipped phase from a matching one. Combining "schema": false with a collections scope is refused as a contradiction.
What a pull touches
Two rules govern every pull, scoped or not:
- A pull only rewrites what it fetched. Everything it did not fetch keeps its committed bytes, untouched.
- A push only applies what is committed. Work that never entered the repository cannot ship.
Refreshed means the file is rewritten from the source; because writes are deterministic, an unchanged resource produces no git diff. Preserved means the file is not touched at all.
| Pull | Schema files | Configuration files |
|---|---|---|
pull --from staging | All refreshed | All refreshed |
... --collections posts | posts refreshed, others preserved | All refreshed |
... --no-flows | All refreshed | Flows preserved, others refreshed |
... --flows | All refreshed (resource selection never narrows schema) | Flows and operations refreshed, others preserved |
... --flows --no-schema | All preserved | Flows and operations refreshed, others preserved |
... --collections posts --no-flows | posts refreshed, others preserved | Flows preserved, others refreshed |
Determinism
Re-running a pull with no instance changes produces byte-identical files and a clean working tree, so git diff after a pull shows exactly what changed on the instance and nothing else: no timestamps, no reordering noise.
Scoped pulls are just as predictable: a scoped or resource-selected pull refreshes only its subset and preserves every other committed file. Scope limits what a pull may replace; it never deletes the rest of your snapshot.
Pull before you push
Next step
With files committed, preview what they would change on a target: Diffing & Pushing.
Get once-a-month release notes & real‑world code tips...no fluff. 🐰
Installation & Profiles
Install the Directus CLI, define a profile for each instance you sync with, and store credentials safely outside your repository.
Diffing & Pushing
Preview what a push would change with a read-only diff, then apply it to a target instance by choosing a push mode, passing the deletion gates, and resolving record identity.