Auto DB Backup plugin

0

I think a plugin that automatically backs up the entire database and emails it on a regular basis would be great.

I know that a wordpress db backup does exist and although it works for WPMU, its not ideal as you have to maunally select all tables for all blogs and it does not automatically include new blogs.

If a plugin that automatically backs up the complete WPMU database exists, please let me know. Thank you.

  • Ovidiu
    • Code Wrangler

    I don’t think that will happen, simply because a wpmu database tends t ogrow huge, imagine backing up a DB with i.e. 1000 blogs, then gettign it emailed!

    and some of the people here even use multiple databases…

    I really think DB backups should and are generally done via a backup script/tool/program running on the server via cronjob.

    At least thats what I do: do a quickdump and zip it, just before the backup runs, then delete the zipped dump.

    all automatically….

  • tigrish
    • WPMU DEV Initiate

    I’d be interested in a plugin that does this too.

    Ideally it would send 1 email per blog with all of the blogs tables (including extra tables like contact form etc..). The aim of this would be to quickly be able to restore a blog when (inevitably) a client screws up their install.

    I also agree with Ovidiu that this isn’t scalable to 1000s of blogs, but for 100s, certainly this would work.

    Another option would be to back up to S3 which would have the added bonus of being able to backup blog assets.

  • Ovidiu
    • Code Wrangler

    I still think this is not the right way but that is just my opinion, nothing else.

    you are basically pushing the backup responsability towards the user.

    If you have a backup in place, that is fine. the user/client doesn’t need to be involved.

  • Barry
    • DEV MAN’s Mascot

    Here is the script, note I am using a slightly different multi-db plugin on this so I’ll look at a way to get it to work with the premium one.

    It is based on this article (where there are more details):

    http://paulstamatiou.com/how-to-bulletproof-server-backups-with-amazon-s3

    #!/bin/bash

    cd /home/clearskysnet/

    S3CONF=/home/clearskysnet/.s3conf

    BUCKET=offsite.clearskys.net

    DBUSER=redacted

    DBPWD=redacted

    NOW=$(date +_%b_%d_%y)

    DB1=db_global

    DB2=db_staypress

    DB3=db_clearskys

    DB_BASE=db_

    #

    cd /home/clearskysnet/s3sync/s3backup

    touch $DB1.backup$NOW.sql.gz

    mysqldump --ignore-table=$DB1.ip2nation --ignore-table=$DB1.ip2nationCountries -u $DBUSER -p$DBPWD $DB1 | gzip -9 > $DB1.backup$NOW.sql.gz

    touch $DB2.backup$NOW.sql.gz

    mysqldump -u $DBUSER -p$DBPWD $DB2 | gzip -9 > $DB2.backup$NOW.sql.gz

    touch $DB3.backup$NOW.sql.gz

    mysqldump -u $DBUSER -p$DBPWD $DB3 | gzip -9 > $DB3.backup$NOW.sql.gz

    # Now on to the 16 other dbs

    for i in {1..16}

    do

    touch $DB_BASE$i.backup$NOW.sql.gz

    mysqldump -u $DBUSER -p$DBPWD $DB_BASE$i | gzip -9 > $DB_BASE$i.backup$NOW.sql.gz

    done

    cd ..

    /usr/local/bin/ruby s3sync.rb -r --ssl s3backup/ $BUCKET:staypress

    cd s3backup

    rm -f *

  • drmike
    • DEV MAN’s Mascot

    One of the things we suggest is putting the databases into their own hosting account. There’s a number of scripts for Direct Admin and I believe CPanel as well that will automate an account backup and like ftp it somewhere else. That’s pretty much how we back up our databases.

  • Tracy
    • The Incredible Code Injector

    I maybe be missing something, but from your description, it sounds like wp-dbmanager would work for you, we use it and love it. You don’t have to manually select tables and it can email the db as well. We had mixed success on different mu installs where sometimes it wouldn’t backup correctly, turned out ( at least on our server )that your database password can’t contain characters besides numbers and letters, otherwise shell ( I think that’s what was being accessed) can’t be accessed correctly when there are anything but letters and numbers in password….

    We also use Doc’s idea for Cpanel to ftp to another account…. Just be sure you have enough space at the backup account, we had a situation where our host only gave us half the space we were paying for, which wasn’t enough…when cpanel tried to back up there, the end result was that all backups were corrupt. We learned the hard way. :slight_smile:

  • kunal17
    • WPMU DEV Initiate

    Sorry I didnt get back to this earlier.

    Thanks for all the responses. My requirements are currently for a pretty small community so I guess I didn’t think of the problems that could occur with larger ones.

    Ovidiu, I’m embarrassed to say I don’t even know what a cron job is but Ill look up ways to automate backup that way. Any leads to tutorials will be appreciated.

    @Trace, thanks for the wp-dbmanager suggestion. Ill try that out.

  • Aaron
    • Ex Staff

    I do a back up to s3 using a script and s3sync (which is a ruby s3 utility), I’ll jump on my server later and post the script here if it’s of any use to anyone.

    Same here. My script also rotates them into the days of the week. Emails could be way too big. My db is only 100 blogs and with high bzip2 compression i’m already at 13MB.

  • ryanmlanane
    • Flash Drive

    This would be huge , as i recently lost 150 bloggers with active blogs … Long Story as to why but it was indeed DB related and was a 2 day old site so the host did not have a backup of the mysql db yet

    This should be fairly easy to implement a script if not a plugin like this that backs up everything and pulls the mysql user/pass from the wp-config.php file.

    This is almost essential, and although I will be backing up regularly manually I am very surprised it isn’t offered here with so many other awesome things being offered this seemed like a no brainer.

  • Mason
    • DEV MAN’s Sidekick

    Johnny,

    I auto-email to a gmail account and have a filter set up to mark it as spam. This way, it doesn’t count towards my 7 gig limit and I know I have 30 days of backups.

    Never tested db-manager though. Let us know what you find out!

    Thanks!