Accessing the CMS Staging Environment

Need to test your site with new plugin or theme updates? The staging environment is for you.

About CMS Staging

CMS’s staging environment is available to everyone, and for all sites. However, because of the scale of CMS, and for historical reasons (CMS is a teenager, after all), accessing the staging environment for CMS is trickier than most. The primary sticking point is that the staging environment runs on exactly the same URL as the production environment. This means you essentially need to trick your computer into viewing staging rather than production.

Additionally, there’s a few prerequisites in order for you or your team to get onto the CMS Staging environment. They are:

  1. You need to be on a UBC Connection – either be on a UBC Wifi on campus or on a VPN if you are working remotely.
  2. If you need to access the dashboard of sites on staging, you need to sign up for a Staging CWL Account – this will be *completely* separate from your existing CWL and only work on staging/verf environments at UBC. You’ll need to request a CWL staging account by filling in a request form for UBC IT’s Identity and Access Management team.
  3. Know where your hosts files is and how to edit it: https://www.hostinger.com/tutorials/how-to-edit-hosts-file

How to Access CMS Staging

You will need to edit your hosts file in order to see it on staging. For example, if you wanted to see the president.ubc.ca (where the canonical URL is president3.sites.olt.ubc.ca) site on the staging environment, you would need the following lines in your hosts file:

10.19.171.36 sites.olt.ubc.ca
10.19.171.36 ctlt-cms-main-2022.sites.olt.ubc.ca
10.19.171.36 president.ubc.ca
10.19.171.36 president3.sites.olt.ubc.ca

The first two are required, always (if you want to see the dashboard on staging). The second two are the domain mapped version and the un-domain-mapped (canonical) urls of the site. So, for each site you wish to check on the staging environment, you will need to add both the domain-mapped (if you have one) and un-domain-mapped url of the site to your hosts file pointing to 10.19.171.36. Personally, I would add them all at once, and then comment them out when you no longer want to be on the staging environment. If you place a # character at the start of the line, that will comment it out (so it no longer applies). i.e.

# lines that start with a # symbol are comments and will not be processed by your computer.
# 10.19.171.36 ctlt-cms-main-2022.sites.olt.ubc.ca

Would mean you no longer see the staging cms home page. This means you can simply remove or add the # character when you want to be on staging or not.

A note of caution: making mistakes in your hosts file can cause problems for your internet access. It’s important you get it right. So check for typos.

Extra Notes

Here are a few extra bits of info you should know about the UBC CMS Environment.

  • Sometimes the media you have on the live site may be missing; we can update staging though, so let us know
  • Sometimes the content on staging may be out of sync with the live site; again, we can update it should you need (but see note about what the staging environment is NOT for below)
  • The WordPress Admin bar will be green when you’re on staging – so you don’t forget that you’re on the staging environment

What the staging environment is for

  • Testing updates to WordPress don’t cause major errors (i.e. white screens) or large functionality breaks (such as password protected pages etc.).
  • Testing updates to plugins don’t cause functionality problems (i.e. gravity forms updates or new plugins that are added).

What the staging environment is not for

  • Testing content; the database could be updated/changed at any moment, don’t rely on content being there on staging.