Ahmad Awais

Senior Full Stack WordPress developer — WP Core Contributor — Front-end Fanatic — Accidental Writer. I love to write, talk, build, and share everything about WordPress. You can find me making small automation scripts for DevOps stuff or toying around with WP Business ideas. Let's catch up at Twitter @MrAhmadAwais.

Newsletter sign up


SHARE


Introducing CEM CLI | Move From cPanel to EasyEngine With Ease

Ahmad AwaisAhmad Awais

TL;DRCEM CLI is a cPanel to EasyEngine Migration CLI. It’s quite new at the moment and is meant to automate bits of the repetitive tasks that one has to go through while migrating their sites from a cPanel based shared hosting (with no SSH access) to an EasyEngine based rented self-managed VPS.

I Love Automation — Workflow Optimist!

I had a few small low-traffic sites sitting on a shared hosting account with cPanel (no SSH access) for quite some time now. I have been meaning to transfer them to a self-managed cloud but it’s hard to find enough time these days.

Anywho, I have tried EasyEngine script (built by rtCamp) in the past and I liked everything about it. So, I ended up building a migration CLI which BTW can also be used as a command line tool to build a staging website for a website you host on a shared server.

I am an end to end product developer. Three years ago, I started to pick up on what we call DevOps.

DevOps (a clipped compound of development and operations) is a culture, movement or practice that emphasizes the collaboration and communication of both software developers and other information-technology (IT) professionals while automating the process of software delivery and infrastructure changes. — Wikipedia.

I have always been a workflow-optimist. What that means is whenever I have to perform a task repeatedly, I find a way to make it more efficient, which in turn means automation, and hence I always end up building a pro workflow for that task.

I guess developers are like that. We hate repetitive nature of any process. I do. I believe that software development is not just my career — it’s a way of life.

More often than not I find myself in an if/else-if/else situation, whenever life throws a curveball I end up with switch-case, and then there are these things in my life which have a repetitive nature — Maybe it is my OCD (Obsessive-Compulsive Disorder) that compels me to do what I do — but then I start thinking about the repetitive task at hand, I study its patterns and then I try to automate it as much as I can.

That’s exactly how CEM CLI came into being.

Do you have OCD? Does the need of keeping things in check sound familiar? Do you build little workflows — tell me about that in the comments below.

Anywho, let’s get to the CEM CLI part before I start talking more about my OCD.

Introducing CEM CLI

CEM CLI

cPanel to EasyEngine Migrate CLI (CEM CLI) is a bash script built to help people migrate their sites from a cPanel to a rented VPS with EasyEngine installed on it.

CEM CLI

Pre-requisite

You need to rent a VPS with EasyEngine installed on it. Here’s the list.

Using CEM CLI

After you have completed the pre-requisite steps, all you need to do is download and run the cPanel-EasyEngine-Migrate-CLI. You can do that by running the following commands.

Download cPanel-EasyEngine-Migrate-CLI

sudo wget -qO cemcli https://git.io/vPO0q && sudo chmod +x ./cemcli && sudo install ./cemcli /usr/local/bin/cemcli

Run cPanel-EasyEngine-Migrate-CLI

cemcli

To Uninstall cPanel-EasyEngine-Migrate-CLI

rm /usr/local/bin/cemcli

Running this CLI will output several questions on your terminal, each question comes with an example value enclose with square brackets [] just fill up the answers and you’ll be able to automate bits of the complete migration process.

How To?

Yes, I get that. This script is quite opinionated and in the beta stage. While I have released v1.0.0 it still needs to be tested and I plan to maintain and grow it. If you are wondering how it works, here’s a step by step guide.


Step #1: VPS

Rent a VPS preferably with Ubuntu 16.04 x64 OS (I recommend Vultr.com | During summer, by using my affiliate link you get $20 Signup Bonus or if you prefer non-affiliate link)


Step #2: EasyEngine

Install EasyEngine just run this command after logging into your VPS with SSH wget -qO ee rt.cx/ee && sudo bash ee


Step #3: Backup

Take a backup of your cPanel. I prefer taking a complete backup and that’s how this script works. 1. Go to your site’s cPanel > Backup Wizard

  1. Click Backup, then Full Backup and finally click on Generate Backup
  2. Once the backup has been generate, go to File Manager
  3. Rename the backup file to something simple like bc.tar.gz
  4. Move the backup file to /public_html/ folder
  5. Set the world read permission so that it can be downloaded via wget

You can watch all these steps in this short video present at the end of these steps.


Step #4: Run CEM CLI


Step #5: What you need to know!

While the CLI migrates your site for you, this following things happen.


Step #6: Watch How It’s Done

You can either try to guess how it’s done with the GIF below or Watch a 2 min video on YouTube.

CEM CLI QUICK GIF

What Does Future Hold for CEM CLI?

While CEM CLI is no where near an ideal script, it’s helping me migrate/stage my sites on self-managed VPS. I plan to improve this script by adding several new routines to it. Following is a list of ideas that I have.

Disclaimer (Beta Software)

Make sure to test this CLI on new server. It is beta and completely new. I have tested it to transfer my cPanel sites to an EasyEngine VPS (based on Ubuntu 16.04 x64) while working on a Mac. Use at your own risk 🤔.

Changelog

Version 1.1.1 — 2016-10-09

Version 1.1.0 — 2016-10-05

Version 1.0.1 to 1.0.9 — 2016-10-04

Version 1.0.1 — 2016-10-04

Version 1.0.0 — 2016-09-25

? Looking forward to the feedback and contribution from your end. That’s how we can make it something more worthwhile. Let’s collaborate at GitHub.
✔︎ Did you like CEM CLI? It’d be great if you can share it on Twitter.

TAKEAWAY: Subscribe to My Newsletter!

Takeaway my professional opinion about Full Stack WordPress Development and Front-end Design! Delivered to your inbox once a week. Promise! I hate spam.

Senior Full Stack WordPress developer — WP Core Contributor — Front-end Fanatic — Accidental Writer. I love to write, talk, build, and share everything about WordPress. You can find me making small automation scripts for DevOps stuff or toying around with WP Business ideas. Let's catch up at Twitter @MrAhmadAwais.