[development] How to clear database after a regular interval

Daniel F. Kudwien news at unleashedmind.com
Sat Mar 7 19:40:10 UTC 2009


> Re-installing the entire site would be tricky to do via a 
> module inside the site itself ("cutting off the branch you're 
> sitting on"). In that case, you would be better served by a 
> batch script started by a separate cron-job outside the Drupal site.

This is exactly what Demo module (http://drupal.org/project/demo) does.

1) Install the module.

2) Create a snapshot of your clean demo site.

3) Configure the reset interval and setup cron (see http://drupal.org/cron).

   - and/or -

   Enable the "Reset site" block, which allows users to reset the site manually.

4) Profit.


Demo module is also a great way to

- take arbitrary snapshots during site building and development (for testing potential modules to install, re-configuration, automated processes, data imports, safety backups before running update.php, etc) or

- test module update paths (from 6.x-1.x to 6.x-2.x) or

- even test entire upgrade paths (5.x to 6.x).


Rob Loach even went ahead and created a Demo installation profile (http://drupal.org/project/demo_profile), which may be an alternative to regular installation profiles in certain use-cases.

sun



More information about the development mailing list