Cloning a WordPress Site for Testing

So I’ve been tasked recently with testing a new template for a WordPress Site.  In Joomla! I usually just install the new template and set that template to my user group, then debug away until I’m confident in the design, then set it to the default template for all users.  For WordPress, it’s a little bit more tricky.  I found a plugin that let’s you test out templates, but instead, it was requested that we have a full blown clone of our WordPress blog for testing.  What I ended up doing was exporting the MySQL Database, then replacing all the old URL’s with the new location of the blog including URL’s and file paths.  I then tar up the website, make the appropriate adjustments to wp-config.php and .htaccess files, and I’m done.   The template tester plugin works ok, but there could be potential issues with testing an upgraded template or plugins.

Anyway, here are my steps:

  1. Grab DB Export
  2. Find and replace all URL and Path discrepancies in DB Export
  3. Import DB.sql into New DB
  4. Tar up and Copy site files over
  5. Extract files and update wp-config.php and .htaccess files
  6. Test

This is the way I prefer to do it, some people just set up a new blog, export/import from WordPress Admin and then copy theme files over..  What ever you fancy, I hope you complete your task!