This article explains the backup function of WP STAGING and explains how to backup and restore your WordPress website.
You can create a backup of your entire WordPress website with one click and save it locally. So, If your website breaks due to an updated plugin or an attack, you can restore your website and bring it back to its previous working state.
Contents
If you’d rather watch a video than read, have a look here. It explains all the steps of how to back up and restore WordPress:
Create a Backup of a WordPress Website
Let’s start.
If you did not do already to install the WP STAGING | PRO plugin first and read the article “How to install WP STAGING | PRO“.
Go to WP Staging > Backup & Migration:

Click on “CREATE BACKUP.”

In the opening modal, assign a name to better identify the backup and select if you want to backup the whole website or only plugins, themes, media files or the database.
If you run a WordPress multisite website you can also specify if you want to backup all multisite websites or only the current network website.

So, for instance, if you plan to update WooCommerce or any other plugin, you could name your backup “Backup before installing WooCommerce.”
Then select the components of your website that WP STAGING | PRO should include in the backup. Unless you want to carry out a particular component, leave all the boxes selected.
Click on “Start Backup.”
The time it takes to create a backup differs and depends on the size of your website, but the WP STAGING’s backup is pretty fast and often much faster than other backup tools. So, especially for huge sites, you will notice a considerable performance advantage compared to other backup plugins.

When the backup is ready, you will find the backup under”Your Backups.” The icons indicate which components the backup includes.

Download the Backup File
To download the backup, click Actions > Download. That will download a file with the extension “.wpstg.”

Downloading the backup file to a local computer is recommended because you want to ensure that you always have access to the backup file. For instance, If an attacker hacks your website, he could delete the backup file from there, and you would not be able to restore the site anymore.

Restore the Backup on Same or Another Server (Migration)
To restore the backup, you can either select the backup from the list of existing ones or, upload the backup file from your local computer.
You can even upload the backup file to any other existing WordPress website and use that backup file to clone your website to another hosting provider and server.
Go back to WP STAGING and click the “Upload Backup” button.

Select the downloaded backup from the file explorer and upload it.

Once the backup is uploaded, click on Actions and Restore.

If the restore is successful, you will see the “Finished” modal.

Open your website and test whether the website works as intended and is entirely functional.
Restore a Multisite Backup on Another Multisite (Migration)
If you created a backup from a multisite network and you want to restore the backup on another existing multisite, for example, to copy the multisite to another server, there are a few things to consider, depending on the type of multisite you operate:
- Subdirectory based network sites like mysite.com/site1, mysite.com/site2
- Subdomain based network sites where every site has its own domain like sub.example.com, sub2.example.com etc.
- Domain based network sites can be set up on these both type of installation.
WP STAGING can handle out of the box the following different multisite setups:
Restoring subdirectory backup on subdirectory multisite:
example.com will turn into destination.com
example.com/site1 will turn into destination.com/site1
example.com/site2 will turn into destination.com/site2
Restoring subdirectory backup on subdomain multisite
example.com will turn into destination.com
example.com/site1 will turn into site1.destination.com
example.com/site2 will turn into site2.destination.com
Restoring subdomain backup on subdirectory multisite
example.com will turn into destination.com
site1.example.com will turn into destination.com/site1
site2.example.com will turn into destination.com/site2
Restoring subdomain backup on subdomain multisite
example.com will turn into destination.com
site1.example.com will turn into site1.destination.com
site2.example.com will turn into site2.destination.com
Restoring domain based backup on subdirectory multisite
example.com will turn into destination.com
site1.com will turn into destination.com/site1.com
site2.com will turn into destination.com/site2.com
To remove the Top-Level Domain ending, E.g. *.com (TLD), you can use this filter:
add_filter('wpstg.backup.restore.multisites.subsites', function($sites, $baseDomain, $basePath, $homeURL, $isSubdomainInstall) {
$adjustedSites = [];
foreach ($sites as $site) {
$adjustedDomain = explode('.', $site['domain'])[0] . '.' . $baseDomain;
$site['new_url'] = str_replace($site['new_domain'], $adjustedDomain, $site['new_url']);
$site['new_domain'] = $adjustedDomain;
$adjustedSites[] = $site;
}
return $adjustedSites;
}, 10, 5);
Copy this filter in a mu-plugin and then start the backup restore process.
As a result:
example.com will turn into destination.com
site1.com will turn into destination.com/site1
site2.com will turn into destination.com/site2
Restoring domain based backup on subdomain multisite
example.com will turn into destination.com
site1.com will turn into site1.com.destination.com
site2.com will turn into site2.com.destination.com
To remove the Top-Level Domain ending, E.g. *.com (TLD), you can use the same filter as above:
add_filter('wpstg.backup.restore.multisites.subsites', function($sites, $baseDomain, $basePath, $homeURL, $isSubdomainInstall) {
$adjustedSites = [];
foreach ($sites as $site) {
$adjustedDomain = explode('.', $site['domain'])[0] . '.' . $baseDomain;
$site['new_url'] = str_replace($site['new_domain'], $adjustedDomain, site['new_url']);
$site['new_domain'] = $adjustedDomain;
$adjustedSites[] = $site;
}
return $adjustedSites;
}, 10, 5);
example.com will turn into destination.com
site1.com will turn into site1.destination.com
site2.com will turn into site2.destination.com
Replace destination hostname while restoring a multisite backup
Use the filter below if you want to change the hostname of the destination multisite while restoring a multisite backup.
Examplewww.example.com
will turn into sandbox.example.com
add_filter('wpstg.backup.restore.multisites.subsites', function($sites, $baseDomain, $basePath, $homeURL, $isSubdomainInstall) {
$adjustedSites = [];
foreach ($sites as $site) {
$site['new_url'] = str_replace('www.', 'sandbox.', $site['site_url']);
$site['new_domain'] = str_replace('www.', 'sandbox.', $site['domain']);
$site['new_path'] = '/';
$adjustedSites[] = $site;
}
return $adjustedSites;
}, 10, 5);
That’s it. With WP STAGING | PRO, you have created a backup of your entire WordPress website and learned how you can restore your WordPress website from a backup or restore the backup on another system.