Useful mysql queries for wordpress website migration

When you want to change your domain name for wordpress site. You need to first take backup of your file system and mysql database. Make sure that backup is completely taken. Verify with any wordpress developer. Then only you start the migration.

I already written detail article for this. You should read following article.

http://wordpressapi.com/2010/02/27/wordpress-migration-hosting-service-domain/

Here is list of mysql queries which are very important when you are doing the wordpress site migration.


UPDATE wp_options SET option_value = REPLACE(option_value, 'oldsite.com', 'newsite.com');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'oldsite.com', 'newsite.com');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'oldsite.com', 'newsite.com');
UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, 'oldsite.com', 'newsite.com');
UPDATE wp_posts SET guid = REPLACE(guid, 'oldsite.com', 'newsite.com');

You may like following Articles!

21 thoughts on “Useful mysql queries for wordpress website migration

  1. Nice post! You truly have a wonderful way of writing which I find captivating! I will definitely be bookmarking you and returning to your blog. In fact, your post reminded me about a strange thing that happened to me the other day. I’ll tell you about that later…

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>