Drupal Installation Profiles - Part 1

When prototyping or investigating a new concept it is common to wander down the wrong path since by definition you are are in uncharted waters. There is generally more than 1 way to address a problem and Drupal often provides several slightly (or radically) different contributed modules for any area of interest. Going down the wrong path is all part of the learning curve. You will make mistakes. And have to start over from scratch. Hopefully you are getting smarter. This learning process often means that you need to wipe what you have done and start over from a known point. Restarting each time from scratch is a nuisance.

In this situation it is helpful to have a mechanism to recreate a known sandbox environment. As with everything Drupal, there are multiple ways of doing this. The least structured (and hence most error prone) is to manually download Drupal core and any required contributed modules and then point and click your way to a fresh installation each time you start over. This gets very boring (and error prone) after a dozen repeats. The most structured approach would involve pulling code from your special GIT repository and executing a Drush script to enable and configure your desired modules.

What you really need is a pre-configured custom Drupal installation process. No worries mate! Drupal natively supports this concept via Installation Profiles. Drupal 7 core comes with 3 standard profiles:

  • Minimal
  • Standard
  • Testing

Most people take the default standard and end up with a fully useable basic Drupal CMS. As a quick experiment I suggest you try installing the Minimal profile and see how much stuff is missing (no content types!) I did not bother to look at the Testing profile.

Iterative prototyping cries out for you to create your own Drupal Installation Profile. An advantage of this concept is that the sandbox configuration is all captured in code via the Installation Profile. It allows all custom configuration settings to be captured in a single location: the Installation Profile. The configuration is not spread across PHP code in Drupal module files and Drush commands squirreled away in bash scripts (or scribbles on Postit notes...). Use of Drupal Installation Profiles also allows site creation on web hosters where you may not have Drush access. The Drupal Installation Profile is executed via standard web browser access. An added benefit is that the Installation Profile can be incrementally extended to include the results of your prototype efforts.

Every time you learn something, you roll it back into your improved custom Installation Profile.