Backing up your WordPress Site

The official WordPress logo

When it comes to backing up your data, its pays to be a pessimist.

As if we needed one, recent events close to home were a harsh reminder that you never know what lies around the corner.

When dealing with any data stored on computers and digital devices, the Scout motto, ‘be prepared’ is good advice.

Having an up-to-date, off-site copy of all your digital data is a guarantee that whatever happens, you’ll have a far easier job putting the pieces back together.

Do you have a backup of your WordPress site?

It’s essential to have a full copy of your WordPress website that can be used to restore your site in the event disaster strikes. Backups from the hosting provider are sometimes available but should not be relied upon, particularly given that in the event of a compromised server, these may not be available.

That means performing regular backups of your site, keeping them somewhere secure. Ideally, you’ll have at least the last three backups stored in different places and different mediums e.g. on a mail server, a hard drive, a flash drive.

How often you back up will depend on how frequently your site is updated.

There are two parts to backing up your site – your database and your files.

Your Database

Your database contains a range of information about your site including the contents of your posts, pages and comments, your tags and your categories.

Regular updates can be scheduled using one of the many plugins available. However, the choice of plugin is important and the databases will need to be verified regularly.

Other methods of backing up your database can be found on the WordPress codex.

Your Files

Backing up your WordPress files requires generally access to your WordPress directory, although some backup plugins will handle files as well.

Some hosting control panels allow you to backup your site. Another option is using an FTP client.

You won’t need to back up the WordPress core files unless you’ve modified them which is always a bad idea.

You will need to backup all the other files which affect the look and functionality of your site.

These will vary depending on how your site is set up, but it will often include the following:

.htaccess This file is modified by WordPress depending on various settings and is sometimes used by plug-ins or edited manually by the developer. It usually resides in the root directory. As it is sometimes hidden, you may need to tweak program settings to see it.

wp-config.php This file contains important data. It makes things a lot easier if you have a copy. It generally lives in the root directory.

The wp-content directory contains other files and folders such as your uploads folder which may include images, audio and video files. You can back the whole wp-content directory up or you can specifically select what you need.

It is a good idea to backup all your images. Although you will likely have the original copies, adding them one by one to your site can be avoided by backing up the images directory, usually wp-content/uploads/. WordPress assigns each uploaded image a unique ID which is stored in the database and with the posts or pages the images are on.

When the database and the image directory are restored, your images should be back on the original posts and pages.

The /wp-content/themes/ folder will contain child theme files, if you are using one, which should also be backed up.

Backing up your plug-ins directory is optional but can save time rebuilding a site.

Plug-in settings and data are usually stored in the database. Some plug-ins generate considerable amounts of data which you may choose to exclude from your database backups.

There are a range of ways your site can be set up so there may be other files that need to be backed up we haven’t covered here. You can read more on the WordPress Codex.

Be Prepared!

There are any number of things that may cause you to lose all or part of your site. Server failure for whatever reason, your site may get hacked, you or someone else may accidentally delete some posts or pages, you may install a dodgy plug-in which causes data loss.

Whatever the cause, you’ll want a quick recovery and for that you’ll need a complete backup.

Don’t delay, get it sorted now!

LifeformLabs specialises in deploying, optimising and maintaining WordPress installations. We can also take care of your backups. If you’d like to discuss the various options drop us a line »

a lifeform labs project supporting the brook waimarama sanctuary - nelson nz