Dev/QA/Prod Schema & Data Migration Best Practices:
- Schema changes made in Dev/Staging may be promoted to other envs via:
- API Schema | Directus Docs
- Use Custom Migrations: (node.js sql migrations)
- Open Source Utilities: (Use and/or Adapt to your needs)
- Directus Labs Team: extensions/packages/migration-bundle at main · directus-labs/extensions · GitHub
- Directus Labs Team: GitHub - directus-labs/directus-template-cli: Apply "templates" to a new, empty Directus project.
- Popular Community Project: GitHub - tractr/directus-sync: A CLI tool for synchronizing the schema and configuration of Directus across various environments.
- In general, recommend managing all production content(draft → … → published) in Prod
- Use data fields (status, dates, category, etc) with Policy Permissions, Content Versioning, Item Duplication and/or Flows to control publishing process and procedures
- NOTE: This is just a general recommendation
- You may also use flows, hooks, custom migrations, scripts or any other means to trigger pipeline changes from one environment to another using any of the resources, utilities referenced here.
- New content data changes as part of data model updates promoting to other envs – several options here:
- Use Data Studio or APIs to export and import (csv, json, xml)
- Import Export | Directus Docs
- Utilities | Directus Docs
- Any other direct API calls as needed, including system tables
- Use Custom Extensions Migrations
- Direct Database export/import (csv)
- Use for content data or system table data(be careful here, but useful for some things)
- Use Data Studio or APIs to export and import (csv, json, xml)