Creating a duplicate WordPress install for testing

I am trying to create an identical wordpress website – on the same server. I need to create this as a testing environment but every time I try to duplicate the site it breaks. Is there an easy way to create a testing environment, of the live site, on the same server while keeping all of the same widgets, plugins and content?

I am an experienced web developer but a novice when it comes to Word Press.

Read More

I appreciate the help.

Related posts

Leave a Reply

3 comments

  1. In my experience the following usually works:

    1. Setup your prod site
    2. Copy all files to the test site
    3. Modify the wp-config settings as needed, and create the test db schema
    4. Export all the data from the prod site control panel and import into the test site
  2. The problem is that while you have all the files identically, your database contains all the configuration information for the live site. You’ll need to copy the database from live to your development/testing server. You can run an export on the SQL and import the data into a new database. Then modify the wordpress/wp-config.php file in your development site to connect to the new copied database.

    Additionally, you’ll want to go through the new copied database, table: wp_options and change the site URL to match the development site/server instead of the live server.
    Some default fields you’ll want to change are:
    option_name: home
    option_name: siteurl
    As well as fields installed by plugins that contain your site URL and path.

    1. Create a directory for the testing.
    2. Backup the original database, and
      create another one (you may use the
      same db user/pass if you like).
    3. Execute the SQL file from the backup (at the test database)
    4. Edit the wp-config.php.
    5. (Test Database) Update the URL at the (your prefix)_options table. It’s the very first value with the option name: siteurl
    6. Done.