New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Learn it fast with expert-taught software and skills training at lynda.com. See what you can learn

By Tom Geller | Friday, February 15, 2013

Automatically Back Up Your Drupal Site's Database

You do back up your computer, don’t you? It’s an easy process, even if you don’t use a utility like the Apple Time Machine: you simply move a bunch of files from your one place to another.

But if you try that with your Drupal site, you’ll leave out the most important part—your site’s content and configuration. That’s because those parts live in your site’s database, which is stored far away from the site’s files. The solution is to export the database as a file, then save that file along with everything else. Doing that manually can be a pretty awkward procedure, but the Backup and Migrate module makes it easy. Here’s what I do:

  1. Install Backup and Migrate the usual way (shown in the section “Expanding a Site’s Capabilities with Modules” in Drupal 7 Essential Training).
  2. Define where you want Drupal to store private files by clicking Configuration > File  system. Be sure to secure the destination by following the link on that page. If you don’t, your raw database file could become accessible to everybody.
  3. Configure Backup and Migrate to save the database into that directory. (I set up a schedule to save it once a day.) The video Backing up with the Backup and Migrate module in Drupal 7 Advanced Trainingshows you how.
  4. Save that database file when you save the rest of the Drupal files.

A conservative strategy: Backup and Migrate set to save six months of backups.

One last step: Be sure to practice restoring from that backup to make sure it works, as a bad backup is the same as no backup! Note that this is not the same as a straightforward MySQL export: you’ll need to use the Drupal Backup and Migrate module itself to reestablish your site. But while unusual, I’ve found this procedure to be far easier (and more foolproof) than noodling with my site’s Drupal database manually.

Learn it from the experts.

With online video courses at lynda.com, you can reach your goals faster. Learn software, improve your skills, and get an inside look at how the professionals work.

See what you can learn


Share this article:

Tags: , , ,

Get the latest news

  •   New course releases
  •   Pro tips and tricks
  •   News and updates
  
New releases submit clicked

You can change your email preferences at any time. We will never sell your email. More info

All articles

Featured articles

A lynda.com membership includes:

Unlimited access to thousands of courses in our library
Certificates of completion
New courses added every week (almost every day!)
Course history to track your progress
Downloadable practice files
Playlists and bookmarks to organize your learning
Become a member

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.