This post describes the work I have done to create "template sites". Template sites are Drupal installations created and maintained with initial setup done to speed the creation of a new site. The template sites can be duplicated onto a new domain and database loaded with a single simple script.
When I start a new site, there are certain things that always have to be done (no matter the nature of the site):
These are repetitive tasks, and repetitive tasks chafe.
Instead of repeating these tasks every time I need to create a new site, I instead clone a template site which includes all this initial state.
These template sites (I have one for Drupal 6 and Drupal 7) are basic installations. They have (almost) no content, no users (besides uid=1), no additional themes installed. They were created using my drupalDeploy.sh script (and thus compatible with my Drupal Scripts Library). The sites are kept patched on a reasonable schedule.
These template sites have the following items/features/what-not installed on them and configured:
I have a cron job running on my server which re-generates the tar files listed below every night. These tar files include not only the Drupal core and installed modules; but a database dump as well. This dump is generated with the drupalBackup.sh script (which calls the drupalDBBackup.sh script) and exists in the 'sites/<sitename>/backups' directory. These tar files are linked to this node (and are visible at the bottom of the page).
Also: I do know about drush make; but I find this a more convenient way to solve this problem. Because the template sites are live sites, I can maintain them and add additional features to them as I wish. Then, as soon as the nightly cron job is run, the template file is updated.
To facilitate using these sites, I wrote the new script drupalBootstrapTemplate.sh which will download one of the template files attached to this node and install it on a new domain name and database. The script takes as parameters a flag denoting selected Drupal version, the (domain) name of the new site, and the database connection parameters.
After the script runs, the new site will be installed on the given domain name and the database will be initialized. The root (uid=1) user for the new site is 'admin' and the user's password will be set to the database connection password. (This is described in the Drupal Script Library's README file -- see the 'General Concepts' section.)
NOTE: Because of current limitations of the drupalBootstrapTemplate.sh script, you have to do the following things manually after completion of the drupalBootstrapTemplate.sh script: