Solve the pain in staging Drupal with help of features module

13 Sep 2011

Joris Snoek - Business Dev
+31 (0)20 - 261 14 99

Building medium to large Drupal based sites, always gave a headache on: "how to stage this from development- to test- to acceptation- to live-server".

The problem here, to put it to basics: you have one 'shared' database with all of your Drupal system-, module-, images-, etc. -settings AND content items.

Live and development database filling

So when you celebrated that your Drupal websystem is live:

1) Content filling by users or content managers
The database get's filled by a content manager or it will be filled by unknown user in case of a social media Drupal install.

2) Setting database filling / changing by developers
You develop new function local (ie: at the office), that also puts Drupal settings in your database. If you develop in a team: different developers at the office will need to change settings.

So here you have two challenges

1) Team development
How to share the changed settings that different developers make in their local install (on their own computer), so all developers are working with latest settings.

2) Updating your live Drupal system
Howto update your live system; content managers or other website users added content item. And your developers need to implement changes in the database concerning Drupal settings.

It's almost impossible to build a constistent work around: you can't rely on simply: "we will configure the local settings that needs to be changed live 'by hand' (ie: login to Drupal as allmighty user 1 and change the settings as needed." This way you are doomed to make consistency mistakes that can bring down your ohh so precious and money making website for a while.

The sollution: allmighty "Features" module

This module is developed by Development Seed, heavily used in Drupal intranet out of the box "Open Atrium" and Drupal news management out of the box "Managing news".
They had the same itch on large implementation: how to scale and stage the system. So invented the features module.

Quoted from Development seed:

"Features is part of the answer to one of Drupal’s biggest headaches – what to do with all that loose site building and customization that happens on every project. Features is part of the answer to making stronger, better install profiles and targeted distributions of Drupal. And features is part of the answer to making Drupal more task oriented and less daunting to our users."

So basically, what the Feature module does is: putting the Drupal setting in module code, instead of in database.

And they build a nifty system in this module to configure your system with help of, for example: CCK, imagecache, views, context, spaces. And then export it to a module, that declares all these settings. From then on your setting will be in code and not in the database.

Then you can place this code in your version control system, so your developers have the same shared settings.
You need to make a briefing how to use it, but when used right this module will take a loooot of shared development and staging pain away.

You can also place this code in your Live system, so Drupal setting updating is done via this code and not via administering Drupal with help of an administrator user.

For info on the use of this module: Making and Using Features in Drupal

Finally

Many thanks to Development seed for building this module.

Feedback, Questions about the Features module in Drupal?

Please hit me on Twitter for all your feedback, and any other issue!

Comments

Nóg meer
kennis nodig?

Check ons ons blog archief >