How to duplicate a WordPress Site for Development and Testing

How to duplicate a WordPress Site for Development and Testing

It’s recommended to test the significant modifications on a copy of a WordPress website before implementing them on a live site. There are various methods, such as using the Softaculous Staging feature and the total upkeep-backup plugin.

Here we’ll explain how you can manually make a copy of an existing WordPress site to test.

Warn: This tutorial is intended to be used on single-site installations. If you employ this Multisite feature, this method will result in two separate MULTISITE installs. If you duplicate a multisite install, the repeated structure and data will be part of the databases for multisite installations and the WordPress files. This may need to be clarified. If you need to familiarize yourself with the distinctions between single-site and multisite, please only use these steps to duplicate one-site WordPress install.

PSST! Check out our Nginx-powered WordPress Hosting to increase performance and be capable of managing multiple WordPress websites efficiently.

Copy a WordPress Site to Another Location

  1. Log into cPanel.
  2. Create a subdomain to the testing website – e.g., testsite.example.com.
  3. Start the File Manager in cPanel and ensure Display Hidden Files is turned on.
  4. Navigate to your WordPress root directory and copy your WordPress files from your current directory to the subdomain root directory you created, usually the same name as the subdomain itself.
  5. Choose ALL WordPress files.
  6. Warn! When selecting your WordPress files, ensure that the folders containing the subdomains/addon domains and the other WordPress folders aren’t fixed. After you click the Select All and hold on the Ctrl keyboard key, click on the folders that aren’t being moved to ensure they’re not highlighted before copying the files. You’ll need the Command key to accomplish similar things if you’re using an Apple computer.
  7. Click Copy at the top of File Manager.
  8. Type the path to the new subdomain document root folder.
  9. Transfer the .htaccess file. The file must be located in the same place you’ve copy-pasted your WordPress files to or at the root of your new location. The .htaccess file could contain crucial references to the present WordPress installation. Based on the configuration of your building, you might have to search for this file within the root of your account. For instance, InMotion Hosting commonly uses an underlying document root called “public_html.” Check this directory to find the .htaccess file if you did not locate it in the initial installation location for your WordPress website.
  10. Create a database. This is used to distinguish your test site from the main website. If you are using the same database as your test site and live site, it will reflect on that test site. Utilizing a brand new test site database will prevent this.
  11. Export your current database.
  12. Import your existing database into the new database that you created.

Configure Test Site

  1. Modify the Test WordPress wp-config.php file for the test website. This ensures that the site is running on the latest database.
  2. Make changes to this test website’s domain and home URL into the subdomain test, which will bring up WordPress’ database. WordPress database.
  3. Images that are correct because they’re in the database but are not associated with the URL of the site.

Enhance WordPress by incorporating Security plugins and correct mixed content issues for SSL (HTTPS) use with Very Simple SSL.

 

Leave a Reply