0

I consider myself fairly versed in this matter, however I've recently had a rash of issues when moving sites. I am able to successfully move the site, edit wp-config.php, move the database, etc.

Once I've moved the database, I then execute these queries:

UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');

This correctly updates all of my links, image references, etc. - HOWEVER I end up with a different problem:

What happens is that some widgets break (examples are the WP Text Widget, as well as the add-on widget WYSIWYG Widget). Completely. As in the widget does not appear under the sidebar any longer, and I have to completely reconstruct them (the plugins are fine, it's just the widget disappears from the sidebars).

I've searched around WP-SO, and I've seen comments that warn against this method of updating the db, but what I'd like to know is if there is a way to resolve this, and what that way is.

1 Answer 1

2

There are some instances of serialized data in the database, notably in things like widget options, that become invalidated if you do a blind search-and-replace without accounting for different string lengths. You might try a tool like this one to do a search and replace that also handles serialized data: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.