I needed a script to use with Drupal CVS HEAD during the testing and patch review process that deletes all the current database tables and starts a fresh re-install. There's maybe a better solution out there, but this works for me right now. Below is the code in the 'reset.php' file in the root of my Drupal install. I've also included an archive of the reset.php and developer profile that automates the whole process. Just extract the contents in the root of your Drupal directory, and go to 'http://yourdrupalpath/reset.php'.
WARNING: This deletes your current database tables and should not be used on any kind of site that you value your data. This has only been tested on a Drupal 7 (CVS HEAD) install.
Why don't you just use the Demonstration site (Sandbox) module?
You can create different snapshots and restore them at anytime.
Good question. I don't use the sandbox module for my testing since:
1. It's not available for HEAD / Drupal 7 which I'm testing on.
2. I wanted to literally delete the Drupal tables from the database and restart from the install process, since some of the patches that I've been testing make big changes and don't work well if the database tables are in place.
I came across a similar need and created a database erase script (it's part of the dbscripts module). However, my approach is based primarily on bash scripting and accessing MySQL through the command line. I like the approach you have here being able to do it through the browser. I'm interested to see if I can do something like this with the dbscripts module :D
I've updated this script with a developer install profile and an archive that will add all the files if you extract it into Drupal's root directory. Using this with the developer profile is saving me even more time! :D
What do CVS command do you use to update your HEAD and overwrite local modifications?
cvs update -R -C
Post new comment