Check your version

This tutorial covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Last updated June 7, 2017

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

Objectives and Prerequisites

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

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

Tasks

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.

Summary

  • 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.

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.