Updating WordPress can be stressful, so anything we can to do reduce the stress is a good thing. One of the easiest ways to handle WordPress updates is to use a Staging Site.
This will allow you to safely install and test all your updates BEFORE you roll them out to the live site allowing you to fully test all your updates in a safe staging environment.
What is a Staging Site?
It’s a duplicate or a clone of your existing website that is used for testing purposes. This will allow you to easily install updates, change themes or do all manner of alterations to your website without affecting your live website.
One of the key benefits is the ease with which you can ‘push’ or publish the changes to your live website directly from your staging site.
Many WordPress users will test these changes on a local website on their computer and then push those changes out to the live site. The main problem with this method is that there are technical differences between your localhost and your website’s server.
Using the method covered in this tutorial, both versions are on the exact same server, so you can be assured that the changes you make will work on your live website.
Now we know what they are and their benefits, let’s see how to create one.
Setting up your Staging Environment
For this step, we’ll be using the free WPVivid Backup plugin, but there are many more easy to use staging plugins available to choose from. Go ahead, log into your WordPress dashboard and go to Plugins > Add New and search for WPVivid Backup.
Once installed and activated, open up WPVivid Backup > Staging from your admin menu and you’ll see the option to create a new staging site.
Click Create a Staging Site and we’re ready to configure our staging environment. We need to add some basic information to get started. Let’s go through the settings now and then we’re ready to create our new staging server setup.
Before we start though, it’s always good practice to ensure you have adequate space on your hosting server for the production environment and the staging server.
For the first part of the staging process, we need to say where we want to create our site. We have 2 options in the free version of the plugin or 3 if we use the Pro version of WPVivid Backup.
- Website Root: This will place your staging site at the root of your website’s domain. For example, https://yourwebsite.com/mystagingsite/. This would be my recommendation to keep things simple if you’re using the free version.
- /wp-content/: This will place it inside the wp-content folder of WordPress. This is possibly a little safer if you intend to use the same staging environment long term.
- Sub-Domain (Pro): This pro feature allows you to set up your staging environment in its own dedicated subdomain. For example; https://dev.yourwebsite.com/. This has the added benefit of allowing you to use your Elementor Pro license in a development environment. Something many users may well find useful.
For our example, we’ll stick to the Website Root option. But, feel free to use whatever your preference is.
Finally, we can set the custom directory name that our site will use. You can use whatever makes logical sense for your set-up or stick with the autogenerated name.
Configuring The Database Location
Next, we have the option to set up our database preferences. This is relatively simple and you can choose to leave the default settings in place if you’re not sure how best to set things up.
Here we only have a couple of options. The first is the prefix we want to use for the duplicate database tables. Feel free to use the default suggestion or give the tables a prefix that makes sense to you. This can be very useful if you want to run multiple staging sites and have an easy way to see which database table belongs to which environment.
The next 2 options are all about where you want to store your database information.
- Install the staging site to the live site’s database (recommended): This will place your duplicate database tables in the same database as your main website.
- Install the staging site to a separate database: This allows you to easily choose an alternative database to store the information in. This may be useful if you have a very large website with a huge database. Otherwise, I’d recommend sticking with the first option for maximum compatibility.
If you choose the second option, you’ll need to have a database table created on the same server and have the relevant database credentials handy. This includes your database user, server name, etc.
Once you’ve inserted your connection details, click Test Connection to ensure everything is working and your connection is configured correctly.
Finally, we need to set up what we want to include in the staging process. In the free version of WPVivid Backup, we don’t have any control over this aspect.
However, if you use the Pro version, you can choose what to include or omit from the process. This can be incredibly handy for larger websites where you don’t necessarily want or need to copy over the media, uploads, etc.
Once you’ve finished configuring everything you simply need to click the Create Now button, sit back and wait for the cloning process to complete. This can take from a few minutes to a lot longer depending on the size of your production environment, the database tables, etc.
When this stage completes you’ll have an identical clone of your live site either in the chosen staging folder or in the subdomain folder you chose during set-up.
Once finished you’ll see the above screen with all the relevant information about your new site listed for ease.
Using Your Staging Server
Now that your staging server is set up you can log into your dashboard and make the necessary updates to your website, safe in the knowledge that your production environment will NOT be affected at all.
I’d recommend updating your site and then thoroughly testing it on both the frontend and the backend to ensure everything is working before you either update the live website or push the changes over (using the premium version of WPVivid backup).
Updating Your Live Website
Now that you’ve updated and fully tested your website, it’s time to either make the same changes and updates to the live site or if you’re using the premium version of WPVivid, you can take advantage of the Copy Staging Site to Live option.
Before you do though, always ensure you do a database backup and a full site backup so you have exact replicas of the live site prior to updating (just in case anything goes wrong at this stage).
Once you’ve finished, you can go ahead and delete the copy of the staging files from your server using the delete option and you’re done.