Skip to main content
Print

Creating a Staging Site

This guide creates a staging copy of your site. Hera Backup copies your live site as it is now into a new folder, with its database tables under their own table prefix.

Before you start

  • Hera Backup is installed and activated.
  • You are signed in as an administrator, on your live site.
  • The server has room for a copy of your site's files and of its database tables.

Opening the wizard

  1. Go to Hera Backup > Staging Sites.
  2. Click Create Staging. This opens the Create Staging Site page, a wizard with five steps listed down the side.

The five steps

Use Next and Back to move between steps, and Cancel on the first step to return to the list.

  1. Name: enter a Name. The Slug is filled in from it (lowercase letters, digits and hyphens), and the Path from the slug, as /staging-{slug}/. The path is the staging site's folder inside your WordPress folder, and the staging address is your site's address plus that path, for example https://yoursite.com/staging-{slug}/. The folder must be new or empty. It cannot be your WordPress folder itself, and it cannot be inside wp-admin, wp-includes, wp-content or your uploads folder.
  2. Tables: the database tables are listed, all ticked. Untick a table to leave it out, use Find a table to search, or open Advanced: add tables by pattern to add tables with patterns such as wp_wc_. Leaving everything ticked clones every table that shares your live site's table prefix. If the list cannot be loaded, the step shows a Tables (one per line) box instead; leave it empty for the same result.
  3. Components: under Components to clone, Database is always cloned and cannot be unticked. Plugins, Themes, Uploads (media library) and Must-use plugins are ticked by default. Untick Uploads (media library) to save disk space; images will then be missing on the staging site. Unticking Plugins or Themes shows a warning, because the staging site will not work like the live one without them.
  4. Options: the Database prefix for the staging tables is suggested for you, as a hera{n}_ prefix no other staging site uses, such as hera1_. Under Pro options, Subdomain (optional) is available with Pro. The step also states that the staging site runs in a sandbox; there is nothing to switch on.
  5. Review: check the summary (it lists Sandbox: always on), then click Create staging.

The wizard asks Hera Backup to check the path and the prefix when you leave those fields, and again when Review opens. A value that would be refused shows its reason under the field, and Next stays disabled on the Options step until it is fixed.

The database prefix

The prefix must start with a letter or underscore, contain only letters, digits and underscores, and end with an underscore (hera2_, not hera2). Keep the suggestion unless you have a reason not to. Hera Backup refuses a prefix that:

  • is your live site's own prefix,
  • is the beginning of your live site's prefix (for example w or wp when the live tables use wp_), because it would also match the live tables,
  • overlaps the prefix of another staging site, in either direction,
  • already names a table in your database, even one that starts with your live prefix: wp_wc_, for example, names WooCommerce's order tables.

These rules protect your data: a staging site's tables live under its prefix, and deleting the staging site drops the tables it created there and no others.

Subfolder or subdomain

  • Subfolder (Free and Pro): the staging site lives at https://yoursite.com/staging-{slug}/ (or whatever Path you chose). It uses your existing domain, and no DNS setup is needed.
  • Subdomain (Pro): enter a host name in Subdomain (optional), such as staging.yoursite.com. Before cloning, Hera Backup checks that the name has a DNS record (A, AAAA or CNAME) and refuses it if it does not, so point the subdomain at your server first. The staging address uses the same scheme as your live site (http or https). The files are still written to the folder named in Path, so set the subdomain up on your host to serve that folder.

In both cases the staging tables are created in your site's own database. The Separate database option on the Options step is marked as not available yet.

What happens during cloning

After you click Create staging, you are taken back to the Staging Sites list and the clone runs in the background. Its Status moves through Initializing, Cloning database, Cloning files, Adjusting URLs and Finalizing to Completed, and the list refreshes on its own every few seconds.

  • Cloning database: the selected tables are copied into new tables under the staging prefix. Account roles are carried over to the new prefix so your users keep their roles, and Hera Backup's own records in the copy (backups, schedules, logs, the staging list) are emptied.
  • Cloning files: your site's files are copied into the staging folder, except the components you unticked, other staging sites' folders and Hera Backup's own backup folder. A file the server cannot read is skipped and counted, and the row then shows how many were skipped.
  • Adjusting URLs: your live address is replaced with the staging address in the copied tables. The staging copy of wp-config.php is set to use the staging prefix and address, its own login cookies and no WP-Cron; for a subfolder staging site, its .htaccess is pointed at the staging folder.
  • Finalizing: the sandbox is installed on the staging site.

Your live site stays online and its own tables and files are not changed. While the clone runs, the row's Actions menu offers Cancel clone; a cancelled clone keeps what it had already copied until you delete the staging site.

After creation

The new staging site appears at the top of the Staging Sites list, which shows the newest first. When its status reads Completed, open it from the row's Actions menu with Open, or click its address in the URL column. Sign in with the same username and password you use on the live site: the staging site has its own copy of your user accounts (its users table is cloned unless you untick it) and its own login cookies, so you sign in to it separately. The admin bar there shows the STAGING badge.

A staging site is always a copy of the live site at the moment you create it; the wizard has no option to start from a backup.

Table of Contents