The Perfect Hands-Free Database Backup

gmail-wp

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.

db-plugin

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.

Share

  1. Hmm, i’ll try it. Better get prepared by backing up the database daily. Thanks for the tips.

    • Marty (9 comments)30 August 10

      Having an updated database backup is very important. A lot of things can happen that can screw up everything and ruin all your hard work invested in your content. Thanks for this plugin

  2. adam (18 comments)28 July 08

    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.

    • Agree with you, there are more & more spammer these days.
      I’ve also using wp db manager plugin for almost 2 years, and it works perfectly the way I need it

  3. redwall_hp (144 comments)28 July 08

    Interesting idea. Maybe I’ll set up a dedicated email account in my Google Apps system to do this…

  4. Michael (22 comments)28 July 08

    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.

  5. Michael Martin (1511 comments)28 July 08

    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! :)

  6. 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.

  7. Grant (14 comments)29 July 08

    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!

  8. 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 :)

  9. Michael Martin (1511 comments)29 July 08

    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. :D

    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! :D

  10. Michael, thanks for putting this up. I need to go back and check to see whether I’ve got it right. Highly useful.

  11. Brian Auer (3 comments)30 July 08

    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.

  12. Michael Martin (1511 comments)30 July 08

    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. :D

  13. Michael (22 comments)31 July 08

    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.

  14. jiimiona (2 comments)9 August 08

    I can’t think of anything better )

  15. 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

  16. Ehab (2 comments)15 August 08

    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 ? :)

  17. Michael Martin (1511 comments)15 August 08

    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. :D

  18. screwzoo (1 comments)18 August 08

    Wow, thanks. This is exactly what I’ve been looking for. What a great post!

  19. Rainmaker (1 comments)18 August 08

    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.

  20. Michael Martin (1511 comments)18 August 08

    Glad you found it useful screwzoo! :)

  21. Hendry Lee (13 comments)10 November 08

    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… ;)

  22. 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! :D

  23. Stephen (4 comments)15 December 08

    This is a good method but it’s something that it’s possible to do it too often, back ups are geart but if you do them too often you don’t gain any benefits.

    The idea of having daily backups is only good if a site changes every day, otherwise you’re robbing yourself of server capacity without needing it.

    If you’ve got a small, not very busy blog you’ll get away with considerably less regular backups and will leave that extra capacity for, say, resizing images and serving dynamic content.

    Saving a bit of CPU time is irrelevant on your home system but you still pay for it on rented hosting – the difference between too regular backups and just enough backups could be dozens of dollars a month extra in higher capacity hosting.

    • That’s true Stephen, but it would only really apply if you were right on the threshold of your hosting account’s limits. Backups are so crucial, I’m happy enough to make them daily to be honest. It might cost the server a little more, but you’ll be glad of it if your server ever does crash.

      • Stephen (4 comments)19 December 08

        Very true, although packaging up an entire database is a fairly processor consuming process, I think that if an application needs backups that are hourly (or even more often, in the case of extremely critical applications) then you’re negligent not to give it the resources to do that. It’s crucial enough to be an operating requirement of the application concerned – just like there needs to be enough processor time and memory to serve pages for the program to work.

        If you are hosting a blog which really doesn’t change content every day (say it’s an irregularly updated personal journal of your life and therefore doesn’t attract too many posts or too many comments) then there’s no need to update the backup everyday if the backups are going to be identical. If your blog changes even more often and you can’t risk losing any comment or post, then you could set it up backup even every hour. It’s just a question of the applications needs – backing up less than you need to is very bad practice but if you backup more than required you’re just using up cycles without getting value from them.

    • One of my site is very big with more than 35 thousand posts and more than 100mb database size.
      Here is my backup tips using that plugin to avoid it consume too much cpu resources on shared hosting :
      - Backup every 1 week
      - Turn ON gzip option
      - Keep maximum backup files no more than 5
      You can set it on wp-dbmanager settings page
      But if you concern about the backup database file size become too large to send via email, just turn off the option and you can download it manually to your local pc.

  24. Great WP plug in, amazing!

  25. nice plugin thank you so much..

  26. dmk (1 comments)31 December 08

    now that is an excellent example of lateral thinking. thank you. i’m off to set my google apps mail filters to receive, label and archive automatically weekly.

    sweet!

  27. Kawika Heftel (2 comments)8 June 09

    That is a GREAT idea for backing up a blog, thanks so much!

  28. darnals (6 comments)29 July 09

    thanks brother its can make me easy to backup my database every 1 days.
    sometimes the hosting error or suspend, and all my data lost.

    maybe im wrong to take my blog to leecher hosting :d

    lets share anything to the world
    .-= darnals´s last blog ..LINEAGE II Server Files =-.

  29. J Themes (8 comments)20 August 09

    Yep! This is the way to do it. This is usually one of my first steps after install except I use the WP-DB-Backup plugin by Austin Matzko.

  30. I use this and I love it. I set up a filter in Gmail to catch my DB’s and then label them. Its amazingly fantastic, and all done behind the scenes once a week.

  31. Frithjof (1 comments)22 August 09

    That’s really good advice. Works perfectly. Love it. The htaccess file was a text file (with .txt) at the end, so you need to rename it to ‘.htaccess’ after uploading to the backup-db folder, am I right?

    • Ron (1 comments)10 June 10

      Thank you for your .htaccess tip. I was looking for it all over the place :)

  32. Avery (11 comments)31 August 09

    Sounds great,I never heard the Plugin before.Thank you for sharing.

  33. test (3 comments)2 September 09

    Excellent blog was very useful……

  34. aljawa (1 comments)6 September 09

    wowww….thnks…

  35. This is a great way to do it. It’s amazing how many people run NO database backups and then freak out when something happens to their installation or database.

    Great tutorial!

  36. Jessie (1 comments)25 September 09

    Backups are always a safe route to go…you never know when something very unlucky may happen!

  37. I’ve using this plugin since my site running. It works pretty good.
    I set automatic backup to every week cause I have thousands of page & more than 100mb mysql database and I don’t want to create high server load.
    If you’re running light blog I think it’s fine to set automatic backup to every day.

  38. Brad Ney (1 comments)22 October 09

    My entire WP-Content folder was just deleted.. I’m going to find every backup plugin on the internet.. What a hassle.

  39. Thanks alot for this great plugin tip!

    What I’m wondering is if you can do an update to this post since it appears some of the items on the backup tools page/dashboard may have changed in the year plus?

    Specifically, what about all those extra checkmarks for tables under
    Backup > Tables > You May choose to include any of the following tables …..
    as well as
    Scheduled Backup > Tables to include in the scheduled backup: Click and hold down [SHIFT] to toggle multiple checkboxes

    do I include and check mark all those extra boxes or just the default settings ( nothing else being checkmarked)? I’d sure appreciate any direction on this issue — thanks and cheers!

  40. Greetings Michael –

    Great article. One tip I found to even further automate this process is to setup a filter in Gmail. In my filter, I tag it “Blog Backup” and auto archive it. This takes a step out of me having to clean up my inbox everyday.

    The more automation the better.

    - D3

  41. meong (1 comments)15 November 09

    nice and great brother

  42. jagoane (1 comments)19 November 09

    Thank you.. for sharing articles.. Great!!

  43. MexiChriS (1 comments)1 December 09

    Was looking for this for like 3hrs! Since i saw you repost this on Twitter I believe, if not someone else, but found it amazing & forgot to “favorite. Left me hunt down online. Google is kind tricky leading to other sites & what not, similar & sooo off topic/unrelated to my hunt, glad I hunted this down though. Gonna be trying this out later today & see how it goes!

    Was hoping you could respond back to @CoolSlipknotMasks though, just so I can see what your response would be, curious is all….

    Anyways, AMAZING POST old or not, looking forward to trying out for my 1st WordPress blog for my site, thanks! =]

    - MexiChriS

  44. Autai ptfe (17 comments)30 December 09

    Great Poster !!

  45. wow,

    much easier than thought earlier.

    thanks for sharing this with us.

  46. Grace Han (5 comments)11 January 10

    GREAT post!!
    Just set it up on my website, and it’s working amazingly well and now I’m stress free from backing up hustles!
    Thanks for sharing!!

  47. Rosario (12 comments)19 January 10

    If you’re running light blog I think it’s fine to set automatic backup to every day, Great Post

  48. Nice tip. Is it also possible to use yahoo mail to this?

  49. m65 (20 comments)27 February 10

    gmail is the best handdown. i dont think you can do this with yahoo

  50. Dmitreos26 (1 comments)2 March 10

    thank you, automatic is good choise

  51. Tango (1 comments)10 March 10

    Here is best way for backing up blog also for bloggers
    http://problogbooster.blogspot.com/

  52. Anggara (4 comments)29 March 10

    Always great solutions, G Mail perhaps the best. Thank You !

  53. Indra ag (1 comments)31 March 10

    Backup my Gamer Blog database and store it on my gmail,how come i never thought of that,..Brilliant post !.

  54. GREAT !
    THIS IS A NICE LEARNING

    THANKS
    :-)

  55. Jordan McClements (1 comments)10 April 10

    Great article. I’ll be following your advice very shortly. I already use gmail in a similar fashion for daily backups of a big osCommerce DB, and I can say that when using gzip if gmail attachments are not big enough for you then you must have a HUGE database… :-)

  56. Thanks Dude for sharing this intelligent technique. This is exactly I was searching for many days. Now I got the idea how to get perfect database. I will follow these tips. Thanks for spending your precious time on posting this article. Keep posting these fantastic tips.

  57. I just test and work it, thank you dude. But i have problem, i forgot my password Lycos Mail. :-(

  58. If you have more than just wordpress running on multiple sites with multiple databases, you’ll need to find a more generic backup solution.

    If you run under a cPanel hosting account, I’ve created a new desktop app, that downloads all the files or databases in your accounts on a schedule. A real time saver. It’s called Backup Smart. Runs on Windows and MAC OSX and Linux. Has a 7 day free trial. Aaron

  59. battery (9 comments)3 May 10

    Not sure if this will be any use for that amount of data, but I use Syncback

  60. Leah (5 comments)7 May 10

    Thanks for the great info! I recently had a client whose giant webhost (shall remain nameless) deleted his entire site that had just been redone. I got a panicked call from him a few days after I was done with the job. Then to add insult upon injury, the giant webhost that “swears” to do daily backups actually put up his old site from months earlier. So much for daily backups!

    Thank goodness I’m a backup freak when I’m working on a clients site! I was able to restore the entire site & found the rest through Google’s cache so I was able to get everything back for him.

    This plugin is definitely going into my “must have” install checklist for every new blog I do.

  61. That is a really GREAT idea for backing up a blog, thanks so much!

  62. MobileGround (19 comments)20 May 10

    great plugin that save a lot of time.. thank you .

  63. Web Designers (2 comments)21 May 10

    Hey, I was reading your past post and just encountered this one, great one mate!

  64. Download Area (2 comments)23 May 10

    Its Greate im need it, because i was open mine to Free Host and Hosting,
    I Thinks its will be perfect If my site has done

  65. Great post thanks for the tip

  66. Your work is very good and I appreciate you and hopping for some more informative posts. thank you for sharing great information to us.

  67. THANK YOU! :D I’ve just implemented this on my blog and it worked perfectly. I appreciate you sharing this advice.

  68. Quite a few people out there don’t understand what all is involved in this industry,
    and I think also we are many times underrated or taken for granted.

  69. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and
    I hope you post again soon.

  70. I think your suggestion would be helpful for me. I will let you know if its work for me too.

  71. Your work is very good and I appreciate you and hopping for some more informative posts. thank you for sharing great information to us.

  72. Nightclubs (1 comments)30 June 10

    Too good to help someone who is using wordpress first time.

  73. Thanks a lot. Very useful tips for every webmaster with wordpress.

  74. An invaluable resource and great addition to my favorites. The new features are well received on this end and will surely help the community share and progress more
    rapidly.

  75. Thank you very much for sharing all those set of lovely and top_._._._._._._..I am newly learning the use of _._._._._._._. in _._._._._._._. and this I think would
    really help me in my assignments.

  76. Your post will be rather good, and I’m sure some will find it interesting because it’s about a topic that’s as widely discussed as others. Some may even find it useful.
    Thanks so much for your post.

  77. Great piece of collection.Truly it’s very difficult to choose the best out of all because these are the topmost _._._._._._._. I have seen so far.

  78. חברת אבטחה יעילה ומקצועית. מאבטחים ופתרונות אבטחה מתקדמים. חברת אבטחה מובילה באיזור לוד והשפלה

  79. Rackspace (4 comments)2 July 10

    As the saying goes, “The best things in life are for free”, and this is certainly one of them gems.

  80. These tips are very nice but Lycos Mail is now not free.
    so will you please tell me another option to resolve this problem.

  81. Painters (4 comments)6 July 10

    I’m so happy I stumble upon this blog! A lot of helpful info I really needed to know these stuff, I had a hard time with those foreign characters.
    Thank you so much!

  82. Your work is very good and I appreciate you and hopping for some more informative posts. thank you for sharing great information to us.

  83. An invaluable resource and great addition to my favorites. Your work is very good and I appreciate you and hopping for some more informative posts.
    Thanks for these amazing info.
    Regards.

  84. ComputersZine (5 comments)9 July 10

    I have used this plugin i think over than 10 days for now and i dont know why it doesn’t sent me the weekly backup! maybe the problem with the host ? i use host gator.

  85. An invaluable resource and great addition to my favorites. The new features are well received on this end and will surely help the community share and progress more. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts

  86. photoscape (3 comments)13 July 10

    Thanks for the good information! I not too long ago had a shopper whose giant webhost (shall remain anonymous) deleted his total site that had just been redone. I acquired a panicked call from him a few days after I used to be executed with the job. Then so as to add insult upon injury, the large webhost that “swears” to do day by day backups really put up his previous web site from months earlier. A lot for each day backups!

    Thank goodness I’m a backup freak once I’m working on a shoppers site! I used to be capable of restore your complete website & found the remainder by means of Google’s cache so I was in a position to get all the things again for him.

  87. thanks , i use this plugin

  88. Geoff (7 comments)25 July 10

    Unfortunately backups are a bit like insurance. You just never get round to taking it out then one day you find you need it.

  89. Followed your instructions exactly and it worked like a dream. I was a touch concerned as I’d just upgraded to WP 3.01 but no worries at all as everything was perfect. Can’t thank you enough for pointing out this backup/GMail formula, and best of all it actually works, which so many DB backups don’t.

  90. A long long time ago I was let down by a web host who had failed to make any backups at all. Sadly that was before the days of GMail and the cloud. I guess disk space was expensive back then, hence the lack of back up.

    These days, it’s not hard to find a reliable host, and all our web design clients are well backed up. Still, belt and braces can’t hurt. (Maybe a UK-only expression ;-) )

    • Michael Martin (1511 comments)3 August 10

      lol – Never heard that one before! I’m from Northern Ireland though, so maybe just hasn’t gotten about over here! ;)

  91. Perfect!

    Thank you!

  92. It is a good thing that there are some free websites that can be used. Compared to other website, even just an accidental click, you will already pay it.

  93. Nice Tips. I just try it for me

  94. Katie (5 comments)26 August 10

    Hey, I also use WordPress Database Backup – it works well. Is there much of a difference? Thanks

  95. Andrew (9 comments)31 August 10

    This plugin is really great and it too has a limit it can only be used with WordPress.

  96. Abhi (5 comments)1 September 10

    I plan to shift my website to another host.
    Will backing up of database help?

    PS: I spent the whole day reading your posts. Nice website. Cheers

  97. Abhi (5 comments)2 September 10

    My database just got deleted automatically. I use free hosting. :(
    I guess I have to start all over again. Setting up the above plugin will be the first thing I will do.

    Thanks Michael,
    Abhimanyu

  98. amazingly Handy and Smart Tip here..I love it and I’m Going to install it on all my blogs…Bye :)

Leave a Comment

Your reply will be added to the comment above (Below any other replies to this comment) -

(We DoFollow)

Not sure how to get an image with your comment?