Backing Up Your Database and Files

Codex HomeSite Administration → Backing Up Your Database and Files

Backing up your DB and site files on a regular basis is essential if you are to be able to recover from a disaster such as hardware failure or site compromise.

There are a number of approaches you may take to this end:

Hosting control panels

If the hosting you have your site running on provides a control panel e.g Cpanel, Plesk, Helm then you should have backup available as a selectable option. Log in to your control panel locate the item review it’s options and enable it; generally it will backup both your site files and DB and it will do this as a scheduled task which also rotates the backup i.e after a certain number of backups the task will then create the next set of backups and overwrite the first ones made, this way you have backups that will cover a certain period, typically this might be a week worths, so from any given day you should have backups that cover the previous six days

With ‘Rotating’ backups it’s worth bearing in mind that they dictate a window of opportunity in which you may recover / restore files in case of problems and as such one needs to keep a close eye on ones site on a regular basis during the period your backups cover before being rotated; e.g if you have a problem on a Tuesday you have only Mondays backup to revert to if you haven’t noticed the issue by the time next Monday comes around the good backup will be overwritten and you have lost the opportunity.

Manual DB backups

Using a tool such as phpMyAdmin – if it’s available to you – you might choose to take a manual backup of a sites DB tables to keep safe off site – which is a wise thing to do, keeping backups on the same hardware they were taken from negates the usefulness of backups in the event of hardware failure.

A full WP DB backup will pretty much recover your site in it’s entirety with only the main static files needing replacing and – apart from any custom theme files – can be replaced from original source files. Covering the procedure for making a manual DB backup has been well documented by the WordPress Codex so you should read this page for guidance on the procedure:
codex.wordpress.org/Backing_Up_Your_Database

WordPress Admin Dashboard / Backend Export

WordPress provides a means of exporting your posts, pages, comments, custom fields, categories, and tags.
You will find the facility if you look on the left hand menu for the ‘Tools > Export’ option

This provides a useful means to back up content quickly and save it off site, however do not consider this a replacement for a full backup regime it only backups content and no DB information on the site configuration, it is best viewed as a quick means of restoring a few posts that may have been lost and can’t be recovered from the posts revisions table.

Under the principle outlined below that one can’t be too safe, it is advisable to use this facility from time to time.

**Note this method does NOT export your BuddyPress data, but only WordPress blog entries, comments and users

VaultPress

Update: Worth mentioning now is Automattic’s VaultPress service, as of Version 1.0+ it now supports normal BuddyPress installations.

For complete peace of mind it may be worth considering the monthly subscription to the VaultPress service which continually monitors and backs up your site, files and database, and allows very simple restores in the event of a disaster. Where your blog and it’s content really matter, this provides a level of security and comfort worth every penny.

VaultPress Features | VaultPress Plans

Backup often – be safe not sorry

Generally there is no such thing as too many backups, it’s very easy to think you have covered the process and are safe but to have overlooked a potential scenario that your backups don’t cover, do keep multiple backups that cover the same data and keep them in different locations, if possible download your site files via ftp to your localhost machine, copy those files to a secondary devise such as usb drive, NAS drive, pen drive etc do the same with your db backups keep multiple copies of them on various media where possible.