Looking to migrate your Magento store from a cPanel-based hosting provider to Cloudways?
This guide will walk you through the entire Magento migration process using SSH—ensuring full control, secure data transfer, and zero downtime.
Whether you're switching for better performance, scalability, or faster page load speeds, Cloudways offers an ideal environment for Magento hosting with built-in server optimization and 24/7 support.
By following this SSH-based approach, you’ll be able to manually move your Magento files and database from your current server to a Cloudways-managed server with ease.
This tutorial is designed for users with basic command-line knowledge and is especially helpful for those who prefer direct access to their servers over using third-party plugins or automated tools.
In this guide, we will show you how you can migrate your Magento store to Cloudways using an SSH terminal (command line). You need some basic knowledge of the command line to be able to complete the process.
Table of Contents:
How to Migrate Your Magento Store to Cloudways via SSH?
Migrating your Magento store to Cloudways via SSH gives you full control over the process and ensures a clean, manual transfer of both your files and database.
In this guide, we’ll walk you through each step using the command line interface (CLI).
Basic familiarity with SSH commands and server environments is recommended to successfully complete this Magento migration.
Prerequisites Before You Begin:
Before starting the migration, make sure you have SSH access to both your current hosting server and your Cloudways server. You’ll also need your Magento site and database credentials ready.
Steps to Manually Migrate Your Magento Store to Cloudways via SSH
The following steps involve using SSH commands to transfer your Magento files and database manually.
This method is ideal for users comfortable with the command line and seeking full control over the migration process.
Step #1 — Creating Backup of Web Files:
If you have SSH access to your current hosting server, you can simplify the process by making an archive of your entire site first by using the 'tar' command.
Run the following in your Magento’s webroot/public_html directory.
tar -czf backup.tar.gz *
This will create a compressed file that you will need to migrate to your Cloudways server.
Step #2 — Downloading the Backup File to Your Cloudways Server:
Next, you can transfer the backup file to your Cloudways servers by using the 'wget' or 'scp' command.
In this guide, we are using 'wget' to transfer the backup. To do this, connect to your Cloudways server using SSH and navigate to the public_html folder with this command.
Here the folder name is the name of your application.
cd applications/foldername/public_html
Next, run the following command.
This will download the backup file we created in the previous step to your Cloudways server.
wget http://your_domain_or_ip address/backup.tar.gz
Next, decompress the contents in the current folder using the following command.
tar -xzf backup.tar.gz
Once the above is done, you can safely remove the backup.tar.gz from your old server.
Step #3 — Backup the Database:
In this step, you will make a backup of the database in your current hosting server.
To backup your database, we recommend using SSH or a tool like PHPMyAdmin.
Log into your old server with SSH as we did in Step #1.
Once you are there, run the following command (replace dbUsername and dbName with the database username and database name of your old server):
mysqldump -u dbUsername -p dbName > db_backup.sql
This will create a dump of your database and save it as db_backup.sql in the current directory.
If you don’t have SSH access, contact your current host for assistance on how to back up the database.
Step #4 — Restoring the Database on your New Cloudways Server:
Now we will restore the database dump we took into our Cloudways server.
Again, open an SSH session to your Cloudways server with the appropriate credentials and run the following commands (replace dbUsername and dbName with the database username and name that you can find in the application tab of your Cloudways Platform).
wget http://your_domain_or_ip/db_backup.sql
mysql -u dbUsername -p password dbName < db_backup.sql
This will download the backup file from your old server to your Cloudways server and restore the data into the database named as dbName.
You may safely remove the db_backup.sql from your old server once you have restored the database successfully.
Step #5 — Update Magento Configuration Settings:
Edit the Magento configuration file to use the Cloudways server database.
Open the file local.xml under the public_html/app/etc/ directory with your favorite text editor.
Here we have used vim to edit the local.xml file as shown above.
Remove the old entries and input the new Cloudways application details.
Important:
You can also use the SFTP File Manager for modifications in the file. We have used the SSH method in this KB.
Save the file and exit.
Step #6 — Clear the Magento Cache:
Go to the folder var/cache inside your Magento root directory (public_html) and remove any file or folder that may exist.
Make sure you are in /var/cache before running the command above!
That’s it! You should now be able to open your Magento website from your Cloudways server. You can check that all is working fine by updating your local hosts file and pointing to your Cloudways server.
Once you are happy with how your site works on the new server, you can take your site live.
Switch to SiteGround alternative for better hosting. With Cloudways, you can experience speed optimization and faster loading time compared to SiteGround shared hosting.
Find Your Perfect Hosting Solution with Cloudways! Sign up Today.
That’s it! We hope this article was helpful.
Need Help?
If you need assistance, feel free to:
Visit the Cloudways Support Center
Chat with us: Need a Hand > Send us a Message
Or create a support ticket anytime.
We're here 24/7 to help you!






