Fork me on GitHub

Shadows

Shadows are a unique feature in Seravo that provides you with non-public instances of your website. They are most commonly used as Staging and Development instances.

Getting a Shadow

Email us at wordpress@seravo.com and ask us for a Staging instance. You will have one opened up for you in no time.

It’s also possible to have your own domain or subdomain for the staging environment. Please note that this feature is still in development so some functionalities are not yet fully implemented and there are known bugs. For example the command wp-shadow-reset and the ‘Exit Staging’ button do not currently work with a staging environment using its own domain.

In later revisions of this feature, you will be able to create on-demand shadows via the WordPress admin dashboard and the Seravo plugin.

Using a Shadow

The Seravo Plugin

The Instance Switcher module in the Seravo plugin adds a simple interface to your WP-admin view, that allows you to easily switch between your Shadow and Production instances.

Screenshot from the Seravo plugin

SSH/SFTP

You can SSH into your shadows and work on them via SSH/SFTP or git. When a new shadow is created you will receive the SSH/SFTP credentials to use with it.

Your WordPress login will remain unchanged, since the site is a copy of your production site when first created.

You can tell that you’re in a shadow by looking at the WP_ENV environment variable. If you’re in a shadow, it will be either staging or development, depending on what’s applicable in your situation. Your production instance will have a WP_ENV value of production.

mysite_1a2b3c$ wp-list-env
...
WP_ENV: staging

Reset the Shadow environment

You can use the command wp-shadow-reset to copy the current production site over the chosen staging instance. The command has to be run on the production server.

user@mysite_123abc:~$ wp-shadow-reset 
No shadow specified, please run "wp-shadow-reset <shadow>" with one of the shadows below:
- mysite_1a2b3c
- mysite_4d5e6f

The command requires you to choose the shadow environment you want to reset. The system will then ask if it’s okay for you that the database and all files in /data/wordpress will be replaced with the production site. After choosing yes, the shadow will be reset.

How does it work?

Under the hood, shadows work exactly the same as your production instance does, the only difference being that they have no public domain mapped to them.

Shadows have their own full Linux environment and their own database, completely separate from your production instance. You can use SSH to work on your shadow instances in precisely the same way as you can with your production instance.

To view your shadow in the browser, a special cookie called wpp_shadow must be set.

The value of the wpp_shadow cookie determines which shadow instance will be served to your browser.

Example:

mysite_123abc (production)
mysite_1a2b3c (staging)

Setting a cookie wpp_shadow=1a2b3c;path=/ will return the staging instance to your browser.

The Seravo plugin handles these cookies easily for you.

You can also use GET parameters to set these cookies as described below.

You can set the Shadow cookie easily via a GET parameter in the url. Example:

https://mysite.seravo.com/?wpp_shadow=1ab2c3

The link above would set the cookie wpp_shadow=1a2b3c;path=/ in your current browser session.

Curl to shadow

With curl you can fetch a file from the shadow in the following way:

curl -iLs https://example.com/test.php?wpp_shadow=1a2b3c"