Update WordPress (and not only) MySQL database with simple SQL script

Let’s say You have moved Your WordPress CMS to another hosting and You need to change path’s too.

UPDATE wp_options 
SET option_value = 
REPLACE (option_value,'/home/-httpd/mydomain/','/www/var/domain2/');

You can use this not only with WordPress, but other systems too:

UPDATE table 
SET column = 
REPLACE (column,'/home/-httpd/mydomain/','/www/var/domain2/');

Leave a Reply

Your email address will not be published. Required fields are marked *