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.
I appreciate the help.
In my experience the following usually works:
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.
create another one (you may use the
same db user/pass if you like).
wp-config.php
.siteurl