If you’re here, you probably have a sound backup strategy in place to protect your data from any loss or outages. But, do you have a strategy in place to test the efficiency of your stored backups? Just like any other website file, your backup could turn bad for several reasons, including:
- Missing or corrupted files
- Lack of storage space
- Incomplete backups
- Virus or malware infections
- Incompatibility with an installed plugin/theme after an update.
In this blog post, I'll show you how to test your WordPress backup before restoring it.
A bad or corrupted backup file should not be used to restore a hacked WordPress website or one with a major data breach. It can lead to further complications and problems. Imagine losing all your website data and then finding out that your backup files are also not working! Clearly, an efficient backup strategy is of no use if you are unable to restore the backups when you need them the most.
You can only avoid this problem by regularly testing your website backups and ensuring that they are usable whenever you’d require them. However, testing backups is not very easy and requires you to invest your time and server resources.
Read on and I will show you a few methods to test your WordPress backups and the one that I recommend the most.
How to Test WordPress Backups Before Restoring
Here are the 3 primary ways of testing your WordPress backups:
- Manual Testing
- Backup Testing using DesktopServer
- Automated Testing using a Backup Plugin
Let’s evaluate each of these testing methods now in detail.
Method #1. Manual Testing
As a WordPress user, you can test backups manually by setting up a local testing environment on your computer.
The first step in manual backup testing is uncompressing your existing WordPress backup file. It should typically contain the following files:
- Database backup file in SQL, ZIP, or GZIP file format
- Core and customized WordPress files
Next, you need to execute the following manual steps in the given order.
To start, you need to find your database user credentials.
- Open the wp-config.php file in your uncompressed backup file. Search for the database name and user credentials (similar to how it is shown below).
- Make a note of your database name along with the user credentials (username and password) as provided in this file.
Your next step would be to create a new database.
- Log into the phpMyAdmin tool (on your local testing environment).
- Click “Create” to add a new and empty database file.
After creating the database, you need to create a database user with the same credentials as noted in the first step.
Important: Creating a database user with the same name as in the wp.config.php file is critical for your backup test to work.
- Click “Add User” in the phpMyAdmin tool to create a new database user.
- Select the right option to grant all database privileges to the newly added user.
Now you want to import the Database Backup.
- Click the newly added database file.
- From the “Format” tab, select the existing database backup file (from your local computer) that you want to import.
- Click “Go” to import the selected file.
This is a good time to upload your WordPress files to your testing environment.
- After copying your WordPress files, open the wp-config.php file, and search for the following code:
define ('DOMAIN_CURRENT_SITE', 'your-site.com');
- Replace the “your-site.com” with the “localhost” before saving the file.
After performing these steps, you can manually test your WordPress backup in your local testing environment.
Method #2. Backup Testing Using DesktopServer
As compared to manual testing, setting up a local testing environment using a tool like DesktopServer is much easier. DesktopServer allows you to create “virtual servers” where you can test WordPress backups.
- Install the DesktopServer tool on your local computer.
- After installing, upload the WordPress backup file using the “Export, import, or share a website” option in the tool.
Note that this feature is only available for premium customers of DesktopServer.
- After uploading the backup file, test the local website to see if it is functioning properly.
In summary, manual backup testing and using DesktopServer can be a long and time-consuming process. In addition to using multiple tools, you need some technical skills to test your backups smoothly without any issues.
You also need to test multiple backup versions to ensure that all of them are functioning properly and are ready to be restored at any given time. This can be a difficult task for even seasoned WordPress users.
Besides the long testing process, creating a local testing environment for each of your WordPress backups can overload your web server. This may slow down your site.
WordPress backup plugins can reduce many of your hassles, and make it easier for you to test your existing backups. Let’s see how you can use a backup plugin to test your backup files.
Method #3. Automated Testing Using a Backup Plugin
You can choose from many WordPress backup plugins that can easily set up a local environment for testing your existing backups. Among the leading backup plugins for WordPress websites, the BlogVault tool provides the following benefits that can make backup testing easier for any user:
- A complete “Auto Restore” functionality that lets you test backups and restore your WordPress website from the centralized dashboard.
- The entire backup and restore process is conducted on BlogVault’s dedicated servers, ensuring no load on the client’s web server.
- Features the “Test Restore” functionality where you can test all your stored backup versions on a “staging” website that is a copy of your live website.
- Suitable for testing and restoring backups on large-sized WordPress websites (with over 300GB of data).
- Advanced auto-recovery feature to restore tested backups on your website in a quick time.
How to use the “Test Restore” functionality to test backups:
- Create your BlogVault account.
- Add the website that needs backup. Once you do that, BlogVault automatically creates a backup of the WordPress site you specified.
- To test your backup, log in to your account and select the website that you have just added.
- Navigate to the “Backups” section of the selected website, where you can view the number of existing backups (similar to the screen shown below).
- Click the right arrow (highlighted above) to view more details of the existing backups.
- Click the “Test Restore” icon (as highlighted below) on the following page.
- Next, specify the backup version and the PHP version that you want to test.
- Click “Submit.”
- On successful creation of the “Test Restore” staging site, enter your account credentials.
- Click the “Visit Test Restore” button (as shown below).
- Once you login to your account, the tested backup version is successfully restored to your live website.
With these few easy steps, you can perform the testing of any of the available backup versions and restore them safely to your website. Once the restoration completed, you can choose to delete the “Test Restore” staging site by clicking “Delete Test Restore” from the screen (as shown above).
You can also use this tool to restore an older backup version for your website. For example, here is a sample screen showing a list of backup versions for a particular website.
Each backup version is provided with information including:
- Your WordPress version.
- The number of files and tables in your backup,
- Information about installed plugins/themes.
You can perform a “Test Restore” for any of the listed backups or select “multiple” backups to be tested.
In this article, I have highlighted the importance of testing WordPress backups before directly restoring it to your WordPress website. Testing backups can prevent most of the complications that arise due to the restoration of corrupt backup files.
Automated WordPress plugins eliminate the various hassles associated with manual or other forms of backup testing. By just clicking a few buttons, any WordPress user can easily create a staging environment for testing backups and select any of the multiple backup versions for testing.
We hope this has been helpful in helping you fix the last piece of your backup puzzle. Do let us know what you think in the comments below.