I have scoured the forums and have a general idea about this. The dba.module will back up your database easily. Phpmyadmin can also do this. However, these are manual backups, meaning I MUST do it by hand rather than having it automatic, lets say, every hour on the hour. I have not seen any answer to this issue and no module covers this functionality, including the dba.module. Drupal has 25,000 plus members (if the rumor mill is correct) and this is growing fast and daily. Drupal.org, how do you do backups? Manually, I doubt it. Do you use the dba.module. This I doubt too as Phpmyadmin seems a bit more well suited, but I don't know. Is there a mirror site in case all hell breaks loose? Is this recommended? I'm just curious because as I get more traffic, I'm getting nervous. Is a basic, manual backup good enough? What do you recommend? On a side note, are there any database tables in Drupal that I do NOT need to backup during a backup. All replies appreciated to this topic. I'm perplexed, nervous, and a bit overwhelmed.

thanks,
Wim

Comments

mitomac’s picture

I use a daily cronjob job to mysqlump my drupal database.

Followed by off site incremental backups using TSM that detects the changed changed database dumps. TSM keeps last 30 days of backups for easy roll back.

mitomac

sepeck’s picture

There are a large number of configurations available and while there is work going on to add automation features that cover db backups to the database module, ultimatly it is your responsibility.

This page: http://drupal.org/node/22281 has a link to the MySQL disaster recovery section of their handbook where you can find examples of how to backup your database. Database backups can be scripted and run as cron jobs. There are a number of examples on the web. Google for automate mysqldump.

This page: http://drupal.org/node/434 also has a link to the MySQL manual page on backups. While it had good information befire, I updated it to include a reference to the sites and files directories which should also be backed up on a regular basis.

I run my stuff on Windows, so I have a batch file that runs mysqldump every night and then NTBackup dumps it to tape.

ABout every other month, I do a random test restore of one of my sites from tape. After all, what good are backups if you don;t know that they work?

-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

robertdouglass’s picture

I just wrote an extension to the dba module which will mail the database backup to the administrator on a regular basis.

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net

sepeck’s picture

Robert,

DO you have a way to indicate it should send a notification if the size gets over a certain limit? Some db's can get large and as a mail admin it is a constant thing to mention, the email system (while convienient) is not an efficient method to transfer files. Without such a check, I envision this poor guys site getting blacklisted due to constant attempts to send the 15 MB attachemnt :). Or his mail server getting hammered over time.

People forget they set these things up.

-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

robertdouglass’s picture

It would be nice to be able to exclude certain tables, as well (cache, watchdog etc.)

I also want to write a module that will send every updated file on the filesystem in chunks (mails up to X MB large). You would tell it the max attachment size, then every cron it would make a list of files that have changed (via timestamp), zip them up and mail them. Then you could recreate the entire filesystem by unzipping the mail attachments into the same local folder. Like poormansrsync :-)

There'd be no way to handle files that got deleted, so the backup would be larger than the filesystem in reality, but at least there'd be a backup.

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net

sepeck’s picture

Well, perhaps a admin note in the module text mentioning this posibility. I consider my site small and the mysqldump is close to 5MB. My next small site is 1.5MB. It is about 2 years old as well, but less content updates, though the client is satarting to see she wants to do more.

Backup the files dir through email? Ummm, you have no idea how much you've just horrified an email admin :P. I'm telling my co-workers on you (one is an email admin who uses Drupal as well), we can form a support group for other email admins. Pity about reality and the use of some technology. :)

Ah well. When you get it done, please add (I can;t believe I'm doing this) a line in the Best Practices section mentioning this option for folks. I've been trying to add tricks to it.

-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

robertdouglass’s picture

Seriously; there is no *easy* way to back up your site. I figure if it only sends new files, and does so every 10 minutes, the emails won't be that big. We'll see if I get it finished or not, so much else going on.

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net

sepeck’s picture

me down if I did that by people who wanted to do it would probably be bigger. :)

Ya, it's the larger sites db that will generally be the big file. Sites that have a lot of large files (docs, pdf, mp3, etc) would generally use a more traditional backup solution.

-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

battochir’s picture

