How to re-create a wordpress website for testing

August 13, 2013 in Blog

Follow these instructions to take a copied wordpress site and get it running on a local server. These instructions use XAMPP as the local Apache / MySQL / FTP server.

  • Get a copy of your wordpress site’s files and an export of it’s MySQL database (a .sql file, can be obtained through phpmyadmin)
  • Start an Apache server running somewhere, I use XAMPP on a macbook for local testing.
  • Place the unzipped site files in the root folder of the install (for XAMPP it is ‘htdocs’) or in a subdirectory of that folder
  • open mySQL by typing localhost/phpmyadmin (or name-of-computer/phpmyadmin)
  • create a database and call it what you wish
  • import the wordpress database to this new database (the .sql file)
  • open wp-config (one of the files) and change the database connection to localhost,name of your new database, root, and no password (IMPORTANT!)
  • open the new database you’ve copied in and edit the wp-options table. Find home and site urls and change them to http://localhost(IMPORTANT!)
  • If you need admin access and don’t know the real password (a different password is often a good idea so you’ll know which panel you are in) do the following:
  • create a password and create an md-5 hash of it.
  • Find the users table and delete the encrypted password from the password field, and place your new md-5 hash of your new password into the field.
  • You can now log in as that user in the local version with your new password
  • use localhost or localhost/subdirectory or name-of-computer/etc to reach the copied site.