David Nash

Wordpress Guru Sydney

Duplicate WordPress site for local development and testing environment

Posted on August 6, 2009

1. Download all files from eg http://example.com, upload to eg http://localhost/example/.
2. Export mysql database from example.com
3. Create a local mysql database with the same user, password and database name. These can be found in wp-config.php
4. Import the database into your new local account
5. Log in to the database, and do:

update wp_options set option_value='http://localhost/example/' where option_id=1

You’ll now be able to log in at http://localhost/example/wp-admin, using the same username and password as http://example.com/wp-admin.
5. In WordPress, click ‘Settings’ and change the blog address to your local address.
6. Profit!

  1. David says:

    Instead of step 5 you can do

    update wp_options set option_value=’http://localhost/example’ where option_id=39;

    Valid for WordPress 2.8

  2. Sebasjan Sol says:

    Im having a problem with my content working with this solution. Got the homepage working and I can log into the dashboard with my duplicate copy of my site, however when I navigate to any page, I get Error 404.

    Any suggestions as to what I can do regarding getting my db content to work properly would be greatly appreacited!!

    - Sebasjan Sol

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>