Change WordPress site domain name using phpMyAdmin

There are many cases when we need to move a WordPress website from one domain name to another. The easier
method is to modify the MySQL database directly. We can use the help of phpMyAdmin to easily edit MySQL databases. This is a step by step tutorial on how to change WordPress site domain name using phpMyAdmin. This method can also be followed while moving a WordPress website to a new domain name or for moving a WordPress website from localhost installation to live hosting.
Backup database.
First step performed to change WordPress site domain name is to backup a copy of the MySQL database. This can be done by using the database export option from phpMyAdmin.
After making a backup of the d

 Step 1

UPDATE wp_options
SET option_value = ‘http://www.NEWdomainName.com’
WHERE option_value = ‘http://www.OLDdomainName.com’;

UPDATE wp_options
SET option_value = ‘http://NEWdomainName.com’
WHERE option_value = ‘http://OLDdomainName.com’;

 Step 2

UPDATE wp_posts
SET guid = replace(guid, ‘http://www.OLDdomainName.com’,’http://www.NEWdomainName.com’);

UPDATE wp_posts
SET guid = replace(guid, ‘http://OLDdomainName.com’,’http://NEWdomainName.com’);

  Step 3

UPDATE wp_posts
SET post_content = replace(post_content, ‘http://www.OLDdomainName.com’, ‘http://www.NEWdomainName.com’);

UPDATE wp_posts
SET post_content = replace(post_content, ‘http://OLDdomainName.com’, ‘http://NEWdomainName.com’);

 

http://dan.doezema.com/2010/04/wordpress-domain-change/