Staging Environments (Shadows)

What are Shadows?

Shadow or Staging is a temporary copy of the site in production. Its main purpose is to provide a safe testing environment without the risk of breaking something in production. The number of Shadows that can be opened on a site depends on the level of service plan in use.  If your site doesn't have a staging environment yet, contact our customer support. We'll set one up for you!

Using a Shadow

You can see a list of the shadows available on your site by logging into the site manager, and navigating to Tools > Site Status > Shadows. You can also see the list directly from the drop-down menu in the top bar of the admin panel, which says "Now in: PRODUCTION" when you are on a production site. The text changes depending on the selected development environment.

Seravo's shadows work with a cookie, so the shadow always has the same address as the real site in the production environment. This ensures that the settings for plugins and other content on the site work correctly. This is important because some WordPress plugins will stop working or work incorrectly if the site address suddenly changes to something else. To make it clear to the user whether a production site or a shadow site is visible, the top and bottom bars of the control panel have texts and a red warning colour if the shadow site is being viewed.

In the shadow, you can safely make any development experiments and changes you want, and they will not be publicly visible to visitors at the production site. Once you have tested that the change produces the desired result, you can make final changes to the production site. You can return from the shadow to the real site by clicking on the "Exit" link in the top or bottom bar. Sometimes you may need to access the shadow environment without logging in to the production site. This can be achieved either by using a separate domain for the shadow, or moving directly to the shadow with an address like this (edit the address with the correct domain and id of the shadow environment): 

Resetting the Shadow

To ensure that the changes made to the shadow site reflect as closely as possible what the changes will do to the production site, it's a good idea to reset the shadow from time to time, which means copying the latest content from production to the shadow. Note! Any data in the shadow is destroyed when it is overwritten with a fresh copy from the production environment.

You can find the option to reset the shadow from the production site’s admin panel under Tools -> Site Status -> Shadows.

Differences between production and staging environment

Unlike production environments, shadows are not automatically backed up. However, backups can be made of shadows manually. This is done using the wp-backup command or the Seravo Plugin in the WordPress admin panel. See more detailed instructions on how to take a backup yourself.

As there are no automatic backups, we recommend that editing and further development of the site is done elsewhere. The development environment should therefore be used for testing, not for saving edits. Read more and check out our developer guide!

The new shadow also has debug messages enabled by default. If you wish, you can hide these messages by editing the wp-config.php file (located in /data/wordpress/htdocs/wp-config.php) as follows:

* For developers: show verbose debugging output if not in production.
if ( 'production' === getenv('WP_ENV') ) {
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', false);
define('SCRIPT_DEBUG', false);
} else { define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', false);
define('SCRIPT_DEBUG', false);

Please note that it is easy to export only code changes from local to shadow and from shadow to production, as the WordPress database model does not support any automation for copying individual content or setting changes from one database to another. Warning: If the entire WordPress database is copied from the shadow to production, the production database will be overwritten and essential data may be lost.

For developers

For more information on shadows, see Seravo's developer documentation. The guidance is intended for coders and includes advice on best practices for Git version control.

Can I use a Vagrant virtual machine for site development?

Yes. In fact, the /data/wordpress folder on the server already contains a Vagrantfile, so by copying that directory to your computer and running the vagrant up command, you can start a Vagrant virtual machine compatible with the Seravo environment. Using Vagrant is particularly useful for Windows and Mac users, who can use it to have a virtual machine with a ready-to-run Linux environment with HTTP servers and databases. For more information about Vagrant, see Seravo's developer documentation and GitHub.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.