I thank everyone for their responses. I've thought about this long and hard. So far, it seems that a batch script (yeah, I'm on windows...don't beat me up!) that launches mysqldump at intervals seems the best route. Sepeck what do you mean by a 'more traditional backup solution'? If I'm eBay, what's my solution?

thanks,
Wim

sepeck’s picture

The current term is 'backup to offline storage'
http://www.hp.com/sbso/bus_protect/data_protect/backup.html
But it really means backup to tape. There are a number of solutions out there that are making some head way, but for an enterprise, tape is still the king.

If you are a small business, then backups to CD will work but there is some evidence that CD's can degrade faster then first thought. If you are backing up regularly, then that's generally ok. As CD's are cheap, don;t use the rewritable ones for sequentila backups. If you have data corruption, you may have to go back a few days to recover a clean backup.

There are also companies that will backup your data across the Internet, you need to have the bandwidth to accomadate your data volume, so it's not an effective solution if you have a lot of data. If you are a small business, it could be a decent solution as it at least makes sure you have a backup and that it is offsite should the building burn down.

As to windows, why would I beat you up? I run my Drupal on Windows and IIS

-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

battochir’s picture

Thank you sepeck, I'll do some more research. I find backing up data a lot more complex than I originally thought. But, what is amazon or ebay without their data? Pretty interfaces on the web, nothing more. Thanks again for the explanation.

wim

Tharion’s picture

Hello,

the last post to this topic was in August last year. Do meanwhile exist new possibilities or modules for backup the database and/or the filesystem automatically?

Tharion

airfx’s picture

Here ist a german thread: http://www.drupalcenter.de/node/384

Leeteq’s picture

The original question in this thread is almost one year old, and none of the replies since then addressed the question.

Can that information be shared here?
Script code, which tools/systems, etc.?

(Has it been already? I have searched and browsed, but could not find "it". If someone has a pointer/link then please post it in this thread.)

.
--
( Evaluating the long-term route for Drupal 7.x via BackdropCMS at https://www.CMX.zone )

sepeck’s picture

mysqldump occurring at scheduled times. Standard stuff that can be found in the MySQL manuals on backup and recovery.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

gurukripa’s picture

hello everyone.
thanks to the developers for such a gr8 CMS.
i use drupal 5.1 and am mortally scared of losing all i have on the site..and am dumb too..no knowledge of backup or restore or all these fancy things of php, mysql, cron config, cmod etc...

have installed a lot of modules and made changes to the themes etc also...so need help to save my site :)

so i need a backup and restore for dummies module...someone please help...

pablokenfold’s picture

Hello everyone. I realize the post is quite old, but it seems the best place to ask.

Don't you *need* to take the site offline before doing a mysqldump on the database?
What happens if someone is posting / uploading something / or *gasp* the admin is making changes at the exact same millisecond of the database backup?

Right now I'm interested in backing up (automagically) an intranet site, so this is not really an issue, as it is not in use during nights, but I want to know, in case I ever do it on a live site.

Also, if you need to take the site offline, is there a way to schedule a cron job to do this task, then do the mysqldump, then take the site back online?

jhung’s picture

Hi Pablo.

I am hoping for the exact same information. The closest thing I have found is a script at Samat.org but the author admits it is not perfect.

Doing many different searches yields nothing productive.

Anyone know how to schedule downtime / maintenance mode for Drupal so backups can be performed?

Letting my imagination run wild, I would love to have a module that did something like this:
- Allows you to place a Block visible on all pages warning if the imminent downtime. (i.e. "This site will be going down for maintenance in 28 minutes (12am ET) until 1am ET. blah blah").
- set a custom offline message different from the regular Maintenance message.
- specify multiple schedules
- integrates with other modules so you can schedule other actions

-Anti-’s picture

I tried some bash scripts and none of them were reliable enough.
http://drupal.org/project/backup_migrate was enough to suit my purposes. I set it up to create one daily automatic backup, and keep a seven day archive. Every couple of weeks I manually download one for safer keeping. It would be great to have an occasional backup automatically emailed, which some bash scripts can do, but I wouldn't want to give up the stability and simplicity of B&M, so I just do it manually.

Why would the site need to be shut down? I would have thought 'collisions' would be handled by mySQL so that the backup wasn't corrupted during the operation by new data being added?