I often find myself re-creating the same site: a 'clean' instance of what I have developed so far. It takes me several hours to do. So, I have created a .install file to create all of my content types and fields when I install the first of my custom modules. I also need to:

  • Create two menus
  • Configure some blocks
  • Configure the user permissions
  • Alter some of the default theme settings

What is the best approach to achieving the above 'programatically'? At the moment I do all of these tasks through the various user interfaces, but like I say it's time cosuming to keep doing it every time I want to start afresh.



So You Want to Build a Drupal Distro

Take a look at Packaging a distribution on Drupal.org

Here are the steps:

  1. Assemble the pre-requisites
  2. Create a Drush Make file
  3. Convert to a Drupal.org-specific Drush Make file
  4. Build and verify it works
  5. Commit your code to Git
  6. Release your code on Drupal.org
  7. Maintain your distribution

Another great tutorial How to Write a Drupal 7 Installation Profile

Also there is Profiler Builder module.

Profiler Builder is a module for automating the creation of installation profiles and distributions. It has support for the Profiler installation profile simplifier library but is able to run independent of it (1.0-RC4+). This module creates a downloadable tar package that gives you a well made installation profile and associated drush make file based on the site its installed on.

|improve this answer|||||

Features module enables you to export many configured variables, such as content types, in code. It is considered the current standard.

Many other modules, such as Rules and Views, are compatible with Features and allow you to export the configuration you create with them.

There are also modules to enable export of extra config as needed (i.e. Features Extra and Role Export) enable you to export more things, such as Nodequeue settings and Roles/permissions.

Using Features and Role Export, plus a clone of your site's theme, would likely enable you to export all of the configuration variables you want.

|improve this answer|||||
  • can you expand on this a little? – mpdonadio May 29 '13 at 23:45
  • Features is (or can be) part of the solution, but you need more than features. When you install a site, your features will not be enabled so you will only have a standard install in which you have to enable your features manually. – marcvangend May 30 '13 at 14:54
  • True. A shell script that runs drush en [yourmodules] -y would take care of that, as would making a feature that lists all your others as dependencies, thus allowing you to only enable one. – beth May 30 '13 at 16:11

I think both @beth's and @Nikhil's answers here supply part of the picture. Create an install profile that enables Features modules and you are most of the way to a rounded solution. There will often be other things you want to do but generally they can be scripted using drush, then the whole process can be wrapped up into a shell script.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.