Database Backups

Discussion in 'Security and Legal' started by Nick, Jun 3, 2009.

  1. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    How frequently do you backup your database(s)? Do you do it manually, or do you have it done automatically with a script or cron job?

    Have your backups 'saved' you at any point? I.e., did your database become corrupt to the point that you needed to restore a backup?
     
  2. Chris

    Chris Regular Member

    Joined:
    Dec 27, 2007
    Messages:
    5,422
    Likes Received:
    86
    Generally three to four times per day (manually). I'm not too fond of using cron jobs - they're a bit difficult to work with. Doing it manually also reassures me that it's being done right.

    Luckily, I've never needed to use any of my backups. Woo!
     
  3. doodles

    doodles Adept

    Joined:
    May 28, 2009
    Messages:
    114
    Likes Received:
    2
    First Name:
    Lisa
    Chris, do you back up via the server and ftp or through the forum?

    Ive been backing up manually via v.bulletin up till now, but im not so sure its the best way
     
  4. Soliloquy

    Soliloquy Regular Member

    Joined:
    Jun 3, 2009
    Messages:
    2,402
    Likes Received:
    66
    Location:
    New York City
    I have a backup automatically made every night, with a shell script I found on... a competing site :)
     
  5. Chris

    Chris Regular Member

    Joined:
    Dec 27, 2007
    Messages:
    5,422
    Likes Received:
    86
    I manage backups solely through cPanel - I've never done so via the forum administration interface.
     
  6. Lynne

    Lynne Regular Member

    Joined:
    May 26, 2009
    Messages:
    333
    Likes Received:
    32
    Location:
    Home Sweet Home!
    I backup every night using a script and have it rsynced to another remote server afterwards. Same thing with all my files. Luckily, I've never had to use it (knock on wood!).
     
  7. Soliloquy

    Soliloquy Regular Member

    Joined:
    Jun 3, 2009
    Messages:
    2,402
    Likes Received:
    66
    Location:
    New York City
    Now that part I haven't figured out yet; automatically downloading it to my computer. I tried a program called SyncBack but couldn't get it to work.
     
  8. Tyler

    Tyler The Badministrator

    Joined:
    Dec 23, 2007
    Messages:
    3,079
    Likes Received:
    63
    Location:
    Long Island, NY
    First Name:
    Tyler
    I am going to admit that I grew my first forum to over 60,000 posts without ever running a single backup. Like I said, this was my first forum, so I really had no idea about it... and not much of an interest either as I found this to be confusing to approach at the time.
     
  9. Boss

    Boss Resident Silly Man

    Joined:
    May 23, 2009
    Messages:
    941
    Likes Received:
    23
    Location:
    California
    First Name:
    Alex
    I'm with Chris here. Doing it from the FTP just assures me that I'm downloading everything off of my server and not just posts, PM's and such crap.
     
  10. Chris

    Chris Regular Member

    Joined:
    Dec 27, 2007
    Messages:
    5,422
    Likes Received:
    86
    Exactly.

    I'm a bit skeptical when it comes to having backups generated automatically. Regardless of the fact that cron jobs may indeed be accurate and precise when configured correctly, I still like knowing that I have manually generated the backup and therefore, have it in my possession.
     
  11. Orreborrenorre

    Orreborrenorre Newcomer

    Joined:
    Jun 4, 2009
    Messages:
    12
    Likes Received:
    0
    I have never backed up my database i should but i dont. guess i am just to lazy :p.
    Never had to use an backup either.
     
  12. Chris

    Chris Regular Member

    Joined:
    Dec 27, 2007
    Messages:
    5,422
    Likes Received:
    86
    Yep, it's always better to be safe rather than sorry. ;)
     
  13. Justin S.

    Justin S. Regular Member

    Joined:
    Feb 2, 2008
    Messages:
    206
    Likes Received:
    30
    Location:
    Central Ohio
    I have a cron job do backups automatically. It does them every night, and saves them to the server. It keeps 7 daily backups (one for each day of the week, it just cycles through them), and does additional backups weekly and monthly, which are never replaced. I've never had to use any of these backups, and I hope I never have to!

    I have, however, had to use a backup before. Kind of funny, actually. I had just downloaded the backup manually. For whatever reason, I had two instances of phpMyAdmin open - one for my localhost, and one for the website - and thinking I was in the localhost's window, I dropped the entire "mybb" database. I quickly realized I had dropped the wrong database, and imported the old one back in. I have no idea what I would have done if I hadn't just downloaded a backup - fortunately I had - but it probably would have involved a lot of headbanging.

    From that day forward, I no longer have had two instances of phpMyAdmin open at the same time - and if I ever do, they use different themes.
     
  14. Soliloquy

    Soliloquy Regular Member

    Joined:
    Jun 3, 2009
    Messages:
    2,402
    Likes Received:
    66
    Location:
    New York City
    Justin, I never even thought about what could happen with two copies of phpmyadmin open... I regularly have two or three copies open. Thanks for the cautionary tale.
     
  15. Chris

    Chris Regular Member

    Joined:
    Dec 27, 2007
    Messages:
    5,422
    Likes Received:
    86
    I would have cried - particularly if I did not have a recent backup handy. It's lucky that you did!
     
  16. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    Holy cow, that was close! :eek: I have no clue what I would have done without a backup.
     
  17. Vekseid

    Vekseid Regular Member

    Joined:
    Jun 2, 2009
    Messages:
    393
    Likes Received:
    13
    cron!

    cron is good. cron is friend. cron takes forum down for ten minutes to do backup and optimize, pisses members off and me occasionally : /

    I have a rotating stock of seven backups for each of the forums in my signature, and Elliquiy uses two databases (for SMF and the Wiki). I don't have the routine down as slick for phpBB and MyBB as I do for SMF, because I'm a bit lazy, but it basically goes:

    1: Bring forums down, put up a nice friendly notice about backing up, optimizing, compressing, encrypting and reindexing.
    2: Backup before optimize! In case something screws up, I can always go back to that morning's backup. Ish good that way. For Elliquiy, depending on the load on Blue Moon and PrP this can take anywhere from two to four minutes.
    3: Once the backup is done I update the outage message letting everyone know that optimization is in progress.
    4: Optimizing takes anywhere from five to eight minutes.
    5: Bring the forum back up, with a notice that Elliquiy is going to be a bit slow for another ~10 minutes do to reindexing Sphinx, compressing the backup and then encrypt it.
    6: Reindex the search engine! Some people will say not to do this, but this lets people find edited information.
    7: Compress the 2gb database. Never pipe mysqldump to bzip2. This will not work quite so slick -_-
    8: Encrypt the compressed file.
    9: Ship it off to the backup user and have root reassign the permissions.
    10: Download to remote machine via SCP.

    This all occurs in the early AM for each of my forums.

    On occasion, I verify that the backups are functional, of course.
     
  18. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    We backup our database nightly. Its just a cron job set at an unbusy time. And has worked flawless so far. We had a couple problems in which we had to reup the site and lost only about a days worth of stuff. Which was not bad at all
     
  19. Tom

    Tom Regular Member

    Joined:
    May 27, 2009
    Messages:
    153
    Likes Received:
    18
    Location:
    New York
    Every other day and as is done manually.
     
  20. kev

    kev Regular Member

    Joined:
    Mar 9, 2009
    Messages:
    1,224
    Likes Received:
    61
    I have a backup script installed by Paul M. It backs up the database every night. I download the database to my home computer at least 2 times a month.
     

Share This Page