How to Move a Wordpress Website From One Hosting to Another

Over the time wordpress migration can be difficult and tricky when moving from one hosting to another. In this article, I will explain how to move a wordpress site to a new hosting.

Prerequisite
What you need to make the wordpress website work successfully on new server :

  1. New Hosting i.e Where the wordpress will reside after migration ( i.e server A).
  2. Old Hosting i.e Where the wordpress resides before migration ( i.e server B).
  3. Active MySQL Database (maybe will be with server A).
    Note: Database can be located anywhere just know the database name, hostname , username and password.
  4. Finally we should also have access to the domain portal and get the nameserver it points to (will explain this further at the end of the article .

Steps
Note: Before we start the main job note that this migration is based on cpanel hosting, if you want me to write article on virtual hosting please notify on comment below.

A. MOVING MAIN WEBSITE

  1. Login to server B with your cpanel user detail (username and password) and go to file manager .
1. Click file manager on the cpanel Page

2. Compress all the folders containing the website files from the file manager and download it to your local system

Compress the file and Download it to your local system

3. Login to the new server (Server A) and click on the file manager

New server should be empty if it doesn't handle any project

3. Upload the zip folder to the new server A

Ready to upload to new server through the file manager

4. Extract the website to the new server

Extracting the project to the new server

B. MOVING DATABASE

  1. Go back to the cpanel page and click on phpmyAdmin to download the database from server B
Click the phpmyadmin

2. Select the database and export it to your local system.

Export the database and download it on the local system.

3. Login to phpmyadmin on the new server (server A) and import the database on the system.

Note: You should create a database on the new system and the name should be the same with the one from your old hosting.

Import the SQL format and click on go.

If there is no error then you are good to go, your database is set and up and running.

C. Setting Up Database on the Main Website

  1. Go back to the file manager of the new server and edit wp-config.php this is where you change the settings
Editing the wp-config.php

2. Change the Database name , username and password values on wp-config.php to the new server (server B). Save and close

Remember to check the details of the database of the new server as this contain the old one

D. Pointing the new server to domain

Finally contact your new hosting provider for your nameserver in order to point it to the hosting. Normally it looks like

1. n21.example.com
2. n22.example.com

If all the steps are followed properly you should be able to view your new website on the new host without a problem, if there is any error let me know so that we can resolve it together.

Cheers

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade