The Perfect Hands-Free Database Backup
Most of us are quite lax when it comes to making regular backups of our database. It's too much hassle, and "what are the chances it will happen to me?"
But what if your backup system happened automatically everyday, stored the backup securely on another server, and you never had to look near it?
1 - Register a New Gmail Account
Gmail offers 7GB of storage, and up to 20MB file attachments (The largest attachment size I was able to find for a free email account). It's free and it's completely distinct from your regular hosting, so if your host loses everything, you won't have lost your backups.
Go to http://mail.google.com/ and hit the "Sign Up For Google Mail" button. The form only takes a minute to fill out and now you'll have 7GB of free storage space.
2 - Install the Plugin
There are several different backup plugins out there, but we're going to use WP-DB Manager, because it's the one I know will work, and because you can count on it being updated with each WordPress release.
Download the plugin, upload it to your plugins folder, and activate it as usual.
You then have to browse to the wp-content/backup-db folder, and upload the .htaccess file from the plugin folder.
If the backup-db folder doesn't exist, create it and CHMOD it to 777 (In most FTP clients, you can CHMOD a folder by right clicking it and choosing "CHMOD" or "File Attributes" etc).
3 - Configure The Settings
A "Database" link will be added to your admin panel's main navigation. Click it, then click the "DB Options" tab.
In the Automatic Scheduling section, choose every day, Gzip Yes and enter your Gmail address. Now hit "Update Options" and you're done.

4 - Lycos Mail, for When Your Database Is Too Big
The drawback to the method above is that you're limited to a maximum database size of 20MB.
WordPress tends to take up very little space, and Gzipping the file will help immensely, but if your blog does grow over the 20MB limit, you'll have to find a better email account.
In that case, try Lycos Mail. They offer 3GB of free storage, but unlimited email attachment sizes.
However, with the free version, you must login every 30 days, or they will permanently delete all of your emails. You can avoid the Lycos deletions by purchasing Account Preservation, which costs $5.95 a year (Still extremely cheap!).
Losing all of the emails in the free account is too scary a thought for me, so I'm sticking with Gmail for as long as possible.
Enjoy this post? Get future updates sent to you for free! Join by email or RSS.
Other posts tagged with Backup, Database, Gmail, Plugin, WordPress.






28th July, 7:44 pm GMT
Hmm, i'll try it. Better get prepared by backing up the database daily. Thanks for the tips.
28th July, 9:06 pm GMT
As far as the size of the database, it would be great to delete spam comments before backing up, as they take up a ton of unnecessary room.
28th July, 9:17 pm GMT
Interesting idea. Maybe I'll set up a dedicated email account in my Google Apps system to do this...
28th July, 9:33 pm GMT
I am doing exactly this with another plugin (WordPress Database Backup) for more than a year now. It works like charm and is much simpler than the DB-Manager mentioned here.
28th July, 10:08 pm GMT
Permana,
It doesn't take long to set up, and you'll definitely be glad when it's done.
Adam,
That's a good tip. I delete my spam comments each morning, just out of habit. I've never thought of doing it for the database though. Good idea!
Redwall,
Google Apps system? How do ya mean?
Michael,
Looks like a good plugin, thanks for sharing. I knew there were others that could do it, and quite possibly better!
I only used DB-Manager as the example here because it's the one I use, so I can vouch for it working, and the plugin author has a load of plugins and updates them all regularly (And has done for years). One's probably as good as the other. They just make backups!
28th July, 10:40 pm GMT
Thanks Michael for sharing the excellent technique.
My webserver does take a backup every night automatically. But this seems like a good tip to implement in case the hosting backup fails.
29th July, 2:09 am GMT
Wow, this is a great plugin. TBH I rarely back up my online DB mainly because my host do it daily, but i suppose its a extra comfort knowing it will be email to me. Nice find!
29th July, 2:32 am GMT
I have my websites do this daily and have for a while. I also setup a filter in gmail to automatically archive it since it goes to my regular email address I use for other things, this way it's out of my way and I never see it; but I know it's there
29th July, 10:39 am GMT
Ankesh,
Some webhosts do a great job with their backups, but even the best can get unlucky sometimes. The database is too valuable to leave entirely to them I think.
Grant,
It's a nice "just in case" measure to have in place.
Mike,
Google really do give a massive amount of email storage! I put it in a separate account for convenience sake, but they give so much space, sending it to your main account still won't put that account in danger of crossing the limits!
29th July, 3:57 pm GMT
Michael, thanks for putting this up. I need to go back and check to see whether I've got it right. Highly useful.
30th July, 7:53 am GMT
Oh man... I just installed this on both of my blogs, set everything up, and got my first email backup in about 2 minutes. This is the best thing ever! Talk about peace of mind...
Now if backing up several hundred gigs of photos was only so easy.
30th July, 4:19 pm GMT
Easton,
Glad you found it useful!
Brian,
I know what you mean. It's great to know that the fruits of all the long hours of work you've put into your blog aren't in danger of disappearing anymore.
Not sure if this will be any use for that amount of data, but I use Syncback (The free version, about half way down the page) for my computer backups.
It only copies over files that have changed since the last backup, and can be set to run automatically each night if you want. Not hard to set up either.
31st July, 5:30 pm GMT
This is a great tip, I've heard of people doing things similar to this but for some reason your post actually compelled me to set it up.
9th August, 1:50 pm GMT
I can’t think of anything better )
12th August, 10:40 am GMT
I knew there was an easier way to backup! Thanks for the tip, at least now I know my databases are relatively safe and backed up! Now I'll need to learn how to restore
15th August, 3:40 am GMT
Loosing emails is certainly crazy. Stick with Gmail, its gonna be a *long* time before db runs over 20mb. Hopefully within that time Gmail will increase their attachment limit ?
15th August, 1:30 pm GMT
Michael,
Glad you did, thanks!
Pink,
Good good! Restoring is easy enough (Use the "Import" section on phpMyAdmin). And you can learn how to do that come the time, if you ever need to do it. Making the backups is the important part, so don't worry about it.
Ehab,
I hope so! That would definitely solve things.
18th August, 9:16 am GMT
Wow, thanks. This is exactly what I've been looking for. What a great post!
18th August, 1:35 pm GMT
This is AWESOME! I've been manually backing up about 20 WP sites every month. You just saved me about 2 hours ad infinitum. Thanks soooo much.
18th August, 1:40 pm GMT
Glad you found it useful screwzoo!
10th November, 3:08 pm GMT
I like it. WordPress plugin really makes life much easier huh?
Now you'd better have a backup of your web server files on your local hard drive, or else...
11th November, 1:43 am GMT
Hendry,
Very true! I used to be great at keeping that backup up to date, but with automatic plugin upgrades now, it never is. But I suppose if my only loss is that I need to reinstall a few plugins, i've gotten off lucky!