Bobcares

Drush CMI tools – An Introduction

by | Jul 17, 2023

Learn more about Drush CMI tools from our experts. Our Drupal Support team is here to help you with your questions and concerns.

Drush CMI Tools – An Introduction

Did you know that Drush CMI Tools is a set of CLI tools that help with the management and manipulation of Configuration Management Initiative in Drupal projects?

CMI is a system in Drupal that helps with exporting and importing configuration settings. Furthermore, it offers a streamlined way to manage and deploy site configurations across different environments.

Drush is a CLI that comes in handy for managing Drupal sites. It offers a range of commands and utilities to perform various administrative tasks, like clearing caches, enabling modules, etc.

Drush CMI Tools help us extend the capabilities of Drush. Drupal. It offers additional commands and functionalities to simplify tasks related to Drupal’s configuration system.

Furthermore, it offers advanced CMI import and export functionality for CMI workflows.

How to use Drush CMI Tools for Efficient Configuration Management

Let’s consider a scenario where we are working on a Drupal project with a local development environment. Suppose our client is actively adding and editing configuration settings, like Contact Storage or Web Form for user interaction. However, we do not plan to track these configuration changes in the source control.

In order to ensure a clean state in our local environment, we can sync down a QA or production database and then run a config import. This brings our local environment up to date with the latest configurations.

As we work on new features, it is time to export the changes to our config export folder so that we can commit the new work into Git for deployment. This is where Drush CMI Tools’ drush cexy command comes in handy.

The drush cexy command is an improved version of the standard drush cex command. While drush cex includes a –skip-modules option to exclude specific module configurations, drush cexy takes it a step further to address more complex use cases.

By using the –ignore-list option, we can define patterns to exclude specific configurations from being exported. For example, here is a sample config-ignore.yml file that mention the configurations to ignore:

Drush CMI tools

In the above example, we are using wildcards to ignore all contact message fields and forms, as well as form and view display configurations. Furthermore, Workbench Email templates and the system site settings are ignored.

We can export the active configuration while applying the ignore list, with this command:

drush cexy --destination=/path/to/config-export –ignore-list=/path/to/drush/config-ignore.yml

With the above setup. we will see only the changes we want to commit, excluding the ignored configurations.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

In brief, our Support Techs introduced us to Drush CMI tools.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.