bluelinecombo
2/20/2015 - 10:00 PM

Migrate WP DB avoiding serialized data

Migrate WP DB avoiding serialized data

UPDATE wp_options SET option_value = REPLACE(option_value, 'http://devdomain.local', 'http://livedomain.com') WHERE option_value NOT LIKE '%{%';

UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'http://devdomain.local', 'http://livedomain.com') WHERE meta_value NOT LIKE '%{%';

UPDATE wp_posts SET guid = REPLACE(guid, 'http://devdomain.local', 'http://livedomain.com');

UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://devdomain.local', 'http://livedomain.com');

UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '/home/dev/wordpress ', '/home/prod/wordpress '') WHERE meta_value NOT LIKE '%{%';