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
- Changed
wp-config.php
to reflect local box settings - Changed
wp_options
table. Setwp_options
to point to localhost address whereoption_name
is'siteurl'
,'home'
.
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.
Questions:
- Can we fix
wp_posts
so 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.