A Directus extension for synchronizing schema, configuration, and selected data between Directus instances. Version 3.3.2 is the latest stable release, supporting Directus 33, 34, and 35. It splits the schema file into per-collection files for better Git management, and can auto-import/export on startup using a locking mechanism. Unlike built-in Directus snapshots, this extension supports syncing custom data like permissions, flows, dashboards, and user-defined collections. It requires the @directus/api peer dependency and uses a configuration file to define which collections to sync.
npm install directus-extension-schema-syncNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install the extension, initialize the config and database tables, export current schema/data, then set SCHEMA_SYNC to auto-import on startup.
For Directus <11, install directus-extension-schema-sync@2.x instead.
Set SCHEMA_SYNC to IMPORT in production to avoid concurrent export/import conflicts.
Ensure Directus is fully initialized or create a settings row before running schema-sync.
Add volume mapping: - ./schema-sync:/directus/schema-sync in docker-compose.
Always include --force when running the install command for the first time.
Follow the npm or Docker installation instructions in the README.
Run: npm install directus-extension-schema-sync
Use: npx directus schema-sync export
Set environment variable: export SCHEMA_SYNC=IMPORT (or EXPORT/BOTH)
Ensure Directus is running and a settings row exists, or run the install command.