Coder Social home page Coder Social logo

directus-migrator's Introduction

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)

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,schema,flows ]
permissions boolean --permissions or -p Only migrate permissions [ can be combined with roles,schema,flows ]
schema boolean --schema or -c Only migrate schema [ can be combined with roles,permissions,flows ]
flows boolean --flows or -l Only migrate flows [ can be combined with roles,permissions,schema ]
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

Authors

CodingButter - Initial work - CodingButter

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

License

MIT License © CodingButter

directus-migrator's People

Contributors

codingbutter avatar iddar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.