Migrating Magento from a cPanel host to Cloudways

Loaded with numerous valuable features, Magento has been one of the powerful platforms in the world of eCommerce. The count of online stores using Magento is very huge, all of them being hosted on different services.

We often come across the queries related to migrating from cPanel hosting to a new server. But for a better understanding of what is it and why is it necessary, here is some information to help you choose whatever is best for your store.

Magento Shared Hosting

Magento shared hosting is a highly traditional hosting option as it is a very cost-effective and easy solution of startups and store owners having a light-weight website. But as your website grows, shared hosting is no more an option. Once you have a full-fledged Magento store with a huge catalog, you require a robust and reliable hosting solution. When you use shared hosting, the distribution of resources affects the performance and can compromise its security.

Cloud Hosting

Cloud hosting is a solution where the website is hosted on a dedicated cloud server which means the store owner has the liberty to scale the server whenever the application faces any server issues. Even though it is not the cheapest solution, it comes with the advantage of paying for the resources that you consume and not end up paying for the resources that are not being utilized.

Managed Cloud Hosting

Managed cloud hosting is a hosting solution where there is no need to manage the server on your own. Everything related to server management and configuration will be entirely the responsibility of the provider.

How to Migrate Your Magento Store to Cloudways From a cPanel Based Host?

If you are planning to migrate your store from cPanel to Cloudways, here is a tutorial to help you with it. Always remember, before starting with the Cloudways, you need to do is backup your store and its database to get all the important data.

Step 1. Begin with Magento cPanel

First of all, connect your Magento cPanel hosting with an SSH terminal; you can also use Putty for the same. Once done, try to navigate the main directory of your Magento 2 store. Then schedule a backup of your store’s database simply by running this command:

mysqldump -u yourdbusername -p yourdbname > database.sql

Step 2. Add the File to File Manager

In the above-mentioned command line, input your cPanel hosting database username with name. Post this, add the file of your choice. Once you execute this command, you will be asked to enter a password for your database. Now go to File Manager from your cPanel hosting.

Magento File Manager Cpanel

Step 3. Explore the Root Directory

Now, navigate to the root directory of your store.

Magento Migration

Step 4. File Compression

Now compress all the files and folders in a zip. Now your Magento website has got the backup ready and it can be found on - www.yourdomain.com/magentobackup.zip.

Magento Backup

Step 5. Sign up For a New Account

Now, Create an account at Cloudways and start Magento 2 just with a few clicks.

Signup New Account

This helps you choose the server of your choice from infrastructure partners and then you would be requested to set server size and location as per the business requirements.

Application Management

Step 6. Install the Server

Once it is done, all you need to do is click on the Launch Now button to get it done. You'll find that the server is successfully installed once you see the below message is displayed with the Magento 2 application under it:
Install Server

Step 7. Delete the Database

Before going for cPanel migration for your Magento store, you will need to remove the database and files from your installed application of Cloudways. Connect your Cloudways hosting with the help of SSH and then select your store’s root directory. But first of all, clean all the stored files and folders by running this command:

rm -rf *

Step 8. Connect to the SSH Terminal

Now, click on the Launch database manager in the application dashboard from your account. Select all the tables and drop them. Go to SSH terminal where you can connect the Magento app of Cloudways by running this command:

wget http://yourdomain.com/magentobackup.zip

Step 9. Unzip all the Files

Unzip the file and import the database onto your Cloudways app by running the given command:

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

Input the database credentials of your application installed on Cloudways in the above command. Post that, mention the password and go to env.php file to replace the database credentials with your Cloudways one.

We hope everything related to the migration of the host is covered in this article. If we missed out on anything, feel free to reach us out!

Magento 2 Migration Services