Module Development

Movie Project: Manage Configuration Changes for Drupal 7

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

Learn how to use Features to manage configuration changes and understand the configuration change workflow in a team environment.

Goal

Use the Features contributed module to export site configuration to code.

Prerequisites

You will need the following knowledge and skills. If you need a review, check out the Additional resources section at the bottom of this page.

  1. Create and update features.
  2. Share configuration changes between developers.

Part 1: Create and save features

Create a feature for your Movie Review content type, and save it in sites/all/modules/features.

Part 2: Enable features in a new deployment

Create a brand new Drupal installation. This is a simulation of another installation on another developer's machine.

Enable the Features module and copy your Movie Review feature over to this website.

Enable the new Movie Review feature in the new site to re-create the Movie Review content type.

Part 3: Update configuration changes using Features

Create a new Awards field in your Movie Review content type in your original website.

Update your Movie Review feature, so it contains your new field.

Copy the updated feature over to your new site.

Part 4: Apply configuration changes on another project

Revert all feature changes and check to see if your new Awards field has been created on the new site.

Recap

  • Features can be used to export configuration changes within Drupal, and can share configuration changes within a team.
  • Developers should always revert Features (drush fra) to apply any configuration changes in the codebase.
  • Features must be managed with care to avoid conflicts.
  • Configuration changes must always be pushed to a live environment via feature changes or update hooks. Altering configuration on the live site via the UI should be avoided.

Further your understanding

Additional resources

Creative Commons License

Drupal Training Resources by Damian Robinson are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.damianrobinson.co.uk.

Hands-On Exercises: Movie Project