How to migrate wordpress to a new server?

Want to move wordpress to a new server with same domain.Many people are choosing low cost web hosting to have a test run to try luck with blogging. A very few are accomplishing their blogging goals.I think 90 % are blogging for money.If they do started making money,definitely moving to a faster reliable web hosting is desirable.

Migrating wordpress from your existing server to a new reliable server is very easy if you follows exactly the same route that I am drafting here. Moving without a proper plan may harm your site. Also it is highly recommended a backup before we start. The method is slightly unorthodox but very easy and simple.

Step 1 : Setting up wordpress files in Local computer

We need all wordpress file including your wp-content folder locally in your computer. WP-content folder is the most important data folder of wordpress sites. This is the folder where all uploaded files which are used by wordpress sites are stored.For example Image,videos themes & plugins etc. If you lost other files or folders in wordpress can be restored but wp-content folder, if no backup impossible.

Download Latest WordPress CMS from . Let’s extract this to the desktop of local computer.Open the wordpress folder & delete  wp-content.

Very important: This is the wp-content folder downloaded from not from existing website.

Wordpress folder

Step 2 Download required wordpress files?

Connect FTP With your existing server. If you don’t Know what is FTP and how to use it.I have made a documentation on How to Use Filezilla.Please read it an come back.

We need the following files from the existing server.

  1. wp-content
  2. .htaccess

These files need to be transferred in the wordpress folder kept in our desktop. Do as instructed below.

Select destination folder ( wordpress) in the local pane >select htaccess & wp-content folder using Ctrl + Clickright click on it >In the context menu click download.

Download wordpress files to local computer

Step3: Download wordpress database

The official WordPress distribution only supports the MySQL data base.Have a look on how to download data base using PhpMyAdmin from webhosting cpanel.

Login to your hosting Cpanel & Locate  Databases Tab> PhpMyAdmin


Clcik on PhpMy Admin.This is how PhpMyAdmin Home look like

PhpMyAdmin Home

On the Left Pane Click on + Button to expand.A list of database will be displayed if have more than one.




Now click on your Database name. If you are unsure about the database name of your site follow the instruction.

Locate wp-config.php in your blog where wordpress installed using FTP Filezilla> Click View/Edit

View wp-config

The file will be opened in a notepad/or choose appropriate program to open it & Locate the codes something like this

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'ayana_wrdp6');

The highlighted name is your DB Name and the first part is the table suffix. Now you know your DB Name.Click on it.It will expand the name with a list of Database Tables.

Export tables

Click on export to export all tables from the database.This will direct you to the next step.


Keep the options as it is.Click Go.This will start downloading your tables in SQL Format.The downloaded file will look like this.

Database backup

Now you have all the data’s of your wordpress site in local computer for uploading to new web hosting server.

Step 4:Uploading wordpress files to the new server

Now connect your new webserver using FTP, and upload the entire content inside the folder to the new folder.Do not upload the folder itself. and most importantly if your primary domain is using wordpress For  example. then upload it in root folder. in most case public.html or www folder. If wordpress is using in your sub folder like then upload it in sub folder blog.

Upload content to new server

Step 5:Creating a new database,user

Next step is creating a new database its user and give privilege to the user.Switch to your web hosting control panel.Access  MqSQL Database Wizard.Most Control panel have this option.I am showing you a typical HOSTGATOR Cpanel DB Wizard.


Enter the name of database.can use any name of your wish.

Step 1 enter the name of database

Click next step will take you to the screen where a user can be created. can use any name.

Create database user name

Butt if you create a user name, related to your website which will help you in identifying the database easily if you are dealing with multiple DB in a single hosting. Use a strong password that password crackers cannot break your database.

Clcik on Create User will bring another screen to add the user to the database.

Add user to the database

Check the box all privileges. and click next step to compete the process.


Step 6  uploading Database  tables to new DB

Now lets add the database tables to the newly created database. To do this again go to PhpMyAdmin click on newly created DB.

Database home screen

Click on Import & choose the database backup downloaded from previous server

Select the backup

Click on Go,Import will start  and display a success message.


Database for the wordpress  in new server is ready.

Step 7 Connecting Database to wordpress site

Now we have all wordpress file & database in new server. Next stage is connecting the database with wordpress site.To do this you have to go your FTP and locate the uploaded file wp-config-sample.php.

Wordpress config

Rename the file to wp-config.php

Open the wp-config.php with a notepad by right clicking on it  & select View/Edit from the context menu. Locate the following codes.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define(‘DB_USER’, ‘username_here’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘password_here’);

Enter your DB name, DB User name & password ,after changing the file will look  like this.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'ourbook_dbacbook');

/** MySQL database username */
define(‘DB_USER’, ‘ourbook_acbookus’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘hsghf#s55#@$’);

save the  editor (notepad), FTP will ask  “Upload this file back to the server”

Upload back to the server

Click Yes to upload edited file. Now the database is connected. Make sure that you have not misspelled anything while editing wp-config.php.A small mistake will not let you establish connection with DB.

Step8 Updating name server

We have completed all data migration process. But still your website/blog is connected to old server. Next step is to tell your domain that you have changed the server and pick the website data’s  from new server. So this can be done by updating name server in domain control panel.

What you need is

  1. Access to domain control panel from your domain registrar.
  2. Name server address from your hosting provider.

We can manage the website  if the domain and hosting is purchased from different company using name servers. Here I am demonstrating hosting account with hostgator and domain with godaddy.

Get name server from hosting provider. it will be in your welcome mail like this

Hosting sample account informations


Usually hosting account company will provide you two name servers like.

1st Nameserver:
2nd Nameserver:

Now Login to your Domain control panel.

Godaddy login

Click on Domains> All domains

domain cpanel

Click on domain Name will take you to settings page. In settings page manage name server

managing name server

In the name server settings screen. Edit name servers under custom setup.


Enter the new server name server names


Click OK.Click save.Done!.

Propagation will take time. Nowadays it takes few minutes.Your site will start working on new server.

Migration of wordpress from old server to new server cmpleted. If you like this tutorial please do share it on social medias. Left your thoughts through comment form.You can ask

Leave a Reply