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.

Founder & CEO at Langbase.com Β· Ex VP DevRel Rapid Β· Google Developers Advisory Board (gDAB) founding member. πŸ§‘β€πŸ’» AI/ML/DevTools Angel Investor ❯ AI/ML Advisory Board member San Francisco, DevNetwork

🎩 Award-winning Open Source Engineer & Dev Advocate 🦊 Google Developers Expert Web DevRel πŸš€ NASA Mars Ingenuity Helicopter mission code contributor πŸ† 8th GitHub Stars Award recipient with 3x GitHub Stars Award (Listed as GitHub's #1 JavaScript trending developer).

🌳 Node.js foundation Community Committee Outreach Lead, Member Linux Foundation, OpenAPI Business Governing Board, and DigitalOcean Navigator. πŸ“Ÿ Teaching thousands of developers Node.js CLI Automation (100 videos Β· 22 Projects) & VSCode.pro course. Over 142 Million views, 22 yrs Blogging, 56K developers learning, 200+ FOSS.

✌️ Author of various open-source dev-tools and software libraries utilized by millions of developers worldwide ⓦ WordPress Core Developer πŸ“£ TEDx Speaker with 100+ international talks.

✨ As quoted by: Satya Nadella Β· CEO of Microsoft β€” Awais is an awesome example for developers.
πŸ™Œ Leading developers and publishing technical content for over a decade πŸ’œ Loves his wife (Maedah) ❯ Read more about Ahmad Awais.

πŸ‘‹β€¦ Awais is mostly active on Twitter @MrAhmadAwais

πŸ“¨

Developers Takeaway

Stay ahead in the web dev community with Ahmad's expert insights on open-source, developer relations, dev-tools, and side-hustles. Insider-email-only-content. Don't miss out - subscirbe for a dose of professional advice and a dash of humor. No spam, pinky-promise!

✨ 172,438 Developers Already Subscribed
Comments 2
  • 007
    Posted on

    007 007

    Reply Author

    what do you use to make 2 min long gif?


    • Ahmad Awais
      Posted on

      Ahmad Awais Ahmad Awais

      Reply Author

      I have a little workflow for that as well. It goes from recording everything in ScreenFlow and using three Node packages to convert and optimize it into a GIF. I’ll write about it here.