I'm trying to clone a wordpress blog that i have on a internet web server on my local machine. I performed the following steps.
- Backed up and Restored Mysql DB on localbox
- Copied all filesystem files on local box
wp-config.phpto reflect local box settings
wp_optionsto point to localhost address where
It seems to be working, however all the content that I uploaded (like images) is yet pointing to
http://www.olddomain.com/wp-content/uploads/2013/05/some_image.jpg. Now I notice that within the
wp_posts, all posts have this href hardcoded to old domain.
- Can we fix
wp_postsso that there is no connection to old domain blog? I was thinking of writing a script that will replace all instances of old domain with localhost address. Is there a cleaner way of doing this? This way the clone would be complete.
- Is this a correct backup? Am i missing something? I know there might be other ways of doing this (import/export tool) however, I am more comfortable doing a db & filesystem sync every time I want to backup my data.