0
votes

I am moving Wordpress location to other folder on same server and i have used MySQL replace method on other site without problem, but this time it won't replace database content.

I am using these (https://wpbeaches.com/updating-wordpress-mysql-database-after-moving-to-a-new-url/)

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

I have, off course, replaced table names and values, but result is still "0 rows affected" and there are no "matching x row(s)".

What's wrong?

1
what is an error ?Wasiq Muhammad
There in actually no error but it does not affect any rows as expected.Roger Wayne
a) You probably used the wrong url. Check your current url: select * from wp_options where option_name = 'home' OR option_name = 'siteurl' b) You missed at least 2 fields (wp_posts.post_excerpts, wp_links.link_url). You might want to use one of the 271 wordpress url changer plugins. They usually have an updated list of tables and fields to change (the posting you got your code from is over a year old)Solarflare
What you mean by 'old url'? Yes, there might missing some tables and fields but it still should work because there are records it's should match.Roger Wayne

1 Answers

0
votes

Problem solved. I used 'Database Search and Replace Script in PHP' from interconnectit.com.