3 Ways to Create a WordPress Staging Site

August 7, 2018 in SiteLock News, WordPress Security

Test Plugin and Theme Updates Without Breaking Your Live Site!

Here at SiteLock, we often tell site owners about how keeping your site updated is one of the most basic security practices you can and should adopt. Earlier this year we talked about using a WordPress staging site for updates, and how it can help ensure your site updates don’t break your live site. In today’s post, we’re going to cover a few ways to create a WordPress staging site so you can make those changes without the terror that comes with pushing the update button and possibly breaking Live!

What is a WordPress Staging Site?

A WordPress staging site is basically a direct replica of your live website: same content, same plugins, same theme – except it’s a private version that only you have access to. What are the benefits to this? Having a replica of your site allows you to run core, theme and plugin updates THERE, first, to make sure that nothing breaks. As someone who has pushed that update button many times and ended up with something on the site breaking – or even a complete white screen of death – I have learned that doing these updates on your live site is a BAD idea. And that’s where the staging site comes in!

3 Ways to Create a WordPress Staging Site

There’s lots of ways to set up a WordPress staging site – from one-click simple, to a complex developer setup. We’re going to take a look at the 3 typical ways, pros and cons of each, so you can find the setup that works for you, no matter your technical level.
Even still, once you’ve made changes on your staging site, it still won’t affect your live site directly until you make those changes live.

There are three main ways to get your changes from your staging site, to your live site:

  1. Repeating your changes: making the desired changes on your staging site, then making those same changes again on your live site;
  2. Import/export: making your desired changes to your staging site, then exporting and importing them into your live site; and
  3. Full overwrite: fully overwriting your live site with your staging site. Depending on your solution and hosting environment, this can be done either automatically, or manually with a plugin.

All three solutions have their pros and cons, and are considerations you need to take when choosing how you are going to run your staging site workflow. In each of the services I discuss today, I also mention the updating process that works with them. Now onto the contenders!

1. Set Up a Local WordPress Site

In the development world, “local” means the site is running on your own computer – not your web host. In order to do this, you need to install programs on your computer to make your computer function like a server.

It’s standard these days for developers to build websites locally – it runs super fast, since you’re not waiting for communication with a remote host every time you change something. But anyone can use a local site as a duplicate of their live site for testing things like a new theme, or Gutenberg, for example. There are even a few WordPress-specific solutions that make running a local install super simple for non-developers.

Building a staging site locally also actually means your are virtually unlimited in HOW MANY staging sites you can have. Interested in trying out a membership site? Or a site that is purely a blog? Maybe you are feeling confident in your WordPress powers and want to build a blog for a colleague? You can do this locally for free, and then push it up to any hosting account when it’s ready.

Pros

  • Runs super fast because no remote hosting
  • You control your entire environment
  • Unlimited WordPress websites, you can do anything you want with them, not just use for your staging site!
  • WordPress-specific solutions are super quick to install, and allow you to create a fully-functioning WordPress site in minutes, or import an existing site

Cons

  • Getting your staging site to your live site can be a pain. Some offer a direct deployment feature, but it doesn’t work with all hosts. You can export to archive, then import the archive to your live site using a plugin and export, but it’s a bit clunky when you need to do this for every update.
  • As it’s running on your local computer, it’s not fully mirroring your live server. All hosting setups are different, and something that works fine on your local site could break or function differently on Live because of these nuances.
  • Some computers have restrictions in place that do not allow you to install a server for running your site locally. You will need to have admin access on your computer in order for it to run.
DesktopServer Site Creation Screen

Local WordPress development environments like DesktopServer and Local allow you to build and run a fully functional, private WordPress site, right on your own computer

DesktopServer by ServerPress

The first of its kind in the WordPress world, DesktopServer is free to download (but the paid version gives you more options), and setup is typically just a few minutes after you get it installed. By setup I mean, once DesktopServer is installed, you can push a button or two and have a fully functional WordPress site working on your computer in a matter of minutes! I am not going to lie, the first time I saw it demo’ed to me at a meetup by DesktopServer customer service manager Marc Benzakein, I couldn’t believe my eyes.

DesktopServer Direct Deploy Screen

Direct Deploy connects to your live site and does a full migration of your local site for you

It allows you to import sites (like your live site) and export sites to archive. This archive also acts as a fully-restorable backup of your site! You can then either import the archive and overwrite your live site, or use their brilliant Direct Deploy feature to deploy your local site straight to your server. It works with most hosting accounts.

DesktopServer has both a free and paid version. Direct Deploy is only included in the paid version, along a bunch of helpful plugins to make the process easier.

Local by Flywheel

Local by Flywheel graphic

Local by hosting company Flywheel offers a similar solution, but adds on extra developer tools like mirroring live your environment with Apache or Nginx. It also lets you share your local site so others can look at it, or you can test it in other devices. This is great for development reviews, but also comes in handy if you’re just using it as a staging site for testing a new theme – get colleague reviews of it before it goes live!

