you cannot do a simple search and replace of urls in the WP database. The reason is that WP might store values as serialized arrays and altering these by using a search and replace will clause all content in these serialized arrays to be lost. https://interconnectit.com/products/search-and-replace-for-wordpress-databases/