Search code examples
phpwordpressstagingcloning

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.

UPDATE (improved explanation):

Problems:

  1. links are absolute

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


Solution

  • 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.