Posted By

timkinnane on 10/05/10


Tagged

mysql database wordpress migration WP3


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gtspades


Update Wordpress DB to new domain


 / Published in: MySQL
 

URL: www.owlandfox.com

If you\'ve got a Wordpress install that\'s changed domain or you\'re making a local or development copy, you\'ll need to update the Wordpress DB tables with the new URL.\r\nThe first step is the options table, with siteurl and homeurl. The posts also store the URL, but if the main options are correct WP will figure it out, though I update them too just in case.

  1. -- change wp_ to your database's table prefix
  2. -- change oldurl, newurl
  3. -- oldurl is the one in the database already
  4. -- newurl might be your localhost or development address
  5.  
  6. UPDATE wp_options SET option_value = REPLACE (option_value, 'http://oldurl','http://newurl');
  7.  
  8. UPDATE wp_posts SET guid = REPLACE (guid,'http://orldurl','http://newurl');

Report this snippet  

You need to login to post a comment.