A crucial step in a great backup strategy is to test that you can restore your site from a WordPress Backup archive.
If you can’t restore your site your backup archives are worthless.
In this article
Why Is Testing Your Backup Important?
You can have the best WordPress Backup software in the world, and you can have the best backup schedule in the world.
If you do not know how to restore your WordPress site from a backup archive it will do you no good.
By testing your backup archives you:
Verify that your backup archives are healthy.
Learn the procedure for restoring your WordPress site.
If you ever need to restore your WordPress site for real you will most likely be under time pressure. Knowing the restoration procedure will save you time and give you confidence when you most need it.
You Might Also Want To Read
These are related articles that you might also want to read (all open in new tabs):
What’s In Your WordPress Backup Archives?
Depending on the backup software you use your backup archive might be packaged in a different way to ours. We use BackWPup which gives us a zip file with all the files from our WordPress site plus an sql file with an extract of the database.
The name of the sql file will be different for you but the file extension will be .sql.
The remaining files will be the familiar WordPress files.
Restoring WordPress On Your Local Computer
XAMP allows you to run WordPress on your local computer. This is a very easy way to test that you can restore your WordPress site from your backup archive. XAMP works on Windows, Mac and Linux.
To restore your backup archive on your local computer we will:
- Download and install XAMP.
- Create a new database.
- Import our data.
- Unpack the files.
- Modify wp-config.php.
- Modify the hosts file.
- Test.
Get ready!
Follow these steps:
Click on the link for the version of XAMP that matches your Operating System. In this guide we use Windows.
Run the installation program by double clicking the downloaded program.
Accept all the default values. Do not change the install folder from c:\xamp.
Wait for the installation to complete.
Click Yes to start the control panel.
The control panel can also be found in the Start menu.
Depending on your Firewall you might get a warning.
Important! Do not allow access from the Internet.
XAMPP is not secure and is only meant for testing on your local computer.
On the Windows Firewall untick Private networks and click Cancel.
Again on the firewall untick Private networks and click Cancel.
Now we need to create a database for WordPress.
Click Admin… for MySql.
Give the database a name and click create.
Here we use the name wordpress.
On the Import tab select the sql file from your backup.
You might have to extract the sql file from the backup archive before you can import it.
If you get an error you need to increase the maximum file size allowed for import.

If your sql file is larger than that you need to modify a setting in php.ini.

Open the \xampp\php\php.ini file and change the setting for
post_max_sizeso it is greater than your actual file size.
Extract the contents of your backup file.
In Windows file explorer right click the file and click Extract All.
If you are asked about replacing existing files tick Do this for the next X conflicts and click Copy and Replace.
Note! If you already use XAMPP for other purposes make a backup copy before you replace any files.
Note: If you use WP Login Security 2 we recommend you disable that plugin on your local install. You can do this by removing the folder called wp-content\plugins\wp-login-security-2.
Your locally installed WordPress will not be able to send emails so this plugin will not work well.We need to modify the database connection information.
Open the wp-config.php file in c:\xamp\htdocs.
Set DB_NAME to ‘wordpress’ (or the name you used).
Set DB_USER to ‘root’ (this is the default for XAMPP).
Set DB_PASSWORD to ” (this is the default for XAMPP).
Set DB_HOST to ‘localhost’ (this is the default for XAMPP).
Because we are setting up our site to run locally on our own computer we need a simple trick to point our domain name to our local computer. Otherwise we’ll just be accessing our live site.
To do this we need to edit a file called hosts. Think of this file as a local phone book, which tells your internet browser to make a local call instead of a long distance call when you want to talk to your WordPress site.
You can only edit this file as an administrator so you have to open the file the right way.
Click on the Windows Start menu and in the search box enter notepad.
Once Windows has found the Notepad program right click the name and select Run as administrator.

Click File → Open.
In the file name field enter this exact string:
%systemroot%\system32\drivers\etc\hosts
You can copy/paste from here if you don’t want to type.
Then click Open.
At the bottom of the file add a line with the localhost ip address (127.0.0.1) and your domain name as shown.

Save the file.
Important! After you are done testing you will have to remove this line again. Otherwise you will not be able to access the online version of your WordPress site. You might want to keep the file open until you are done testing to make it easier to remove the line again.In an Internet Browser enter your domain name.
You should now see your own site running locally.
How can you tell that your site is running locally?
Disconnect from the internet and reload your site. It should still show. If you have any resources loading from other sites (like the Facebook and Twitter counts) those will not work when you disconnect. Also when you are connected they will show the numbers from your live WordPress site.Test your WordPress site.
See that everything works as it should, but note that if you rely on services from other internet sites (like Facebook and Twitter) they might not work quite as expected in all cases.If you want to access your WordPress administration panel you might get an error provided you have an .htaccess file in the wp-admin directory.

Simply delete the .htaccess file in the wp-admin directory on your local computer and you can log in.

Further Resources
Related articles:
Questions Or Comments?
Please leave them below. Thanks!















Really love your all basic tutorials
Great helpful..
Thanks again.