mischacolley
6/21/2014 - 12:08 AM

SQL Query for Database Migration. Paste into phpMyAdmin.

SQL Query for Database Migration. Paste into phpMyAdmin.

UPDATE wp_options SET option_value = REPLACE(option_value, 'http://www.oldwebsite.com', 'http://www.newwebsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldwebsite.com', 'http://www.newwebsite.com');

UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldwebsite.com', 'http://www.newwebsite.com');

UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://www.oldwebsite.com','http://www.newwebsite.com');