Making a duplicate Wordpress site for testing
Many people want to have a duplicate Wordpress site for testing purposes. In order to do this, there are several steps to take to achieve this outcome. This tutorial will outline the steps for making a copy of a Wordpress site for testing.
Copying a Wordpress site from one location to another
- Log into your cpanel
- Create a subdomain. that is used for accessing the testing site. For example testsite.yourdomain.com.
- Go to your File Manager. Make sure that you select Show Hidden Files when you select the directory to be opened.
- Copy your Wordpress Files from your current directory to the document root directory created for your subdomain. The root directory usually is the same name as the subdomain that was created. Also, click in the folder that contains your WordPress installation and copy the .htaccess file. This file needs to reside in the same location where you have copied your WordPress files or at the root of the new location. The .htaccess file may contain important references to your current Wordpress installation. Depending on your installation setup, you may need to look for this file in the root of the account. For example, InMotion Hosting normally uses a document root of "public_html." Check this location for the .htaccess file if you did not find one in the original installation location for your WordPress site.
Important! When selecting all your Wordpress Files, make sure the folders for the subdomains/addon domains, or any other non Wordpress folders, are not selected. After selecting all, hold the Ctrl key on the keyboard and click the folders that are not being moved so the are not highlighted blue before copying the files. Otherwise, there will be duplicates of those folders in the testing site.
- Create a database This will be used to separate the test site from your main site. If you use the same database for the test site, the live site will reflect the changes that are made on the test site. Importing the existing database to the test site database will prevent this.
- Export your current database
- Import your Database to the new database you created.
- Configure the Test Wordpress wp-config.php file for the test site. This needs to be done or the test site will use the main Wordpress site database.
- Change the site URL for the test site - The site URL is stored in the Wordpress database. in order for the site to load as a test site, the site url will need to be changed to the subdomain url. For example http:// testsite.yourdomain.com.
- Correct image links - Lastly, ensure that image links in your pages and posts are also changed. These are in the database and not connected to the site URL so they will need to be changed separately.
This concludes the tutorial for duplicating your Wordpress for testing.
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
Post a Comment
Do you want to publish a tutorial to our support center?