Socket
Socket
Sign inDemoInstall

migrateful

Package Overview
Dependencies
139
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    migrateful

A migration manager for the Contenful platform


Version published
Weekly downloads
11
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Migrateful

Migrateful is a migration manager for the Contentful platform.

  • Represent your data schemas in code
  • Automatically pick up and apply migration scripts
  • Version releases for easy rollback
  • Separate environments for prod, dev, and features
  • No installation necessary

Motivation

Contentful has nice SDK's in place for cloning environments and running migrations scripts. However, these are somewhat low-level. You can either run each migration script by hand or create your own versioning system.

Migrateful gives you a complete migration system out of the box. It is designed based on Contentful's scripting guide with a few more conveniences built in. Just create a new Contentful space, drop in your migration scripts, and run npx migrateful.

Setup the space

You will need the SpaceID and a personal access token

  • Create an empty Space

    • Go to Organization settingsAdd space
    • Name your space and select Empty space
    • In the new space, go to SettingsGeneral settings
    • Copy the Space ID
  • Create a personal access token

    • Go to SettingsAPI keysContent management tokens
    • Click Generate personal token
    • Name the token and copy the key
  • Opt into the master alias

    • Go to SettingsEnvironments
    • Click Set up your first alias
    • It will ask to rename the master environment ... say yes

Usage

Put all of your contentful migration scripts in a folder called migrations. Name them using the format {version}-{name}.js. For example, you might have 01-init.js, 02-add-post-type.js, 03-add-title-field.js.

Run the following command, where <env> is your environment name. For your prod environment, this can be either master or main. For a dev or feature environment, you can name it whatever your want. A new environment will be created and the migrations will be applied.

npx migrateful <env>

Migrateful will read your space ID and access token from the environment.

export CONTENTFUL_SPACE_ID=<spaceId>
export CONTENTFUL_ACCESS_TOKEN=<token>

Keywords

FAQs

Last updated on 27 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc