1.4.32 • Published 1 year ago

directus-migrator v1.4.32

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

npm version code style: prettier

Directus Migrator

A Command-Line tool to simply migrate Directus Schemas,Roles and Permissions between different environments within your project

Table of contents

Warning

As of right now directus-migrator does not migrate from sqlite to postgress

Getting Started

These instructions will explain how to use the basic directus-migrator command and which arguments are required

Initilization

No installation neccessary. just run the following command from within the project root

npx directus-migrator -i

cli-init

directus-migrator.config.js

example

const config = {
  environments:[
    {
      "name": "development",
      "endpoint": "<development-url>",
      "accessToken": "<development_admin_token>"
    },
    {
      "name": "staging",
      "endpoint": "<staging-url>",
      "accessToken": "<staging_admin_token>"
    },
    {
      "name": "production",
      "endpoint": "<production-url>",
      "accessToken": "<production_admin_token>",
      "production":true
    },
  ]
}
export default config 

Usage

Basic

npx directus-migrator -s development -t production

Force Migration

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

API

Supported options

Options

npx directus-migrator --argument value

when adding boolean flags make sure to use --fullFlagName or -alias (eg. --init or -i)

NameTypeusageDescription
initboolean--init or -iInitialize config file
forceboolean--force or -fForce migration between directus versions
rolesboolean--roles or -rOnly migrates roles can be combined with permissions,schema,flows
permissionsboolean--permissions or -pOnly migrate permissions can be combined with roles,schema,flows
schemaboolean--schema or -cOnly migrate schema can be combined with roles,permissions,flows
flowsboolean--flows or -lOnly migrate flows can be combined with roles,permissions,schema
helpboolean--help or -hDisplay help menu
sourcestring--source envname or -s envnameEnvironment to migrate from
targetstring--target envname or -t envnameEnvironment to migrate to

Authors

CodingButter - Initial work - CodingButter

See also the list of contributors who participated in this project.

License

MIT License © CodingButter

1.4.24

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.28

1 year ago

1.4.27

1 year ago

1.4.29

1 year ago

1.4.31

1 year ago

1.4.30

1 year ago

1.4.32

1 year ago

1.4.22

1 year ago

1.4.23

1 year ago

1.4.21

2 years ago

1.2.0

2 years ago

1.4.6

2 years ago

1.2.8

2 years ago

1.4.5

2 years ago

1.2.7

2 years ago

1.0.9

2 years ago

1.2.6

2 years ago

1.0.8

2 years ago

1.4.3

2 years ago

1.2.5

2 years ago

1.0.7

2 years ago

1.4.2

2 years ago

1.0.6

2 years ago

1.2.3

2 years ago

1.0.5

2 years ago

1.2.2

2 years ago

1.0.4

2 years ago

1.2.1

2 years ago

1.0.3

2 years ago

1.4.20

2 years ago

1.3.8

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.9

2 years ago

1.3.6

2 years ago

1.1.8

2 years ago

1.3.5

2 years ago

1.1.7

2 years ago

1.3.4

2 years ago

1.1.6

2 years ago

1.3.3

2 years ago

1.1.5

2 years ago

1.3.2

2 years ago

1.1.4

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.1.2

2 years ago

1.4.9

2 years ago

1.4.8

2 years ago

1.4.10

2 years ago

1.4.7

2 years ago

1.2.9

2 years ago

1.4.13

2 years ago

1.4.12

2 years ago

1.4.15

2 years ago

1.4.14

2 years ago

1.4.16

2 years ago

1.4.19

2 years ago

1.4.18

2 years ago

1.0.2

2 years ago