How to clone wordpress site for the develope purpose?

I have a wordpress site and I have to do modifications very often so i would like to create clone of that website for testing because i would like to test my modification first for a few days before i put them on my site.

There are links to the “real” site everywhere so i’m not sure how to do that.

Read More

UPDATE (improved explanation):

Problems:

  1. links are absolute

  2. this need to be online so other developers can test site

Related posts

Leave a Reply

6 comments

  1. Copy/paste your entire files from your domain to everywhere you want as first step.

    Go to the phpMyAdmin or use a tool that permit to you to export your database as .sql.

    Open the .sql file and run a find and replace and replace all your absolute path (just the one before wordpress: ie.: of this http://www.yoursite.com/wp-content/etc. Replace only http://www.yoursite.com)

    Check for the permission of the DB, maybe you should change also the Server name, DB Name, Username and Password.

    Create a new database and import the file you exported and modified the minute before.

    Now you got a clone of the previous website ready for your experiments on both side, files and DB.

  2. If you were working on WP MultiSite you could avoid having to duplicate your database and then doing a sql find and replace as mentioned by using one of the WP cloning plugins.

    The NS Cloner – http://wpmu.org/clone-sites-within-a-wordpress-multisite-network/handles everything for you automatically including the DNS, DB, and Hosting. Based on your mutlisite setup you can then deploy it to a new subfolder or subdomain. For advanced features after your new site is live you can use the Pro Version and do advanced things like search and replace on the live site.

    Again this is for MultiSite only, however I would highly recommend moving to that architecture anyway to allow you to take advantage of all of WP multisite has to offer.

  3. What’s your problem exactly?
    You just need to download all worpress files from your server.
    Then create a local copy of the database so that you have all the data.

    All the links are relative in wordpress, so you won’t have any troubles with links to the “real site” 😉