Flywheel also includes a deployment option, but it only works with their own hosting. Flywheel is a great WordPress host though, and if you have flywheel hosting, you also have another, easier staging solution: push to staging, which we discuss in more detail at the end of this article.

Local is a great solution for developers as well, as it provides many more options for customizing your development environment, and is actively in development to continually add new features all the time. Check out this review of Local by Flywheel over at the WPExplorer blog!

2. Duplicate on a Subdomain/Subfolder or Inside WordPress (on your live site)

As I mentioned above, having a staging site that does not directly mirror your own host’s exact setup can be problematic. Things using the exact version of server software, memory configurations, even the CPU performance of your computer versus your hosting: all can lead to unexpected hiccups when migrating between the two. Having a staging site that lives right on your existing hosting is the only way to ensure that everything you do in your staging site will work as expected on live.

There are a few ways to use your existing hosting account for hosting a staging site alongside your live site. The obvious is to upgrade your hosting to allow another full site with domain, but why do that if you don’t have to? You can instead install your staging site in a subdomain (staging.mysite.com) or subfolder (mysite.com/staging), a solution which nearly every host allows you to do for free.

Check out this post on WPBeginner that discusses setting up a staging site on subdomain vs subfolder!

Pros

  • Mirroring your actual live hosting setup where you can is always a good thing.
  • It’s really easy, because you’re only working with WordPress throughout. Most people familiar with WordPress sites can set this up, because it’s just another WordPress plugin.

Cons

  • This is typically a manual install, a more advanced solution reserved for those who are more adventurous in getting into the nitty gritty of setting up a WordPress site (if that’s you, this can actually be a Pro!).
  • Pushing staging to live can be difficult without a plugin. It is definitely possible to do an update on your staging site, see that all is good, and then do that update again on Live, but this can become confusing for more complex changes.
  • As this solution installs another full version of your live site in a subfolder, it will increase your hosting size. It can also take a long time to set up depending on the size of your website and database. People on limited shared hosting accounts will need to review their site size before proceeding to see whether this requires you to upgrade to a higher hosting account.
WP Staging

WPStaging Plugin

WPStaging is a nifty little plugin that allows you to create an staging or development environment within your existing live site, right there on your same hosting account. Basically it’s setting up a subdirectory install for you, which is really nice, since doing that manually can be complicated.

The Pro version allows you to push and migrate plugins and themes and media files directly to your live site. However, for things like core updates, you will still have to redo those manually in your live site.

Kinsta Push to Live screen

Kinsta is one of a handful of hosting companies that offer simple WordPress staging management built into their hosting packages

3. Hosting Push-to-Staging

Some hosts offer a handy-dandy service along with their hosting account: a built-in staging environment that you can clone from your live site, and once it’s ready, just as easily push the entire staging site (or parts thereof, if you prefer) to your live site. This is enormously convenient when you have a live site that undergoes many changes (like a popular ecommerce site) over the course of your updates process. This is by far the easiest and most straightforward solution to setting up a staging site. However, it comes at a cost: only a few hosts offer this, and their hosting fees may be out of budget for some smaller businesses.

Many offer either a full overwrite, which completely replaces your live with with the staging version, or the option to overwrite just certain sections of your site, or even just the database. You are still definitely able to do a manual update too, which keeps staging and live separate.

Pros

  • Quickly clone your live site directly to your staging site.
  • Ability to create and destroy staging sites easily
  • The easiest way to push your changes from your staging site to your live site

Cons

  • Requires an advanced WordPress setup in place, and is only available through a few WordPress-specific hosts
  • Often only available on more costly hosting packages
  • Still counts toward your site’s hosting size. Many of these implementations require enough space to host three copies of your site. Larger sites may find they run out of space in their hosting account to accommodate them all.

Kinsta, Flywheel, WPEngine and Siteground are four hosts in the WordPress sphere who offer push-to-staging on some or all of their hosting plans.

Reviewing the Need for a Staging Site

As you have probably noticed, all of these solutions have something in common: they require a good amount of planning and decision-making to find the solution that works best for you. Including a Staging site process into your normal website updates workflow can save you a lot of time and trouble in the event of an update breaking your live site somehow. And once you have a staging site, you are free to test out new plugins, features and updates that you don’t want your customers and visitors to see.

WordPress version upgrades are often large, introducing big new features and changes that have the potential to break sites’ themes and plugins. The next WordPress version – 5.0 – is looming on the horizon, with the Gutenberg editor one of the biggest changes in WordPress to date. Having a staging site to practice the Gutenberg integration into your site ahead of time is a way to make sure you are ready when it drops!

Latest Articles
Categories
Archive
Follow SiteLock