Create database snapshots

The demonstration site module is a great tool if you want to create a publicDrupal demo site. You can set it up to import a fresh database each hour. Let me explain how I use it.

To get started just go to http://drupal.org/project/demo and download the module, then place it in sites/all/modules.

Then enable the module at Administer >> Site building >> Modules.

Go to Administer >> Site building >> Demonstration site to checkout the module.

demo_fig1.jpg

Creating a snapshot is easy, just click on the Create snapshot tab, fill in the name and a description then hit Create.

demo_fig2.jpg

To reset a site to a previous snapshot just click on the Reset site tab, select the snapshot you want to use and click on Reset.

demo_fig3.jpg

Let me now explain how I use this module within my development workflow. The first thing I do is change the Dump path to somewhere outside of the files directory.

This way if you use a version control system (git, svn, cvs) you’ll be able to add it to your repository when you commit changes.

Just a word of warning don’t copy over the snapshots onto your production server when deploying a website. User could download the sql dump file if they know the direct URL.

If you have any questions leave a commit. I would also be interested to hear how you handle database files between developers when working on a website together.