A Command-Line tool to simply migrate Directus Schemas,Roles and Permissions between different environments within your project
As of right now directus-migrator does not migrate from sqlite to postgress
These instructions will explain how to use the basic directus-migrator command and which arguments are required
No installation neccessary. just run the following command from within the project root
npx directus-migrator -init
example
const config = {
environments:[
{
"name": "development",
"endpoint": "<development-url>",
"accessToken": "<development_admin_token>"
},
{
"name": "staging",
"endpoint": "<staging-url>",
"accessToken": "<staging_admin_token>"
}
]
}
export default config
npx directus-migrator -s development -t production
If your environments are not on the exact same version of directus you may need to force the migration with the -force flag
npx directus-migrator -f -s development -t staging
Supported options
npx directus-migrator --argument [value]
when adding boolean flags make sure to use --fullFlagName
or
-alias
(eg. --init or -i)
Name | Type | usage | Description |
---|---|---|---|
init |
boolean | --init or -i |
Initialize config file |
force |
boolean | --force or -f |
Force migration between directus versions |
roles |
boolean | --roles or -r |
Only migrates roles [ can be combined with permissions and schema ] |
permissions |
boolean | --permissions or -p |
Only migrate permissions [ can be combined with roles and schema ] |
schema |
boolean | --schema or -c |
Only migrate permissions [ can be combined with roles and permissions ] |
help |
boolean | --help or -h |
Display help menu |
source |
string | --source envname or -s envname |
Environment to migrate from |
target |
string | --target envname or -t envname |
Environment to migrate to |
CodingButter - Initial work - CodingButter
See also the list of contributors who participated in this project.
MIT License © CodingButter