Back to Top

How To move WordPress Site from local to live server

How To move Wordpress Site from local to live server

Sometimes you want to move on your WordPress site from one server to another server. The Most complex part is database when you want to move a WordPress site to another location because WordPress save the base URL in the Database and we can say it saves the absolute path of URL instead of relative path when stores some parameters in database.Here I come with the solution to deal with such situations.

All these values in the database will need to be changed when WordPress is moved but It is not at all hard to do once you get the idea and if you are technical.

Once the site has been moved, first of all, we need to make the change on a wp-config.php file.This value can be changed via WordPress Options page, but if you no longer able to access to old site URL, you have to modify the value via MySQL database.

So, are you ready? Let’s see steps are as follows.This approach is not the new installation of WordPress.

Steps to update wp-config.php

  1. Open your database configuration file wp-config.php which is in the root folder of your WordPress.
  2. You need to replace DB_NAME, DB_USER, and DB_PASSWORD with your live server database details which you created for your new host/server and if require DB_HOST( database host name).
  3. After replacing above informtion, save the updated copy of wp-config.php

To Update the Database

To update WordPress options with the new site location, use the following SQL command.

NOTE: Make sure you have a backup of your database and copies of all your plugins and theme before you update the database. If the database transfer is not successful, will result to broke your sites.

You need to access your phpMyAdmin or log in to the DB server and upload old server database. After uploading old Database run below UPDATE Query in your phpMyAdmin. Using this, You can run WordPress site easily.

Here is the database Query to replace the Base URL of domain:

UPDATE wp_options SET option_value = replace (option_value , '' , '')
WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace 
(guid , '' , '');

UPDATE wp_posts SET post_content = replace 
(post_content , '' , '');

UPDATE wp_postmeta SET meta_value = replace 
(meta_value , '' , '');

Congratulations! Now you’re done and you can go to your new WordPress blog’s URL.After you complete these steps, WordPress can be used normally.of course, You need to do some optimization.

If you face any other problems concerning the relocation of WordPress database to another server, leave a message in the comments below, I would like to sort out the issues.

Leave a Reply

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

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

Most Popular Posts

Fixed Remove class issue with MooTools

Posted on 7 years ago


How to Count Number of Columns in MySQL

Posted on 6 years ago


How to add custom post type in RSS Feed?

Posted on 5 years ago


Hello world

Updated 1 week ago

Nick Carter

In depth Understanding of Laravel Core

Updated 2 months ago


ECMAScript 6 New Features – 2

Updated 1 year ago


The Reader’s Poll – June 2015

Posted on 4 years ago


The Reader’s Poll – August 2014

Posted on 4 years ago


The Reader’s Poll – June 2014

Posted on 5 years ago


The Readers’ Poll – May 2014

Posted on 5 years ago


The Readers’ Poll – August 2013

Posted on 5 years ago