fbpx

How to Deploy a WordPress Staging Site With cPanel

Editing a production WordPress site is akin to detailing your car while it’s on the highway. You may arrive at your destination on time and in good shape. On the other hand, it could all go horribly wrong—and if you do it often enough, your luck will eventually run out.

If a company relies on its WordPress site or WooCommerce store, risking editing the live production installation is simply not worth it. WordPress staging sites, also known as development or testing sites, are a safe bet.

In this article, we will explain what WordPress staging sites are, why you should use them, and how cPanel’s WP Toolkit (WPT) makes it simple to deploy a staging site and synchronize changes back to the production site.

What Is a WordPress Staging Site?

A staging site is essentially a duplicate of a production site. It contains the same data and files, but it is not publicly accessible and is usually hosted on a different subdomain. Unless you specify otherwise, any changes you make to a staging site are not transferred to the production site. It behaves exactly like the production site because it is a clone hosted in the same environment, making it an ideal testing ground.

Creating a staging or development site used to be complicated and time-consuming. You had to export data from the production database, create a new one, import the data, copy the files, reconfigure the site, and create a staging subdomain. The process would then have to be reversed in order to deploy the changes to production.

Because of this complexity, many WordPress users avoid using staging sites in favor of the risky high-wire act of editing a busy live site. However, if you host WordPress sites on a server managed by cPanel and WHM, the process is as simple as a few mouse clicks.

Why Do You Need a Staging Site?

Many situations call for the use of a WordPress staging site to test changes before committing to them. Any change that is more complicated than publishing a post should ideally be thoroughly tested before going live.

Use cases for staging sites include:

  • Before potential customers visit, test new landing pages to ensure that every component works as expected. 
  • Testing updates for compatibility issues can be tedious, but WP Toolkit’s Smart Update can help you with that.
  • Creating a new theme or editing an existing one.
  • Adding new functionality to the site’s code. 

Staging sites are also useful when you want to let developers and designers work on your site but don’t want to give them access to the production installation. 

How to Setup a WordPress Staging Site

We’ll demonstrate how to set up a staging site and deploy changes back to the live environment. 

Login to your cpanel and expand the detailed view of the site you want to work with by selecting WordPress Toolkit from the cPanel main page menu.

cPanel WordPress Toolkit Staging Site

In the dashboard view, select the Clone tool. You can identify the staging site’s subdomain and path in the Clone interface. The subdomain can be an existing domain or one created by the Toolkit. You can also change the database name if necessary.

cPanel Clone WordPress Site

That’s all! The staging site and subdomain will now be created by the Toolkit. You can access the new site alongside your other sites in the main WPT interface.

Use WPT labels to differentiate staging sites from live sites. Click Add Label and select the right option from the dropdown menu.

cPanel Label WordPress Staging Site

After labeling sites, use the Sort and Filter dropdowns at the top right of the interface to sort and filter them.

Commit Staging Site Changes to Production.

It’s time to push changes to the production site after you’ve developed and tested a new feature or design. To accomplish this, we must copy the staging site’s database and files. This was once a complicated and error-prone process, but with the WP Toolkit, it can now be completed safely in less than a minute.

Click the Copy Data tool in the staging site’s WPT dashboard. 

cPanel WordPress Copy Data

Select the production site from the Target dropdown menu in the Copy Data interface. You have complete control over which elements of the site are transferred. You can copy files, databases, and individual database tables. You can also decide whether to overwrite and delete production files that were edited or deleted on the staging site.

Everything except the database’s post and user tables and their associated metadata tables is copied in our example image. This allows us to synchronize the WordPress instances without overwriting or deleting posts and users that were created after the staging site was created.

cPanel WordPress Staging Site Copy To Production

Because copying can be a destructive operation, WPT creates a restore point automatically so that you can quickly roll back if something goes wrong.

The WordPress Toolkit’s clone and copy features work together to provide a quick and easy staging site deployment. You can set up a staging site in seconds and easily push changes to production. The WPT means faster, safer, and more reliable WordPress workflows for agencies and other businesses that provide WordPress hosting and management services. 

Recommended read

How to login to your cPanel from your Harmonweb client area

Leave a Reply