Are you planning to migrate your WordPress site to a new host? If yes then you landed here on the right page. Switching your site to a new host can be a stressful and challenging experience. Today’s in this article; we will discuss a step by step guide to migrate your WordPress site to a new host. So, read our article further and you will get all the details in that matter.

As you know, there is always a risk while switching your WordPress website to a new host. The most significant risk arises is data loss and downtime. Both of these problems can make your site temporarily inaccessible to all the users and search engines.

But if you prepare your website well for migration, then migrating is nothing to concern about. It can be a simple and easy task if approached correctly. So, moving any site to a new host involves three tasks: The website files, the host server and the domain where visitors can find your site on the web. So, without further ado, please read our guide further and follow the steps quickly to migrate your WordPress site easily.

Steps to Migrate Your WordPress Site To A New Host

Backup Files Before You Migrate Your WordPress Site

The first and the primary step is to back up your website files; otherwise, you will lose your essential data. There are many plugins available to back up your site for you completely. You can also back up your files by using an FTP program.

Just connect the program to your web host and copy all the data under your website directory into a new folder. This includes the .htaccess File, which is to be hidden. If you are unable to see this File, you have to check out the FTP program to help in displaying the hidden File.

Export the WordPress Database To Migrate Your WordPress Site

Exporting the database is a simple process that requires few steps to complete. Here is the step by step guide:

  • Login to your cPanel account of your web server
  • Open the phpMyAdmin application there in your account
  • From the list select the database which contains your WordPress installation which is at the left-hand side in the list.
  • Click on the Export tab in the navigation menu.
  • Tap on Go and your export process will begin. 
  • Wait until the process is completed. 

You have seen that a new file will be downloaded to your local computer.

Create The WordPress Database On Your New Host Server

Creating the WordPress database on your new host server is a significant step. For this, you first log in your new web host with the user credentials and connect to the cPanel software. Here are the simple steps to create a database

  • Open My SQL database and create a different database with the appropriate name for your website.
  • Create a new profile with a secure password.
  • Add this user account to the new database and accept all its privileges.
  • Write down all the details on the safe place you will need them later.

Edit The wp-config.php File


Open the folder on your computer where you have downloaded your website files. In that folder search for the File called wp-config.php that controls the access between WordPress and your database. Again copy the data in another folder on your computer. Open the original version of the File and do the following changes.

Change the Database Name

Define (‘DB_USER’, ‘db_user’);

In the above line, you need to change db_user portion from the name of your old host to change the new name you have just created.

Change the Database Username

In the above line, you need to change db_user portion from the username of your old host to change the new username you have just created.

Change the Database User Password

Define (‘DB_PASSWORD’, ‘db_pass’)

In the above line, you have changed the db_pass with the new password you have created for My SQL user.

Save all the changes and close the File.

Import Your Database

Migrate Your WordPress Site

Now you are on the new database to work. Let’s begin with the import process.

  • Launch phpMyAdmin from the cPanel software to the new server.
  • Select the new database from the list to work.
  • From the navigation bar, select the Import tab.
  • Choose the SQL file from the File to export section.
  • Un-tick the Partial Import checkbox and click on the Go button.
  • Wait until the import process is completed. 

Upload the WordPress Files to the New Host

Now you are on the new database it’s time to upload your all files again. Connect to your new WebHost and start uploading your data to the public_html folder in the usual directory. Again upload your website files in the updated version of wp-config.php.

Defining New Domain and Search/Replace Old Domain  

You have completed the copy of your WordPress database and files on your new hosting server, but your domain still contains an old web hosting account. So, to update your domain name, you need to switch your DNS name server. 

The process is totally depending on where you have registered your domain name. We will show how to change DNS nameservers with GoDaddy. Let’s take a look below:

  • Log in to your Go daddy account and click on the domain
  • Tap on Manage all and then tap on manage DNS.
  • Scroll down to the name server section and tap on the change button.
  • In the first box, choose the name server type, which is always customs and in the second box, fill the new hosting provider information.
  • Click on the Save button to change the settings. 

DNS changes can take 4-48 hours to propagate for all users.

Summary – Migrate Your WordPress Site

So, those are the steps to migrate a WordPress website to the new host. The process is not so complicated; you just require being more careful at each stage. 

Thanks for reading this post. I hope you enjoyed reading this article. Please share your experience with us in the comment section. If you have any query or question related to this article comment below we will back to you as soon as possible. For more updates do follow us and stay tuned with us at The Website Dev.

Comments to: Migrate Your WordPress Site To A New Host | How-To Guide

Your email address will not be published. Required fields are marked *

Attach images - Only PNG, JPG, JPEG and GIF are supported.

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Join TheWebsiteDev