1. Home
  2. News
  3. CMS Move - automated CMS deployment

CMS Move - automated CMS deployment

news announcement ExpressionEngine WordPress Craft CMS Laravel

We've been working on a simple tool to help use migrate websites from one environment to another. Now, although there are a LOT of tools out there, none quite fit our needs, so we built one!!

Introducing CMS Move! A simple to to help you migrate your site. We've been working with the tool for our ExpressionEngine, Craft CMS and Laravel builds.

It has not yet been extensively tested on WordPress, so please feel free to try it out and report back with any issues. Or, make a pull request! We'd love to get some community input/help to make this a better tool. We've also made it super simple to extend, so adding your favorite CMS of choice is simple (GitHub wiki coming soon).

CMS Move is built on-top of the wonderful Symphony Console Component, offering an awesome command line interface for easily issuing commands for all the tedious tasks associated with moving site files and updates around.

We hope you find it useful!!

Here's an example of how to get up and running quickly with Craft:

composer global require "sparkison/cmsmove"

Now you should be able to issue the "cmsmove" command from your terminal. The next step is to bootstrap a config! To do that, CD into one of your project directories

cd ~/Sites/mysite.dev

Then issue the config commands for the desired environment (currently supported options are "craft", "laravel53", "ee2", "ee3", and "wordpress") 

cmsmove config craft

Now you should see two new files created, "moveConfig.json" and "rsync.ignore". The "moveConfig.json" file is used to configure your local and remote locations, while the "rsync.ignore" file contains all of the files/directories you want to ignore during a push/pull operation.

Note that each time you do a database push or pull a copy will be made of whichever environment DB is being overwritten to ensure you can rollback if needed. We have not yet implement an automated procedure for this, but that is in the roadmap!

An example of the generated "moveConfig.json" file

 
{
  "type": "craft",
  "mappings": {
    "app": "craft",
    "www": "public",
    "config": "config",
    "plugins": "plugins",
    "templates": "templates",
    "custom": {
      "uploads": {
        "type": "public",
        "directory": "uploads"
      },
      "assets": {
        "type": "public",
        "directory": "dist"
      }
    }
  },
  "environments": {
    "local": {
      "root": "/Users/MY_USER_NAME/Sites/mysite.dev",
      "db": "local_db_dev",
      "dbHost": "localhost",
      "dbUser": "root",
      "dbPass": "root",
      "dbPort": "3306"
    },
    "staging": {
      "host": "REMOTE HOST OR IP",
      "root" : "/home/user",
      "public": "public_html",
      "user": "SSH USER NAME",
      "password": "SSH PASSWORD",
      "keyfile": "SSH KEY FILE (takes precedence over the password field)",
      "port": "22",
      "db": "REMOTE DATABASE NAME",
      "dbHost": "localhost",
      "dbUser": "REMOTE DATABASE USER",
      "dbPass": "REMOTE DATABASE PASSWORD",
      "dbPort": "3306"
    },
    "production": {
      "host": "",
      "root" : "/home/mysite",
      "public": "public_html",
      "user": "",
      "password": "",
      "keyfile": "",
      "port": "22",
      "db": "",
      "dbHost": "localhost",
      "dbUser": "",
      "dbPass": "",
      "dbPort": "3306"
    }
  }
}

Some useful commands

Craft CMS

cmsmove push staging templates Pushes craft/templates to the configured staging environment

cmsmove push staging config Pushes the craft/config to the configured staging environment

cmsmove push staging app Pushes the craft to the configured staging environment

cmsmove push staging www Pushes the public to the configured staging environment

cmsmove push staging plugins Pushes the craft/plugins to the configured staging environment

Laravel

cmsmove push staging all Pushes it all to the configured staging environment

cmsmove push staging config Pushes the config folder to the configured staging environment

cmsmove push staging app Pushes the app to the folder configured staging environment

cmsmove push staging www Pushes the public to the folder configured staging environment

cmsmove push staging routes Pushes the to the folder configured staging environment

cmsmove push staging resources Pushes the resources folder to the configured staging environment

cmsmove push staging migrations Pushes the database/migrations folder to the configured staging environment

cmsmove push staging storage Pushes the storage folder to the configured staging environment

cmsmove push staging core Pushes app, www, config, database, resources, routes, and vendor folders, all in one go!

All CMS

cmsmove push staging database Will pull down a backup of the staging database, gzip it up and store it locally in the project "db_backups" folder, push the local database up to staging and then import it.

We'd love to hear your input to help make this a better tool for all! Feel free to let us know how this works for you, or if it doesn't. What could be better, etc.

CMS Move GitHub page


Comments

comments powered by Disqus