Blog: Database Backups

Database Backups for Drupal on a Stick
engineer

How We Got Back Ups and Restores Working in an On a Stick Environment

How We Got Back Ups and Restores Working in an On a Stick Environment

As we talked about here and here, we recently built a dynamic disaster relief kit in the form of a Drupal website on a usb thumb drive for the American Institute of Architects’ Communities by Design initiative. Users are able to add and edit content in the kit, so we wanted to make it possible for users to create a backup of the Drupal on a Stick database and, when necessary, restore the database from one of the available backups.

Here's how it looks:

This sounds simple enough, and in fact there are some useful options out there for running backups when operating a Drupal installation in normal environments (e.g. LAMP on a hosted server). However, the constraints of running in an "on a stick" environment meant we needed a custom solution. Why? To begin with large numbers of writes and reads from the flash drive take quite a long time. Also, we wanted to avoid the classic situation of creating a  snake that eats its own tail - we didn't want to attempt to fully restore a Drupal database from within Drupal itself.