How to migrate WordPress to another server
March 6th, 2009
Here’s the basic steps to migrate WordPress to another server. Most steps are high level.
1. tar up existing site and extract files on new server
2. create db on new server, then move data
3. setup db user
4. database changes:
UPDATE wp_options SET option_value = replace(option_value, ‘http://old.domain.com’, ‘http://new.domain.com’) WHERE option_name = ‘home’;
UPDATE wp_options SET option_value = replace(option_value, ‘http://old.domain.com’, ‘http://new.domain.com’) WHERE option_name = ‘siteurl’;
UPDATE wp_posts SET guid = replace(guid, ‘http://new.domain.com’,”);
UPDATE wp_posts SET post_content = replace(post_content, ‘http://new.domain.com’, ”);
5. using the Dashboard, go to Settings –> Miscellaneous Settings and update upload dir