Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.
Being a WordPress site owner myself I’ve seen servers fail and loss of data on more than one occasion. Hardware fails, and hackers will try to compromise your site. With that in mind it’s very important to have a tried and tested backup routine, so that you can restore your site should the worst happen.
You spend a lot of time tweaking, changing, and managing your website. So imagine how awful it would be to lose all of that hard work at the hands of something that is completely out of your control.
We’ve previously shown you some of the really useful plugins that you can use to migrate your WordPress site, but it’s also important to backup on a regular basis, not just when you intend to migrate it. On my websites I run daily backups to a NAS drive via FTP, and to do this I use a WordPress plugin called UpdraftPlus.
Backup WordPress With UpdraftPlus
You can easily install UpdraftPlus from the WordPress plugins page. Click on the add new button then search for UpdraftPlus. Once installed, click the settings menu and select UpdraftPlus Backups from the sub-menu to configure your backup routine.
UpdraftPlus is full of features that many other free backup plugins for WordPress simply lack, including:
- Automatic backups on a regular basis – anything from monthly right up to every 4 hours.
- Backup both your database and WordPress files.
- Stores backups locally on your web server, or on remote/cloud storage including Dropbox, Google Drive, Amazon S3, FTP, and many more.
- Automatically overwrite old backups to conserve free space on your drives.
- Optional email alerts on completion of your backups.
- Accessible log files of all backups, which is great for troubleshooting issues.
Test Your Backups
What’s the point in having a backup system if you don’t know how to restore from them? That’s why you should not only run backups, but also test them to make sure you can recover your website should you ever need to.
Testing your backups is very simple. All you need to do is create a second WordPress site on your web server (or a local WordPress instance), so you could have something like backuptest.mysite.com which would need to have a vanilla installation of WordPress on it.
Once you have your test WordPress site up and running you will need to grab your latest backup, by default this will consist of 5 files that alll use the following naming convention:
The others.zip file contains files from your web server that aren’t in your plugins, themes, or uploads folders. You won’t really need this file as you will be able to restore your site without it.
Upload Your Backup
Now that you have a copy of your backed up WordPress files and database, you need to uncompress the three zip files (plugins, themes, and uploads) and connect to your new blank WordPress test site via FTP. You can do this by installing a free FTP client like Filezilla.
If you’re using a local WordPress site then you need to copy and paste these folders to wherever you have your WordPress site installed on your hard drive.
Once you’re in your test WordPress site’s directory, you should see three folders at the top of the list. These are wp-admin, wp-content, and wp-includes. To restore your website you need to upload your backed up files to the wp-content folder.
Once in the wp-content folder you need to replace the plugins, themes, and uploads folders on your web server with your backed up versions. Don’t worry if you don’t see an upload folder, it isn’t present because you haven’t uploaded anything to your WordPress media library yet.
This part may take some time, especially if you have a slow internet connection or if you have a large website. So whilst you’re waiting for the files to upload head over to phpMyAdmin to import your database backup.
Import Your Database
Most web servers have tools like cPanel or Plesk installed which allow you to manage things like email accounts, FTP access, web app installations like WordPress, and your databases. Under the database section you should see an option to launch phpMyAdmin — a tool that allows you to manage your databases via your web browser.
Once you have launched phpMyAdmin you will need to select the database that correlates to your blank WordPress test site. You specified the database name when you installed WordPress, so think back and check your notes. Once you’re in the correct database, click on the Import tab at the top of the screen. You will then have a screen very similar to this:
Click on the “Choose file” button and select the db.gz backup file from your backup. Leave all other settings on their default value and click on the “Go” button. This will now import your backed up database.
Check Your Website
Once your files have finished uploading and your database is imported, navigate to your test website address using your browser. Provided your backups are working correctly you should now see a carbon copy of your live website.
Congratulations, you now know that your backups are working as intended!
Restoring For Real
If your website is damaged for whatever reason and you need to restore for real, you can follow the exact same process as above. However, instead of creating a test site you simply remove and re-install WordPress on you main site, then follow the same process.
Backing up any crucial data is extremely important, but knowing how to restore that backed up data when you need it is just as important as the backups themselves, if not more so. A lot of people think that it will never happen to them so they don’t backup. But why take that risk when the process of creating and testing backups is so simple with UpdraftPlus?
Do you guys have a different method of backing up your WordPress site? Or maybe you don’t back up at all? Either way we would love to hear your thoughts in the comments below.