I am switching my WordPress-powered website to a new server and changing domain names at the same time, which means I have to find and replace many fields in my MySQL database.
Specifically, I must replace “olddomain.com” with “newdomain.com” whenever they appear in a field in MySQL such as “http://olddomain.com/?p=34”.
How can I do a massive find a replace in my MySQL database? I know that the LIKE SQL command can find fields with “olddomain.com” in them, but how do I replace specific portions of fields?
You can use this search and replace script for this purpose
http://interconnectit.com/124/search-and-replace-for-wordpress-databases/
As the author said raw
replaceis not good in these casesReferred in WordPress.org doc itself.