WordPress is a popular CMS platform for creating and managing websites. However, as your website grows, you may find that your current hosting provider no longer meets your requirements. Whether you’re looking for more storage space, better performance, or more reliable customer support, migrating your WordPress site to another host can help you achieve your goals.
Migrating a WordPress site can be daunting, but with the right tools and techniques, you can complete a straightforward process in a few hours. In this article, I’ll walk you through the steps to migrate your WordPress site to another host, from preparing your site for migration to testing and troubleshooting any issues that arise during the process.
I’ll cover everything from backing up your site to exporting and importing your site’s files and database and updating your DNS settings to ensure a seamless transition. So let’s get started!
Reasons for WordPress Migration
You might want to migrate your WordPress site to another host for several reasons. Here are some of the most common ones:
1. Poor Performance
Your website may be experiencing slow loading times, frequent downtime, or other performance issues that negatively affect user experience. Switching to a new hosting provider with better hardware and infrastructure can improve your website’s speed and reliability.
2. Lack of Features
Your current hosting plan may not provide the features or resources you need to manage your website effectively. For example, you may need more storage space, bandwidth, or better security features.
3. Hosting Cost
Your current hosting provider may charge you more than you’re willing to pay, or you may have found a better deal with another provider. Migrating to an affordable WordPress host can help you save money in the long run.
💡 Tip: You can compare your hosting costs with Web Hosting Savings Calculator and see how much you can save with Cloudways.
4. Customer Support
You may be experiencing poor customer support from your current hosting provider and want to switch to a provider with better customer service.
5. Company Changes
Your current hosting provider may have undergone changes, such as new management or a merger, that negatively affect the quality of service you receive. In this case, migrating to a more reliable provider may be beneficial.
Ready to take your WordPress site to the next level?
Migrate your site to Cloudways today and experience lightning-fast page speed, 24/7 expert support, and seamless scalability.
Prerequisites for WordPress Migration
To successfully migrate your WordPress site to another host, you need to:
1. Back up Your Site
You should back up your WordPress files and database. This will ensure that you can revert to a previous version of your site if anything goes wrong during the migration process.
2. Choose a New Host
You should select a new hosting provider that meets your requirements and offers the necessary features and resources. Ensure that the new host is compatible with WordPress and offers tools that make it easy to migrate your site.
3. Set up a Staging Environment
You should create a staging environment on the new host. This will allow you to test your site and make changes before making it live.
4. Export Your WordPress Site
You must export your WordPress site’s files and database from your current hosting provider. You can use a plugin like UpdraftPlus, which simplifies the process of exporting your site.
5. Import Your WordPress Site
Once you have exported your site’s files and database, import them to the new host. You can use a plugin like UpdraftPlus or manually import the files and database.
6. Test Your WordPress Site
After importing your site, you must test it to ensure everything works correctly. This involves checking the functionality of your site’s pages, posts, media, and plugins.
7. Update Your DNS Settings
Finally, you must update your Domain Name Server (DNS) settings to point to the new host. This will ensure that your site is accessible from the new host and that visitors can find your site.
Migrate WordPress Manually
Follow these steps to migrate your WordPress site manually.
Step 1: Upload the Files
The first step is to upload the files. You have two options for uploading the files to the new host.
1.1. FTP Method
- Log in to your existing hosting account;
- Go to File Manager → folder with WordPress files;
- Compress (.zip) all your WordPress files;
- Upload the .zip file to the new hosting provider either via File Transfer Protocol (FTP) client or File Manager provided by the new hosting account;
- Once uploaded, extract the zip file in the public_html
2.2. SSH Method
The files can be uploaded through SSH. Not all providers offer this service; you should check for the platform-integrated SSH terminal. If unavailable, use a client such as PuTTy to connect to the new server.
Please use the following command:
$ cd public_html/
- Once connected to the server, access the public_html folder (the root folder for the WordPress files).
- Inside this folder, upload the folder you zipped earlier in the FTP method.
- Go to your File Manager and ensure your zipped folder is inside the public_html By default, it’s named public_html.zip, but you can change it to something like mysite.zip.
- Now verify the location by accessing the URL. When the correct URL is accessed, it will start downloading automatically.
The generic URL might look like this: http://YOURSITE.com/mysite.zip.
- Go back to the PuTTy terminal, and enter the following command (ensure you are still in the public_html folder).
- Once downloaded, you will see a new zip folder in your public_html folder of your new host.
- To unzip the folder, run the following command.
If you’ve done it correctly, all the files from your old sites should be imported to your new hosting.
Step 2: Migrate WordPress Database
- Create a new database and a user at the new hosting server using the MySQL Database Wizard (note down the credentials as needed later on).
- Go back to the old WordPress site and install the UpdraftPlus plugin to Export the database.
- Use phpMyAdmin on the new hosting account and Import the database created above.
Step 3: Tackle the Tricky Part
- Go to wp-config.php (you can find it in root) and replace the credentials with the ones you noted earlier, i.e., DB_NAME, DB_USER, DB_PASSWORD.
- Provide DB_HOST while moving a WordPress site to a new host, but that mostly depends on your server. Other than that, you are ready to go!
Step 4: Finalize the Process
- Find the table xxxxx-option in your database, replace option_value of siteurl and home with the new URL of your site.
You can now visit http://NEWURL.com/wp-admin. For that,
- Go to Settings;
- Select Permalinks and;
- Change it as you desire.
Step 5: Replace OLD URLs
Iit’s time to update the URLS. You can use the Velvet Blues Update URLs plugin to replace every old URL with new ones. Once done, you’re good to go!
Congratulations! You’ve migrated your site to your new host and are ready to use your new environment.
💡 Tip: If you cannot visit the site, try clearing your browser cache. For Win (Ctrl+Shift+Del) and MacOS (CMD+ALT+E).
Migrate WordPress via SSH
Secure Shell (SSH) is a command line interface widely used to control remote machines (in this case, the servers are both the current and future homes of your WordPress site). It is used to execute a range of actions on remote servers. It is not interactive and only accepts text commands for the operation you wish to perform.
SSH provides a secure and encrypted channel through which information is shared between the client and the remote server. Because of its popularity, an SSH terminal is integrated into iOS and Linux OS. However, Windows users must download an SSH client (such as PuTTY) to initiate SSH sessions.
Unfortunately, most WordPress users are unfamiliar with the Command Line Interface (CLI). Therefore, I will use very simple steps to walk you through the rest of this guide. I will also explain the behind-the-scenes working of the commands, giving you a better idea of what you are doing.
Step 1: Access the Command Line
I will use the SSH-client PuTTY to access the command line. However, you may use any SSH client of your choice. You would require the following to access your existing server through the command line:
- Server IP address;
- Username and Password;
- Public Key.
Launch PuTTY and navigate to SSH → Auth.
- Get your server’s Public Key and navigate to Session inside the PuTTY window to enter the server’s IP Address.
- Click the Open button and log in with your credentials.
💡 Tip: Log in as a root admin and enter the correct password.
Step 2: Access the WordPress Directory
After logging into the server via SSH, access your WordPress site directory containing the files and folders I want to move to the new host.
In the terminal, type the following command to ensure you’re at the server’s root folder.
The next command is ls, short for the list command that displays all the files and folders in the root directory.
You might see a different list of files and folders. But that’s okay!
From here, you need to go to the WordPress installation folder. In my case, I will go to the www folder (containing the WordPress installation files) inside the var folder.
Type cd var/www and hit Enter.
After checking the content of this folder by running the ls command, I can see that it contains the folder for the WordPress site.
Simply type cd wordpress (or whatever the name of your folder) to access the WordPress site folder.
Step 3: Back up WordPress Files
Backing up WordPress files is a precaution you must take before migration to avoid data loss.
To take the backup, I will create a zip folder of the WordPress site folder. This is the easiest and the fastest way of transferring data from my existing server on Cloudways.
💡 Tip: To run the zip command, make sure you have zip installed. You can install zip by running the following command: sudo apt install zip unzip
While in the www folder, run the following command:
zip -r wordpress.zip wordpress
-r flag enables recursive reading of files. Do not forget to replace the folder name [wordpress] and the filename [wordpress.zip] to match yours.
After completing the process, cd back to the www folder or the folder in which you ran the zip command, and type the ls command to confirm that the zip file has been successfully created.
Great! I have successfully back up my WordPress site. Let’s move ahead and take the backup of the WordPress database.
Step 4: Back up WordPress Database
To create a MySQL database backup, go back to your SSH terminal and run the following command:
mysqldump --add-drop-table -h localhost -u wpuser -p wordpress > site.bak.sql
In the above command, I have supplied the following parameters. Please adjust them to match your values.
- -h localhost will stay the same;
- -u is the username of the MySQL database;
- WordPress is the name of the database.
Once the command is executed, you will notice that a new file has been created (with the name ‘site.bak.sql’). This contains the complete database of our WordPress site.
At this point, I have successfully created backups of WordPress files and databases. In the next step, I’ll move my WordPress site to Cloudways. However, you can choose your hosting provider.
Step 5: Launch WordPress on Cloudways
Before I proceed to WordPress migration, let’s set up the server and launch a WordPress site on Cloudways Platform.
It takes a few clicks to deploy a new server and launch a WordPress site on Cloudways. If you want to know more about it, request a Cloudways demo, and our specialists would be happy to answer all your questions.
- Sign up for Cloudways Platform;
- Enter your Application and Sever Details;
- Select your Cloud Server and Size;
- Select your Server Location;
- Click on the Launch Now button.
Your server and the WordPress site will be deployed within a few minutes.
That’s it! The WordPress site is up and running on the Cloudways managed server. Let’s migrate the existing site to the new server.
Step 6: Migrate WordPress Site to Cloudways
I will migrate the zip file containing the backup of my WordPress files from my existing folder to the new WordPress site I have launched on Cloudways.
Before I proceed, I’ll connect to the Cloudways Server via FTP using FileZilla. This way, I can easily monitor the files and their location. To do that:
- Launch FileZilla;
- Go to Server Management from Cloudways Platform;
- Copy Public IP, Username, and Password.
- Enter the credentials in FileZilla to access the server;
- Go to applications → [your wordpress site folder] → public_html folder and delete all the contents of this folder.
This generally takes a few minutes. Once done, I will move the contents of my WordPress site to this location.
- Go back to the SSH terminal and ensure you are in the www
- Run the following command:
scp /var/www/wordpress.zip [email protected]:/home/master/applications/ewscfaavrd/public_html
Let’s see what’s going on with this command:
- scp [var/www/wordpress.zip] this is the location of the file I wish to send to my new Cloudways server. Please change it to match yours.
- [[email protected]] text before the @ sign is the username of my new Cloudways server, and after the @ sign is my public IP.
- [:/home/master/applications/ewscfaavrd/public_html] this bit of the command represents the location where I wish to copy the zipped WordPress folder.
Once the command finishes, you will see a new file inside the folder:
Finally, I need to unzip the content of this zipped file. To do that:
- Go back to Cloudways Platform;
- Launch SSH terminal from Server Management.
- Log in with the username and password (provided as Master Credentials) and access the WordPress directory, where I just copied the zipped folder.
I’ll use SSH for unzipping the folder to make the process faster and easier.
- Go to the public_html folder of the application where the zipped folder was copied from the old server
- Run the following command to unzip the contents.
After completing the process, run the ls command to verify the content of the unzipped folder.
💡 Tip: Do not remove/delete the zipped folder, as it may be required if things go wrong. When you have verified that everything is working as it should, delete the folder later on.
I have successfully transferred the WordPress site to my new server on Cloudways. However, if you look closer, the location is not right. To serve this site, I should have the content inside the public_html, not in a folder inside the public_html directory.
To move all the contents from the WordPress folder to the parent directory public_html, run the following command from the Cloudways SSH terminal while in the WordPress directory.
mv * ../
The mv command moves files/folders, the * represents all files/folders, and ../ is to go one step back.
Run the ls command to confirm that all the files and folders have been successfully transferred.
As you can see, I have successfully moved the WordPress site to a new server.
Step 7: Import WordPress Database to Cloudways
I’ll transfer the .sql file from the old server to the public_html folder of my new WordPress site on Cloudways. I will use the scp command.
💡 Tip: This will replace/override the existing Cloudways server database with the old server’s database.
scp /var/www/site.bak.sql [email protected]:/home/master/applications/ewscfaavrd/public_html
- Go back to Cloudways SSH terminal window;
- Run the following command to import the database file.
mysql -u ewscfaavrd -p ewscfaavrd < site.bak.sql
- –u ewscfaavrd: This is the database username of the WordPress site on Cloudways.
- -p ewscfaavrd: This is the database name of the WordPress site on Cloudways.
At this point, I have moved my WordPress files and database to Cloudways server.
Let’s check if the WordPress site is properly operational. For this, simply click the application URL under the Application URL section. While browsing the website, I encountered the error page, which told me that my WordPress site could not connect to the database.
This issue can be fixed by replacing the old database credentials inside the wp-config.php file with the new credentials provided by Cloudways.
To do this:
- Launch FileZilla (if you closed it earlier) and open the wp-config.php.
- Inside the file, replace the values of DB_NAME, DB_USER, and DB_PASSWORD, save and close the file.
- Go back and reload the page to check if website is running fine.
As you can see, I have successfully moved my WordPress site and its database from my old server to new server on Cloudways.
The entire process might feel lengthy, but faster and more secure. Use the Cloudways Migrator plugin for a seamless migration experience if you have a small website.
Migrate WordPress via WP-CLI
Like SSH, WP-CLI is a command line interface specific to WordPress. This simple yet powerful tool allows you to operate the CMS like the WordPress front-end. Many WordPress developers prefer using WP-CLI because of its flexibility and simplicity.
WP-CLI transfers WordPress sites, install plugins, manage a multisite network, access databases, and upgrade the core files. Although all of the above tasks can be performed via the web interface, it is still a preferred way of performing tasks without distractions.
To migrate WordPress via WP-CLI, open your SSH terminal and ensure WP-CLI is installed on the server. For that, simply type the WP command below:
If you don’t have WP-CLI installed, the following error will appear:
To install WP-CLI, run the following command in the SSH terminal of your old server. cd back to the opt folder by going all the way back to the root location. Keep running the cd ../ command until you reach there.
Install wp-cli by running the following command:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
You can confirm the installation by typing the wp –info command. Next, change the file’s permission to make it executable.
chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp
Go back to the main WordPress folder and run the following command that should show the WordPress installation version.
wp core version --allow-root
In the next step, I’ll back up WordPress files via WP-CLI.
Step 1: Back up WordPress Files via WP-CLI
Taking a backup using WP-CLI is similar to the SSH based process.
- Access the www folder;
- Create a zip file of the WordPress site by running the following command.
zip -r wordpress.zip wordpress
- Move the zipped folder inside the WordPress site folder by running the following command. Please note wordpress is the name of the WordPress site.
- Go to the wordpress folder by running the cd command, and you will find the zip folder.
The following screenshot summarizes the whole process.
I have moved the zipped folder inside the WordPress site folder, making it accessible via a URL. It should be downloadable from the URL like this:
http://[serverIP]/wordpress.zip OR http://[wordpress site location]/wordpress.zip depending upon your structure.
Step 2: Import WordPress Files to Cloudways
To import the WordPress files to Cloudways, you need to follow the below steps;
- Log in to Cloudways Platform;
- Launch SSH terminal from Server Management.
- Access the new WordPress site, and inside the public_html folder, type the following command.
This will fetch the complete zipped folder from the old server through a URL.
- Once the transfer finishes, unzip the folder’s content by running the following command:
This will move all the content back to the parent directory (public_html) by running the following command.
mv * ../
I have successfully fetched the zipped folder and moved my WordPress site to Cloudways.
Step 3: Back up WordPress Database
The database can be backed up easily by running the following command to create the .sql file for your WordPress MySQL database.
mysql -u ewscfaavrd -p ewscfaavrd < site.bak.sql
This will create the backup file that can easily be exported to the Cloudways server using integrated SSH shell.
Step 4: Search and Replace URLs
If you are migrating to another domain, you must replace the URLs pointed to your old domain through a simple process.
- Run the following command from Cloudways SSH terminal.
wp search-replace "http://old-url.com" "https://new-url.com"
This command will search for all the URLs and then replace them with the new URL provided in the later part of the command.
Test WordPress After Migration
If you have followed along and did not encounter any roadblocks, you should be able to see your migrated site up and running on your new Cloudways server without any issues.
Cleanup, a bit after finalizing the migration process, is always a good idea. For this, delete the zipped folder of the WordPress file and your MySQL database. This is optional; leave them alone if you are not worried about disk space.
Migrate WordPress to Cloudways
If you’re migrating your site from another host to Cloudways, the process has three simple steps!
- Install Cloudways WordPress Migrator on your current hosting server;
- Enter the necessary credentials;
- Click on the Migrate button.
Here is a short video guide on how you can easily migrate WordPress from another hosting to Cloudways and experience managed optimized cloud servers.
Brilliant, isn’t it? It’s easy, simple, and saves you time!
Issues With WordPress Migration
WordPress site migration can be a complex process, and there are several issues that users can face during the migration. Some common issues and their solutions are:
1. Broken links and images: One of the most common issues during site migration is broken links and images. This can happen when the URLs change, and the links and images are not updated.
Solution: Use a plugin that can automatically or manually update the URLs.
2. Missing files or data: Users can also face missing files or data during site migration. This can happen when the files or data are not properly transferred, or the backup is incomplete.
Solution: Ensure all the files and data are properly transferred and the backup is complete.
3. Database connection errors: Users can face database connection errors during site migration. This can happen when the database credentials are not updated, or the database is not properly imported.
Solution: Ensure the database credentials are correct and the database is properly imported.
4. Theme and plugin conflicts: Theme and plugin conflicts can occur during site migration. This can happen when the theme or plugin is not compatible with the new WordPress version or when the theme or plugin is not properly installed.
Solution: Ensure the theme and plugin are adequately installed and compatible with the new WordPress version.
5. Domain name and URL issues: Users can face domain name and URL issues during site migration. This can happen when the domain name is not updated correctly, or URLs are not properly redirected.
Solution: Make sure that the domain name is properly updated and the URLs are properly redirected.
Best WordPress Migration Plugins
If you want to migrate your WordPress site to a new hosting provider or domain, using a migration plugin can save you much time and effort. Here are some popular WordPress migration plugins that can make your move easy:
- Cloudways WordPress Migrator – This plugin makes migrating your WordPress site to the Cloudways hosting platform easy. It simplifies the process of moving your website and ensures a smooth transition.
- All-In-One WP Migration Plugin – This plugin allows you to export your entire WordPress site, including the database, media files, themes, and plugins, and import it into a new location. It also has features to handle large sites, allowing you to split your export into smaller files.
- Duplicator – Duplicator lets you create a backup of your site, including the database and files, and then transfer it to a new location. It can handle large sites and provides options to exclude specific files or database tables.
- UpdraftPlus – While primarily a backup plugin, UpdraftPlus also has a migration feature that lets you export your entire site and import it into a new location. It can handle large sites and also allows you to exclude specific files or database tables.
- WP Migrate DB – This plugin lets you export your WordPress database in a way compatible with different database management tools. It also allows you to find and replace URLs and file paths, making it useful when moving to a new domain or changing your site’s folder structure.
- Migrate Guru – This plugin allows you to migrate your site to a new host, server, or domain without downtime. It uses a cloud-based service to handle the migration, so you don’t need to install any software on your site.
Migrating a WordPress site to another host can seem daunting, but following the steps outlined above can be a smooth and stress-free process. It’s important to plan and prepare for the migration carefully, backup your website, choose the right hosting provider, and use a reliable migration plugin. Choosing a managed hosting provider can also simplify the task.
These steps ensure your website is safely and successfully transferred to its new home without losing data or functionality. With your site up and running on its new host, you can continue to focus on creating great content and engaging with your audience.
Frequently Asked Questions
Q. How do I migrate my WordPress site for free?
A. To migrate your WordPress site for free, you can follow these steps:
- First, create a backup of your current WordPress site.
- Install a new WordPress site on your new hosting provider.
- Export the content from your old WordPress site using the Export tool.
- Import the exported content into your new WordPress site using the Import tool.
- After the import is complete, make sure to update any links or images that may be broken due to the migration.
- Finally, update your DNS settings to point to your new hosting provider.
Q. How do I migrate a WordPress site using plugins?
A. To migrate a WordPress site using plugins, you can follow these steps:
- Choose a migration plugin;
- Install and activate the plugin;
- Configure the plugin;
- Create a backup;
- Begin the migration;
- Test your migrated site.
Customer Review at
“Beautifully optimized hosting for WordPress and Magento”
Arda Burak [Agency Owner]
Mustaasam is the WordPress Community Manager at Cloudways. Where he actively works and loves sharing his knowledge with the WordPress Community. When he is not working, you can find him playing squash with his friends, or defending in Football, and listening to music.