-- Replace the urls in the data, so you can copy to a new domain

SET @old_site = 'oldsite.com';
SET @new_site = 'newsite.com';

UPDATE wp_options 
SET option_value = REPLACE(option_value, @old_site, @new_site)
WHERE option_value LIKE CONCAT('%', @old_site, '%');


UPDATE wp_posts 
SET post_content = REPLACE(post_content, @old_site, @new_site)
WHERE post_content LIKE CONCAT('%', @old_site, '%');