Save 15% on Instant Deploy Bare-Metal Servers in 26 Global Markets with Coupon Code: EdgeSave

How to Migrate a WordPress Site

Login to FTP with cpanel username either with Filezilla or any FTP program. Navigate to the public_html folder and download the WordPress files including .htaccess on your local computer.

Login to cPanel. Under database options open the phpMyAdmin application.


Select the database that contains your WordPress installation from the list on the left hand sidebar

Once selected, click on the Export tab on the navigation menu in right hand side panel and save the file on your local computer.

Once the database export and the FTP transfer of your files have both completed, move onto the next stage.

Create The WordPress Database On Your New Host Server where you are moving your wordpress website.

Login to the new cPanel account and under database options , click on mysql databases.

Create a new database with an appropriate name for your website.

Create a new MySQL user (with a secure password).

Add this user account to the new database and grant it All Privileges.

Check the box All privileges and click on Make changes

Write down the database name, the new MySQL username and its password. As we will need for further configuration.

Edit the wp-config.php File

Browse to the folder on your local computer where you downloaded your website files to. In that folder there is a file called wp-config.php that controls the access between WordPress and your database.
Make a copy of this file and store it in another folder on your local computer. This is necessary for restoring the changes we are about to make should something go wrong later.
Open the original version of the file with your favorite text editor and make the following three changes.

a. Change The Database Name

Locate the following line:
define(‘DB_NAME’, ‘db_name’);
The db_name portion of this line will currently be set to the MySQL database name of your old web host. This must be changed to the name of the new database you have just created.

b. Change the Database Username
Below this you will find the line:
define(‘DB_USER’, ‘db_user’);
In this line you need to change the db_user portion from the username of your old host to match the new username you have just created.
c. Change The Database User Password
Finally, edit the third line:
define(‘DB_PASSWORD’, ‘db_pass’);
As with the others the db_pass section of this line must be changed to the new secure password you created for your MySQL user.

Import Your Database on the new server.

Login to the cPanel and under database options open the phpMyAdmin application.

  1. Select your new database from the list on the left hands sidebar. Once it opens select the Import tab from the navigation menu.
  2. In the File to Import section click the Choose File button and select the SQL file you exported previously on your local computer.


Un-tick the Partial Import check box, make sure the format is set to SQL and then click the Go button. The database import will now begin.

e) You should receive a message informing you of the success of the import when it has finished.

    1. Upload The WordPress Files To Your New Host

a) Login to FTP with the cpanel username either with Filezilla or any FTP program to your new host server
b) Navigate to public_html folder
c) Upload all the WordPress files from local computer that you downloaded previously which should include the updated version of wp-config.php

Update Permalinks

At this point you should be just about finished. If you had permalinks setup on your dev site, and you start clicking around the new, live site, you might initially notice that none of your pages are showing up when navigating away from the homepage.

    1. Login in to your WordPress admin panel
    2. navigate to Settings
    3. Permalinks and simply click “Save Changes” so WordPress can create a new .htaccess file on your new server.

Some times WordPress will give you an error message when you try and save your permalink settings, telling you that it couldn’t create an .htaccess file. This just means that you need to go into your web host’s file manager and create a new file, name it “.htaccess” and then make it writeable (permissions 777).

and you are all set !!!!.

Share on Twitter
Share on Facebook