This article explains the backup function of WP STAGING | PRO

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
- 1 Create a Backup of a WordPress Website
- 2 Download the Backup File
- 3 Restore the Backup on Same or Another Server
- 4 Restore a Multisite Backup on Another Multisite
- 4.0.1 Restoring subdirectory backup on subdirectory multisite:
- 4.0.2 Restoring subdirectory backup on subdomain multisite
- 4.0.3 Restoring subdomain backup on subdirectory multisite
- 4.0.4 Restoring subdomain backup on subdomain multisite
- 4.0.5 Restoring domain based backup on subdirectory multisite
- 4.0.6 Restoring domain based backup on subdomain multisite
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

First, open the WP STAGING | PRO plugin

If you are not sure how to install the WP STAGING plugin, read the article “How to install WP STAGING Pro“

Click on the “
**Backup & Restore button, and WP STAGING | PRO lists all existing backups

You’ll see two options: “
**CREATE NEW BACKUP and “ **UPLOAD BACKUP
Click on “
**CREATE NEW BACKUP 
You can optionally assign a name to better identify the backup

So, for instance, if you plan to update WooCommerce or any other plugin, you can name your backup like “
**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
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
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 siteslike mysite.com/site1, mysite.com/site2 Subdomain based network siteswhere every site has its own domain like sub.example.com, sub2.example.com etc. Domain based network sitescan 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($adjustedSites, $baseDomain, $basePath, $homeURL, $isSubdomainInstall) { foreach ($adjustedSites as $site) { $adjustedDomain = explode $site['domain0] .. $baseDomain; $site['new_url'] = str_replace($site['new_domain $adjustedDomain, $site['new_url $site['new_domain'] = $adjustedDomain; } return $adjustedSites; 
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($adjustedSites, $baseDomain, $basePath, $homeURL, $isSubdomainInstall) { foreach ($adjustedSites as $site) { $adjustedDomain = explode $site['domain0] .. $baseDomain; $site['new_url'] = str_replace($site['new_domain $adjustedDomain, $site['new_url $site['new_domain'] = $adjustedDomain; } return $adjustedSites; 
example.com will turn into destination.com
site1.com will turn into site1.destination.com
site2.com will turn into site2.destination.com
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.