memo: change wordpress domain name

Jan 28, 2009

If you want to move a wordpress.org installation to a new domain these commands are necessary to bring the database up to speed with the domain name change:

UPDATE wp_options SET option_value = replace(option_value, 'http://old', 'http://new');

UPDATE wp_posts SET guid = replace(guid, 'http://old','http://new);

UPDATE wp_posts SET post_content = replace(post_content, 'http://old', 'http://new');

This is only for domain name change, if you are also moving to a different host then more db manipulation is necessary, like for example changing the upload_path option in the wp_options.

Kudos for this tip.