sergey-kozlov
1/11/2019 - 6:13 AM

Wordpress migrate query

Wordpress migrate query

SET @oldHost := 'http://oldhost.com';
SET @newHost := 'http://newhost.com';
UPDATE wp_options SET option_value = @newHost WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts
SET post_content = REPLACE (post_content, @oldHost, @newHost);
UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, @oldHost, @newHost);
UPDATE wp_posts
SET guid = REPLACE (guid, @oldHost, @newHost);