Moving a Wordpress Install
One of my clients recently purchased new servers and wanted to migrate all their sites to the new servers. Some of these sites were wordpress powered. Thankfully, I found this article that made the move a breeze.
The critical thing I want to save for my future reference is the following sql lines from that post:
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';
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
See the post on My Digital Life for the full instructions ![]()
June 20th, 2008 at 7:08 am
I was a little worried the first time I had to migrate a wordpress site too. But like you said it's actually very easy.
I do it for my clients now all the time.
October 4th, 2008 at 12:44 pm
We just released a plugin which makes dealing with SQL unnecessary. And it does update both the permalinks and the links in post and page content.
Check it out at: http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/
October 21st, 2008 at 9:09 am
@velvet
Awesome! thanks for sharing that.
For moving from one directory on a website to another one can just put a .htaccess redirect and that solves the old-links-in-posts problem. But for moving to a different url altogether your plugin is a lifesaver.