Tutorial : Move WordPress blog to new domain or location
by toy
I was going to move my wordpress blog. How the hell I’m supposed to do. Is that gonna affect me so much.
Unfortunately, yes, because WordPress uses absolute path to access each page, that means if the URL changes everything will be affected. Apart from re-configure wp-config.php and move everything to the new location. Database needs to be changed as well.
I have found this code from http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/
Just bang those three sqls into your wordpress sql. It works like magic!.
1 | UPDATE wp_options SET option_value = REPLACE(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; |
1 | UPDATE wp_posts SET guid = REPLACE(guid, 'http://www.old-domain.com','http://www.new-domain.com'); |
1 | UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); |
That should do it.
If you need more information. Please visit http://codex.wordpress.org/Moving_WordPress
Twitter
Facebook