Step By Step Guide to Migrate Magento Store from cPanel to Cloud Hosting

2
19535
Reading Time: 5 minutes

As I write this tutorial, Magento powers 897,226 online stores and the number goes up every hour!

Magento is fast becoming THE CMS for eCommerce businesses mainly because of the flexibility of the platform and the high number of available extensions that extend and enhance the core Magento features. Despite a slight learning curve, Magento is being adopted by everyone from first-time store owners to the veterans of the eCommerce industry.

Now, it is common knowledge that an online business is as good as the hosting solution that powers it. In other words, the hosting makes or breaks an eCommerce store. Magento is well known for its rather high resource requirements and thus, not every type of hosting is ideal for a Magento powered store.

This is a common mistake that many first-timers make. After spending a healthy amount on store development, they host it on a shared hosting server! And then complain about crashed pages and loss of revenue.

Ecommerce is a highly competitive industry and you need every advantage over the competing stores. If you get bogged down in hosting and server management issues, you won’t find time to actually focus on growing your business, building your brand and implement growth hacks.

Almost every successful eCommerce store you encounter is hosted on a cloud-based hosting solution. If you are unaware of how cloud hosting works or whether it’s a good fit for your business, this tutorial is for you.

Why Choose Cloud Hosting

  • Performance: Cloud hosting solution provides a dedicated cloud server that ensures speed and performance for the store.
  • Scalability: Ecommerce stores often require quick scalability of server resources mainly during sales seasons and store campaigns.
  • Costs: The pricing plans might look to be on the pricey side, but in the long run you will be saving money that would otherwise have gone to fixing issues that regularly happen to cheap hosting.
  • Resources: Your cloud server comes with its own allocation of dedicated resources. Coupled with the scalability feature, it is easy to see the benefits of cloud hosting.
  • Security: Cloud hosting has security built into the core processes of cloud hosting. In addition, the servers come with additional security measures such as 2FA, firewalls and anti-malware solutions.
  • Downtime Risk: Because of the super-optimized architecture, cloud servers do actually experience minimum downtime and improved performance.
  • Better Traffic Spikes Handling: Cloud servers, in general, are better prepared for periodic traffic spikes because of several core features that define cloud hosting.

Well, these are just a few benefits that I think make cloud hosting a great fit for your Magento store.

Now, if you are convinced that you would like to move from your current shared hosting to a cloud server, you will find a lot of options in the market. And you will discover the tricky question of managed vs. unmanaged cloud hosting.  Every cloud provider has its own terminology for features and many details on the sales pages doesn’t make a whole lot of sense for many store owners. This is an important reason for the lack of adoption of cloud hosting in the eCommerce industry.

To help Magento store owners, I will now introduce Cloudways, a managed cloud hosting for Magento that offers a super-fast managed to host for eCommerce stores. When you opt for a Cloudways managed server, you get an optimized server for Magento store that is ready for business. However more than that, Cloudways ensures that as a Magento store owner you wouldn’t have to worry about server management issues. This way, you can dedicate all your time to think of new ways of growing your business.

With Cloudways, you get the choice of hosting your Magento server on one of the five industry-leading cloud infrastructure providers including AWS, GCE, Linode, DigitalOcean, and Vultr. Thus, there is always a Cloudways plan that fits the budget of every Magento store. In addition, Cloudways offers:

  • SSD-Based Hosting
  • Advanced Cache options
  • CloudwaysCDN
  • Optimized Stack
  • Dedicated Firewalls
  • 1-Click Installation
  • Automated Backups
  • Vertical Scaling
  • Auto-Healing Servers
  • 24/7 Expert Support

Are You Ready to Migrate Your Store To Cloudways?

If you are ready to move your store from your cPanel hosting to a Cloudways managed server, Let’s get started.

The process is pretty simple and if you follow the following steps, you will have your  Magento store on your new Cloudways managed server in no time.

