Backing up your WordPress site


Ensuring that you take regular backups of your WordPress site is so important. If your site is hacked, you need to know that you can get your site up and running as quickly as possible. If you inadvertently delete some valuable template files or content, you need to be able to restore those components. If your hosting company takes backups for you, you need to understand exactly what they’re backing up and whether their backups are sufficient for your needs.

In order to develop a good backup strategy, it is essential to understand the different components of your site. You also need to be very clear about the types and frequency of changes to your site. Broadly speaking, you need to consider the following:

1. FILES
(i) The WordPress files
These are the files that make your site work: the base WordPress install, plugins and theme files. Should these be backed up? Well, in the event of a major disaster – eg a hacked website – you might need to rebuild your site from scratch and you would need clean copies of all of these files. You could either restore them from a backup or you could install them from scratch. (If you choose to install from scratch, you need to know the WordPress version that you were using and the list of plugins.) Either way, you will DEFINITELY need to restore the following from a backup:
wp-config.php
your theme (if you’re using a custom-built theme) or child theme
Always make sure you have a valid backup of these. Take a new backup whenever you make a change to your wp-config.php or theme files.

(ii) Your image files, etc
Any files that you add to your site – such as images added through the Media Library – are stored in the wp-content/uploads directory and must be backed up. The backup frequency depends upon how often you add new files.

2. DATABASE
The database contains all of the content and configuration of your site. When you back up your database, you will probably take an Export (logical backup). This creates a text file that contains the SQL commands to recreate the database with all of its contents, and it can be restored by running an Import within phpMyAdmin. Your backup frequency will depend largely upon how often you update your content. Make sure also that you back the database up whenever you upgrade your version of WordPress or any plugins.

The most straightforward backup strategy is probably to do a full backup each time. Whether you do this daily, weekly or monthly depends upon how often your website content and configuration change.

You’ll probably want to use a plugin to automate your backup process. BackWPUp is excellent.