It’s a joy to see how Drupal 8 fulfills its promise of becoming more convenient in every way! We’ve discussed how it respects web accessibility standards, facilitates product management with the Inline Entity Form module, uses the BigPipe module’s power to make sites load faster, and much more. Great improvements have also touched the configuration management issue. This will be today’s topic for discussion.
Configuration: a glimpse at what it is
Configuration includes any elements on your site that are configurable other than your content. Among them are: module and theme settings, display modes, widget and block placement, navigation menus, content types, taxonomy vocabularies and many more. You realize just how many there when you need to get something changed around :) For example, when you need to move your configuration changes between your site’s environments (dev, test, and live).
A new handy configuration management system in Drupal 8
In Drupal 7, sharing your configuration to your site’s versions used to be a daunting task. So, one of the main initiatives for improvements in Drupal 8 was to create a convenient configuration management system.
Now it’s done! The Configuration Management Initiative (CMI) has been successful. Congrats to all of us, because we now have a functional configuration management system built into the Drupal core that lets us store, modify and move our configuration data quickly and easily.
Manage your configuration in files
By default, your configuration settings are stored in the database. However, Drupal 8 offers the possibility to convert them to code and store them in files instead. It’s as simple as that: export your configuration from database to files, and, when you deploy it, just import it to the database of the new environment. For example, you can make some changes on your dev site, export them to files, deploy on your test site and import to the test site database, and so on.
For managing your configuration in files, the Configuration Manager module or the Drush command-line tool could be very useful to you.
Using files for configuration management is really time-saving. You no longer have to remember what has changed, say, on your dev site, and repeat these changes on your test site and your live site. Moreover, the process can be made automated. It’s also a really good idea to make it version-controlled.
Working with the same website and different websites
The new configuration management system is designed to facilitate moving your configuration from one version of your site to another, but NOT between different sites. So please keep in mind that the UUID values of the source and the destination sites should match. Only then can the configuration management work.
However, nothing is impossible in Drupal, and if you wish to migrate configurations from one site to another, you could try Drupal 8 Features Module — which, by the way, offers some extra flexibility that the CMI does not yet have.
Have questions, need assistance, want a new website? We are always glad to hear from you and configure our efforts to exactly fit your needs ;)