Ahmad Awais

NAVIGATE


SHARE


Introducing CEM CLI | Move From cPanel to EasyEngine With Ease

Ahmad AwaisAhmad Awais

TL;DR:ย CEM 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 and 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
  2. Click Backup, then Full Backup and finally click on Generate Backup
  3. Once the backup is generated, go to File Manager
  4. Rename the backup file to something simple like bc.tar.gz
  5. Move the backup file to /public_html/ folder
  6. Set the world read permission so that it can be downloaded via wget

You can watch all these steps in this short video which can be found 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 helps 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 a 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#


๐Ÿ™Œ THEDEVCOUPLE PARTNERS#

This open source project is maintained by the help of awesome businesses listed below. What? Read more about it โ†’

For anything else, tweet at @MrAhmadAwais

I have released a video course to help you become a better developer โ€” Become a VSCode Power User โ†’



VSCode

_VSCode Power User Course โ†’_

?ย 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.

I help businesses understand developers ๐Ÿ“Ÿ Currently recording Node.js CLI Automation Course ๐Ÿ‘จโ€๐Ÿซ Edutainer at VSCode.pro ๐ŸŽฉ An award-winning open-source engineer and developer advocate ๐ŸฆŠ Google Developers Expert for web ๐ŸŒณ Node.js foundation Community Committee member โœŒ๏ธ Author of various open-source dev-tools and software libraries used by millions of developers worldwide โ“ฆ WordPress Core Developer ๐Ÿ“ฃ TEDx Speaker ๐Ÿ™Œ Leading developers and publishing technical content for over a decade ๐Ÿ˜‚ Self-confessed tech comedian cracking silly jokes in the JavaScript web and cloud communities ๐Ÿ’œ Loves his wife (Maedah) โฏ Learn more about Awais โ†ฃ

Say ๐Ÿ‘‹ on Twitter @MrAhmadAwais | Subscribe to the Developers Takeaway!

๐Ÿ“จ

Developers Takeaway

Takeaway my professional opinion on open-source, developer relations, growing your business with family, and everything in between! Delivered to your inbox a couple of times every year. I'm even funny at times. I hate spam โ€” pinky-promise!

๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป 115,834 Developers Already Subscribed