Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

confi

325 sites Security covered
View on drupal.org

πŸ‡ΊπŸ‡¦

This module is maintained by Ukrainian developers.
Please consider supporting Ukraine in a fight for their freedom and safety of Europe.

This module aims to cover development needs with managing configurations during project development.

Importing all configs during development is not convenient and can lead to a bad behaviour with overwriting or deleting configs or content from a site.

So there is a need for importing only of specific configs via hook_update_N().

Usage

All the work happening with the config_import.importer service. Let's instantiate it:

/* @var \Drupal\config_import\ConfigImporterServiceInterface $config_importer */
$config_importer = \Drupal::service('config_import.importer');

By default, import and export operations will use the sync directory. But, if needed, it could be changed to a path of existing directory or type of already configured configuration directories. For instance:

// $config_importer->setDirectory(CONFIG_STAGING_DIRECTORY);
$config_importer->setDirectory('/var/config');

You may do so to import existing configs:

$config_importer->importConfigs(['core.extension']);

And export can be achieved with a similar construction:

$config_importer->exportConfigs(['core.extension']);

Features integration

To revert/import features you have to enable the features module first:

drush en features -y

Get instance of service:

/* @var \Drupal\config_import\ConfigFeaturesImporterServiceInterface $features_importer */
$features_importer = \Drupal::service('config_import.features_importer');

And do the import:

$features_importer->importFeatures(['feature1', 'feature2']);

Drush integration

Execute the next command to see the list of available commands from a group:

drush help --filter=config_import

Then use the following syntax to find out more information about concrete command:

drush help COMMAND_NAME

Example use cases

/**
 * Revert custom block feature.
 */
function ygh_master_update_8024() {
  \Drupal::service('config_import.features_importer')->importFeatures(['openy_block_custom_simple']);
}

/**
 * Update HTML format config.
 */
function ygh_master_update_8025() {
  /* @var \Drupal\config_import\ConfigImporterServiceInterface $config_importer */
  $config_importer = \Drupal::service('config_import.importer');
  $config_importer->setDirectory(YGH_CONFDIR);
  $config_importer->importConfigs(['filter.format.html']);
}

To do

  • Create UI for making manual config changes convenient

Video about this module: https://www.youtube.com/watch?v=vFsgNjhGr4Y
Recent video from @froboy - https://www.youtube.com/watch?v=SvSDes_6Tmo

For updating specific property in config:

1) go to related to this config module

2) create new hook_update_N in openy_*.install file

3) in update add next code (this is example):

$config = drupal_get_path('module', 'openy_media_image') . '/config/install/views.view.images_library.yml';
$config_importer = \Drupal::service('config_import.param_updater');
$config_importer->update($config, 'views.view.images_library', 'display.default.display_options.pager');

Where:

  • $config variable contains path to config with config name
  • "views.view.images_library" - config name
  • "display.default.display_options.pager" - config specific property (you can set value from a nested array with variable depth)

Activity

Total releases
9
First release
Feb 2025
Latest release
5 months ago
Release cadence
33 days
Stability
78% stable

Release Timeline

Releases

Version Type Release date
4.1.1 Stable Nov 12, 2025
4.0.1 Stable Jul 11, 2025
4.0.0-alpha1 Pre-release Jul 11, 2025
4.x-dev Dev Jul 11, 2025
4.0.0 Stable Jul 1, 2025
3.2.3 Stable Jul 1, 2025
3.2.2 Stable Jun 30, 2025
3.2.1 Stable May 1, 2025
3.2.0 Stable Feb 18, 2025