I spent this past weekend setting up a copy of this blog in my local development on my laptop. I wanted to see if upgrading from WP 2.3 to 2.5 would break my current theme and as I suspected, it did. What broke wasn't obvious (category browsing I believe), but it was enough to make me decide to change my theme. There's nothing wrong with the current theme, it just feels like it's time for a change.
Setting up a local copy of my blog was really easy. I only needed to modify two WordPress settings and even then, that was only because I choose to use a different domain name locally. The basic process looked like this:
- Copied all of the WP files for my blog to my laptop
- Exported the live WP database and imported it into the local MySQL database using phpMyAdmin
- Created a database user to match the one on the live site (with the same password)
- Created a VirtualHost entry in my local
httpd.conf
:
ServerAlias blog.raamdev.dev
DocumentRoot "/Users/raam/workspace/raamdev.com"
ServerName www.blog.raamdev.dev
/etc/hosts
) so that blog.raamdev.dev would resolve to the local web server:127.0.0.1 blog.raamdev.dev
wp_options -> siteurl = http://blog.raamdev.dev
General Options -> Blog Address = http://blog.raamdev.dev
Now I could type in http://blog.raamdev.dev in my local web browser and use my blog on the local machine. This is great because it allows me to test themes and make changes without screwing up my blog.
This is so helpful. I have messed around with several things trying to do this, but since I don’t know much about MySQL, I was lost. I really love this solution. It should definitely be in the wordpress codex somewhere.
Thanks, Kit! Wow, five years on and I’m still using the same method for developing and testing my WordPress stuff. 🙂 I’ll have to write an updated version of this article that explains everything I’m using and outlines the steps more clearly.
I just can’t believe how easy it is. I did quite a bit of searching and when I first needed to do this and everything I found was very involved. The simplest thing I found was a plugin called “duplicator”, but it’s not nearly as simple as this.
Was there anything missing here? What could I do better explaining?