All About Staging Sites

What is a Staging Site

# Top

A staging site is a copy of your live production site which can be used to safely test updates to plugins, themes, and custom code. The staging site has a separate file system and set of database tables so while it is a clone of your production site, changes made to your staging site will never affect your live site. In this way the staging site allows you to ensure updates and changes have no negative impact on your site before applying those updates and changes to your production site.

Why Should I Be Using a Staging Site

# Top

In WordPress, the most common scenario is that you have a handful of plugins installed and working together. However, each new plugin update comes with a chance of new plugin conflicts with other plugins and your theme.

When using a staging site, you can safely and calmly ensure that new plugin updates have no negative impact on other plugins, your theme, and your site as whole.

The primary reason for using a staging site is to ensure your student’s experience of visiting and interacting with your website is not disturbed when you make changes and upgrades to your site.

However, there are many other reasons why using a staging site is beneficial:

  • You can thoroughly test updates and changes and prevent downtime by ensuring there are no new conflicts or issues
  • You can get to know new features before deploying those features to your students and visitors
  • When problems and issues arise and your require the assistance of third-party support (Like our LifterLMS Support team) the support team can troubleshoot more rapidly in a stating site
  • Prevent loss of income and user confidence in your site and platform from downtime, bugs, and issues

How Should I Use a Staging Site?

# Top

To use a staging site you’ll want to understand the core concepts and adapt this general workflow to match the functionality of your website.

In general, you’ll want to follow theses rules:

  1. Before testing new changes, copy data and files (your media library and your WordPress database) from Production to Staging (not the other way around!).
  2. In staging, update your plugins and themes and make any custom code changes.
  3. In staging, run your functional tests and perform a visual inspection of both the frontend  (what your students and visitors see) and backend (admin panel) of your site.
  4. When deploying, move your plugin and theme files from staging to production. In most circumstances you should not move your media library and database files from staging to production as doing so could result in lost data on your production site.

How Do I Setup a Staging Site?

# Top

Setting up a staging site does not have to be complicated but you will have to do some work. The work you’ll need to do depends on the method you choose:

Look below for details on each of these methods.

How to Manually Setup a Staging Site on Any* Host

# Top

On nearly any web host you can create a staging site on a subdomain or in a subdirectory of your main site.

Setting up a subdomain (for example, staging.mywebsite.com) is slightly more complicated as it will require you to configure DNS settings for the new subdomain.

A subdirectory (for example, mywebsite.com/staging) does not require you to configure any additional DNS settings.

Once you’ve chosen method (subdomain or subdirectory) you can move on to installation. Manually configuring a staging site is, essentially, the same as setting up your production WordPress site. Many hosts provide you with 1-click WordPress installations but you can, of course, install WordPress manually via FTP.

This guide assumes that you can install WordPress and will not cover the actual installation. If you need help installing WordPress, you should refer to the WordPress documentation: Installing WordPress.

Once you’ve installed WordPress in your subdirectory or subdomain, you can move on to the section below: How to Clone Your Production Site to Your Staging Site.

How to Use 1-click staging via your Host

# Top

Many WordPress hosting companies provide you with simple 1-click staging setups and workflows. When using a 1-click staging workflow you very likely do not have to do anything manually. You can simply click a button and create and clone to your staging site without any further effort.

We have been using WP Engine for all of our LifterLMS sites and we use the WP Engine staging to test changes before deploying them to our live sites.

Learn more about how to create and use WP Engine’s Staging Environment.

If your host already offers staging sites, check their documentation on how to utilize the staging site feature.

How to Clone Your Production Site to Your Staging Site

# Top

When cloning your production site to your staging site you must do the following:

  1. Copy your database and rewrite URLs
  2. Copy your themes and plugins
  3. Copy your media library

If you’re using an application or a service offered by your host, you can likely skip this step as the service will take care of all of this for you. If you’re managing your staging site manually you can do all of this manually or you can use some helpful plugins to speed the process up.

