Anyone who has had a blog hacked or files/database corrupted, knows the horrible feeling in your gut and the awful mess trying to recover.
To solve this I have found a great way to make sure you don’t end up in a bad situation.
The 2 WordPress Plugins
1. WP-DB-Backup – Allows you easily to backup your core WordPress database tables. You may also backup other tables in the same database.
2. WordPress Backup – Backup the upload directory (images), current theme directory, and plugins directory to a zip file. Zip files optionally sent to email.
The first plugin backs up your database. The second, backs up the files that are added to your particular WordPress installation.
Use a Gmail account for storage
Get a Gmail account. I created a special backup account to use for all my client’s sites. You could use an existing one. If using an existing one, create a filter to archive emails that have “WordPress Backup” in the subject line and an attachment.
Set both plugins to automatically email a backup at a certain interval. I set mine for a week but you may want more often. With Gmail’s 7gb+ storage capacity, space isn’t an issue. Every few months delete the old backups. (Know a way to do this automatically?)
Update: Nathan suggests in the comments: “you could create a filter that moves these backups directly to the trash. They’ll be auto-deleted after 30 days. It’s not a huge window, but it would suffice for a basic backup strategy.”
Update 2: Lifehacker says: “I send my backups to my spam folder. Since items in the spam folder automatically delete after 30 days, I always have 30 days worth of backups quietly tucked away in my Gmail account.”
This is useless if you don’t know how to restore your site if it fails. Use PHPMyAdmin to restore the database. (or use the wp-phpmyadmin plugin) The WordPress files reside in the wp-content folder, it is simple FTP work to restore them. It is a good idea to know how to do this before you have to figure it out in an emergency. You may want to create a dummy WordPress install in a subdirectory and try restoring after deleting some of the database and wp-content folder.
Have a WordPress backup story to share? Got a different way? Sound off in the comments!