Moving a WordPress blog to new domain

WordPress documentation does a pretty good job of explaining the steps you have to take if you are moving your wordpress blog to a new domain.

See Changing The Site URL – Domain Name Change

Even after you update the guid in your WordPress database’s posts table by following the instructions there, you may find that some of the images do not show up, and the image and other links are broken.

Run this command to see if the problem is in the post contents in the WordPress database’s posts table –

select id, post_title from wp_posts where post_content like '%exampleoldsiteurl%';

(Replace exampleoldsiteurl with the old url of your blog)

If this shows posts that are using the old url, you need to replace that url in the post_content just as you did for guid –

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

Make sure to carefully read the instructions on the WordPress Codex link above, and absolutely make certain that you have a back-up of your database before you run these sql commands on it.