There are a number of tools and plugins you can use to clone your site, but for this guide we’re going to use the free plugin All-in-One WP Migration. This plugin will allow you to clone your live site to production in two easy steps: export then import.

  1. Install All-in-One WP Migration on your staging and production sites
  2. Generate an Export of your Production Site
    1. On your production site’s admin panel navigate to All-in-One WP Migration -> Export
      1. Setup a find and replace to match your sites. This will ensure that when you import this to your production site all of your images display properly and all links work!
        configure the export
      2. Find should be the full url to your production site. For example, enter http://mywebsite.com/
      3. Replace should be the full url to your staging site. For example, enter http://mywebsite.com/staging/
    2. Expand the “Export To” menu and click “File”
    3. The export may take a few minutes to process (especially on large and mature sites).
    4. Once ready, you will be prompted to download the file to your computer. Download that file!
  3. Import your production export to your staging site
    1. On your staging site’s admin panel, navigate to All-in-One WP Migration -> Export
    2. Choose “Upload from File” and select the export file you downloaded in the previous step
    3. This will take a while since we’re uploading your entire site and database! Be patient.
    4. At the conclusion of the upload, the plugin will warn you that you are overwriting your entire website. Everything is fine! We’re doing this on purpose but it is important to note that if you’ve made changes in your staging site you will lose them. Click proceed to finish the import.
    5. Once finished, you’ll need to log back in to your staging site. Your username and password from the production site will now work here.
    6. After logging back in, make sure to flush your permalinks if you see any 404 errors on the frontend of your staging site.
  4. Celebrate for a bit then get to testing your plugin and theme updates safely!

Gotchas and Common Issues

# Top

Once you’ve setup your staging site you may want to take these additional steps to avoid some common issues and pitfalls.

Disable Recurring Payments

If you have any recurring payments scheduled, you’ll want to ensure you stop those so that your students are not double charged.

If you’re using LifterLMS recurring payments or WooCommerce Subscriptions you don’t have to do much but pay attention to the warnings on your admin panel.

Both LifterLMS and WooCommerce Subscriptions attempt to identify when your site is cloned but it is possible that a recurring payment could slip through if the detection methods fail for some reasons. Check out these guides on how to disable payments in LifterLMS and WooCommerce Subscriptions.

Disable E-Mail

If you have scheduled engagements you don’t want your students getting duplicate emails. After setting up your staging site, consider installing and enabling a stop emails plugin like Disable Emails. Note that if you forget your password you won’t be able to reset it on your staging site if you install this plugin. You’ve been warned!

No Index / Password protection

To prevent potential SEO issues resulting from duplicate content and to ensure your students and visitors only access your live site you should no-index your site and consider adding password protection to your entire site.

You can setup no-index by navigating to WordPress -> Reading Settings and checking the box to “Discourage search engines from indexing this site”

noindex

 

You can also add a password wall to your entire site ensuring that only you (or anyone you’ve given the password to) can access your staging site. We recommend this very simple free plugin Password Protected.

Licenses for Premium Plugins and Themes

If you’re using any paid plugins or themes (any LifterLMS add-on, for example) you may not be able to activate these plugins and themes in both your production and staging sites unless your license provides you with multiple activations.

For LifterLMS add-ons, we recommend either “juggling” your licenses or never activating your staging site and, instead, manually updating the add-ons on your staging site.

Juggling your keys means deactivating your license on your production site, reactivating it in your staging site, updating your plugins in staging, deactivating your license in staging, and then reactivating it in production. There’s a lot of steps there but if you don’t want to manually update plugins (upload via FTP) and you don’t want to spring for a multi-site license this is your only solution!

Please note that LifterLMS add-ons are always fully functional regardless of your license key status. Your license enables you to get support and receive automatic plugin updates!

Staging Service Applications

# Top

If you don’t want to setup a manual staging site and your host doesn’t offer a staging site you can use a third-party staging application like WP Stagecoach. This paid service provides you with the tools and infrastructure to easily setup and sync to a staging site with minimal effort.

Last Updated on
Was this article helpful?