First of all, take a full backup of your store, including all the databases. For this, connect to your Magento cPanel hosting through a SSH terminal. You would need to use a client such as puTTY. Once connected, navigate to the root directory of the Magento 2 store.

Next, create a backup of your store with the following command:

mysqldump -u yourdbusername -p yourdbname > database.sql

This command requires the database username, database name, and name of the database dump file. The command will ask for the database password. Once the command finishes, access your cPanel hosting and go to File Manager > Root Directory.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

This is generally how the folder structure of cPanel hosting looks like:

Zip all the files and folders.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

I have named the zip file as newbackup.zip. At this point, the website and database backups are ready. Generally, the zip file is located at a URL similar to www.yourdomain.com/newbackup.zip

Now it’s time to switch over to the Cloudways platform. The first order of the business is the creation of a Cloudways account.

By simply providing your name, email, password and answering few questions you can sign up to Cloudways.

After creating your account, select Magento application from the drop-down menu.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

Then, give the name to your managed app and server.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

Now, the next step is the selection process among various cloud infrastructure provider as I am choosing Digital Ocean. Then, set server size as per your business need and last choose the location of the server.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

Now, click on LAUNCH NOW!

Just after few minutes server will launch with this screen appearance.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

Start the Migration

Before getting into the migration process, you have to remove the current application and database files. For this, connect to the Cloudways server via SSH and go to the store’s root directory. You can remove all the files and folders with the following command:

rm -rf *

Now, go to the application dashboard and from there LAUNCH DATABASE MANAGER.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

You will see the list of tables. Select all of them and click Drop.

? Guide: Migrating Magento Store From cPanel to Cloud Hosting | MageWorx Magento Blog

Next, go to the SSH terminal and run this command:

wget yourdomain.com/newbackup.zip

Remember to add the URL of the zip file hosted on the cPanel hosting.

Now, unzip the file:

unzip newbackup.zip

And, import the database to the Cloudways application with this command:

mysql -u CLOUDWAYS-DB-USERNAME -p CLOUDWAYS-DB-NAME < database.sql

In the above command, provide the database credentials of your application installed on Cloudways. Note that the command will ask for the password (available in the database credential section).

Now open the env.php file (located in the app/etc directory of your store) and replace the database credentials with the set provided by Cloudways.

Congratulations! You have successfully migrated your Magento store from slow cPanel hosting to lightning-fast Cloudways managed server. So just clean the cache using these CLI commands:

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento cache:clean

php bin/magento cache:flush

And after doing that visit the homepage of your store to check if everything is in order.

Final Words

I hope that by now you understand the easy process of migrating your Magento store from shared cPanel hosting to a Cloud hosting. More importantly, you also get a clear idea of why Magento cloud hosting is an ideal fit for your online store.

Since you come this far, so I want to give a surprise that Cloudways is offering FREE $20 Credit with Promo Code ‘BOOSTMAG’.

If you still have any queries or confusion, use the comment section and I will get back to you.

Ellie is the Marketing Executive at Mageworx. Digital marketing expert by day, and a philomath by night, she can't help but share her knowledge and experience with the reader. eCommerce Allstars Podcast participant with over 70 authored articles online.

2 COMMENTS

    • Hello Brian,

      Thanks for your comment.

      To share absolute numbers with you, I need to ask you a few questions to determine the perfect server configuration for a Magento store. These questions include:

      – How many unique visitors will visit the stores daily?
      – How many products, catalogs, the number of categories, attributes, attributes sets are there? What would be the future requirements?
      – Do your stores provide any downloadable digital products?
      – What is the total number of orders per day? (including pending, confirmed and canceled orders).
      – Do you require any other features like Varnish integration? Support for Memcached, Redis, Elasticsearch, etc?

      Keeping all these above things in mind, on a rough note, I will recommend that for the development purposes of a Magento 2 store with substantial resources, a 4GB server would be good to start. After that, it can be scaled up anytime w.r.t. the needs.

Leave a Reply to Ellie Yantsan Cancel reply

Please enter your comment!
Please enter your name here