Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [configuration-management]

Managing configurations across environments is part of the configuration management.

46
votes
6answers
28k views

How can I import the configuration on a different site?

I have this error when I try to import the config of an another site: The staged configuration cannot be imported, because it originates from a different site than this site. You can only ...
40
votes
12answers
25k views

How do I remove a configuration object from the active configuration?

I'm writing a custom module for Drupal 8. It defines a field storage configuration object, in a file called modules/mymod/config/install/field.storage.bloom_stem.bs_twitter_ac.yml. The problem is ...
30
votes
6answers
9k views

How do I update the configuration of a module?

I'm building a custom module in Drupal 8. It includes some YAML config files. As I develop I need to change and add to the config, e.g. to add another field onto my custom entity. At present the ...
26
votes
9answers
4k views

How to prevent Devel module to be installed on production environments

Using the new Drupal 8 Configuration manager, how can I prevent it from installing the Devel module on certain environments? As far as I know, installing it on my local means the next time I export ...
18
votes
1answer
709 views

Technical advantages of either Configuration or Features over the other?

In short, Configuration vs Features, in Drupal 7, fight! As always, technical advantages, or other hard facts, as we don't do discussions here. Drupal 7 specific to limit to scope, as CMI vs Features ...
17
votes
3answers
8k views

Import a single yml configuration file

Is it possible to import one single yml configuration file by specifying its path? Or a group of yml files contained in a specific module?
16
votes
7answers
7k views

Exclude configuration from import/export

I thought this was a simple use case of the new Configuration management system, but I haven't had any luck finding out how to solve this: Problem I want to store configuration in git and use drush ...
15
votes
3answers
312 views

How do I deploy/manage similar sites from an unique profile, without dumps?

I do not like the "cloning website" solutions which implies dumping a database and importing this dump in another environment. This does not look like a real world way of deploying several instances ...
13
votes
3answers
3k views

What are cloned sites in Drupal 8?

When trying to export my site configurations from one Drupal 8 site to other I keep getting the following error The staged configuration cannot be imported, because it originates from a different ...
10
votes
1answer
4k views

How to remove mymodule configurations on uninstall [duplicate]

I have created a custom module and created a yml file to create a menu system.menu.custom_menu.yml id: custom_menu label: 'Custom menu' description: 'Custom menu.' langcode: en locked: true ...
10
votes
2answers
788 views

Best way to delete all variables when uninstalling module

I'm writing a module that writes several variables (three, four variables for every content type, and other). Which method should I use to delete them on hook_uninstall? Is it safe to perform a ...
10
votes
2answers
5k views

Exporting fields for content type

The configuration export feature of Drupal 8 would seem to be a very useful feature. However, I'm not sure I completely understand how it works. For example, if I do a single export, choose "Content ...
9
votes
3answers
5k views

Configuration export/import not working for taxonomy terms in Drupal 8

I did a drush config-export staging on a local version of my site then a drush config-import staging on the server. It imported all the taxonomy vocabulary but no terms. I also tried it via the UI (...
9
votes
1answer
2k views

What order should configuration import and module updates be run?

Since the schema version of modules is stored in the key-value storage, it is unique to each site and is not synced through configuration management. That makes sense, since updates may need to make ...
8
votes
4answers
22k views

How do I set variables for variable_get()?

I am trying to understand variable_get(). I read so far that you can set variables in the settings.php using the $conf array and retrieve them later in code by using variable_get(). I have read that ...
8
votes
3answers
3k views

How to solve the “The following module is missing from the file system” error?

Getting the following error in the admin in a Drupal 8 site: The following module is missing from the file system .... Looks like a custom module was enabled and deleted without disabling it. How ...
8
votes
3answers
5k views

Export D8 menu configuration

Looking for a way to export menu configuration. The Configuration management system will export the menu itself, but not the menu links configuration. I am looking for a way to put one of those mega ...
8
votes
2answers
603 views

Best practice for custom module variable names?

I've gotten into the habit of doing pretty robust configuration panes for my modules now, and I'm finding the variable names & management to be quite the pain. I have variables like ...
8
votes
2answers
679 views

Features versus Configuration Management

I am building a Drupal 8 site and I have done some research whenever I should use Configuration Management or Features to export configuration and include it in my profile. In order to export and ...
7
votes
2answers
1k views

Is there a module for tracking changes to a Drupal site's configuration? [closed]

I want to create a simple system for tracking changes to my Drupal configurations and knowing which modules are used by some configuration settings is crucial, but will be happy to use an existing one ...
7
votes
2answers
7k views

Site UUID in source storage does not match the target storage

When I run drush cim -y on my staging instance of my site I get the following error: Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in Drupal\...
7
votes
2answers
2k views

How to export translated variables settings in code?

In a custom module I define several configuration variables by implementing the Variable module's API. The module is part of a multilingual site project, so some of these variables should be ...
7
votes
2answers
1k views

Change .gitignore file for sites/default/files/config

I'm checking out the new configuration management module for Drupal 7. It's effectively a back-port of the new configuration management that's in D8, and looks like it's going to be a great ...
6
votes
2answers
7k views

Drupal 8 variable_get

I have some code in Drupal 7 what are using variable_get. Now I would like to write the code in Drupal 8. So I was reading this but its didn't help me a lot. How to write this code in Drupal 8 from ...
6
votes
2answers
4k views

How to override configuration from a file?

I have been playing a lot lately with an import configuration to Drupal 8. And I notice that all documentation show you how to edit value per value instead of overriding the entire config file. You ...
6
votes
1answer
2k views

Best Way to Handle Variables Per Environment

I have a custom module. It's FormBase to create a form. And on submit, I post values to an API. All this works. But I want to change the base URL variable (which is used in multiple methods) so that ...
6
votes
1answer
912 views

Are Drupal 8 configs written and read directly to/from .yaml file or still to the database?

Background Drupal 7 and previous versions have attracted criticism for Drupal web site admin configuration being stored in the MySQL database, the criticism being that being in a database means that ...
6
votes
1answer
919 views

When to use mapping or sequence to define an array in a schema file?

I need to define an array in my onlyone.settings.yml file to store this values: onlyone_node_types: book: book test: test In my onlyone.schema.yml file I have this: module.settings: type: ...
6
votes
3answers
1k views

How to add the configuration changes from a website to another website?

This is what I'm trying to do: I have a website A where I make configuration changes and add other stuff. Now I create a website B. I would like to add the configuration changes from website A to ...
6
votes
1answer
778 views

How to delete a particular variable from a configuration created by a custom module

I have created a custom module and a configuration say 'abc_settings'. This configuration creates a variable for each vocabulary present on the site like vocab1_options, vocab2_options, vocab3_options ...
6
votes
2answers
1k views

Module uninstall dependencies

I'v got a question regarding dependencies & configuration. I created a module providing a content type, field type, widget & formatter. While wanting to uninstall the module, I get the ...
6
votes
2answers
2k views

How to enable modules through configuration?

I am trying to enable modules by adding them to core.extension.yml file without getting involved with Features, Configuration Installer or similar modules or profiles. The modules are enabled but ...
6
votes
1answer
427 views

Configuration successful but never gets imported

I have some changes in core.entity_form_display.node.news.default. When I run drush cim -y it says it is successful but it actually never imports it. drush cim -y Collection ...
6
votes
5answers
4k views

How can I export a group of settings in Drupal 8

Drupal 8 has this new configuration management tool at /admin/config/development/configuration. I have an experimental site running Drupal 8 beta14, and I want to import a few settings into my new ...
6
votes
1answer
97 views

How can I enforce maintenance_mode at all times in a specific environment?

In Drupal 7, we could override the $conf variables in settings.php to force a site (e.g. development) in maintenance mode. In Drupal 8, this has changed to $config, but the maintenance mode variable ...
5
votes
2answers
619 views

Configuration management sync vs active vs staging

The documentation on config management talks about a CONFIG_SYNC_DIRECTORY setting, but then there is also mention of CONFIG_ACTIVE_DIRECTORY and CONFIG_STAGING_DIRECTORY setting throughout comments ...
5
votes
5answers
6k views

Unable to install the XYZ module since it requires the A module

When running (right after site install) the drush cim -y command, the following error appears: Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in ...
5
votes
4answers
915 views

How to change Drupal settings programmatically, to simplify sharing of config changes?

I'm thinking specifically here of layout changes, such as: moving a block around, or when a new block is created and needs to be positioned, and shown or hidden on specific pages. Currently, when ...
5
votes
1answer
685 views

Prevent Development modules from being added to configuration management

We have modules that are only used for local development like Stage File Proxy. How would I prevent these modules from being added to the configuration management?
5
votes
2answers
293 views

How do you keep production site in synch with development site?

I've got a Drupal development site where I test everything (modules, configurations etc.) before implementing on the production site. As it is right now, I need to write everything I do on paper and ...
5
votes
2answers
535 views

Disabling module with config sync and removing with composer

I have an issue disabling modules, I've searched but cannot find something useful: - Developer A disable module and via composer remove it - I pull his changes so i run composer install that remove ...
5
votes
1answer
587 views

Difference between $this->config and \Drupal::config in ConfigFormBase

I want to override a custom module configuration in the settings.php file. So the configuration in database can be independent from the environment. $config['my_module.settings']['prop'] = 'foo'; I ...
5
votes
1answer
2k views

Why variable_get() returns all values of checkboxes list, even if checkbox is not selected?

I have checkboxes list in system settings form: $form['mymodule_menu_perm_menus'] = array( '#type' => 'checkboxes', '#title' => t('Menus'), '#options' => menu_get_menus(TRUE), ...
5
votes
1answer
768 views

How to disable modules using config split?

I have created different split for each environement (local, dev, test, prod) using the Configuration Split module. How can manage modules (enable/disable) in each environment? Should I keep core....
5
votes
1answer
252 views

How to make all render caches update on a configuration override?

Short version: I am using a configuration override to override the site name. Changes are reflected in the HTML title, but not in the system branding block. Drupal keeps serving this block from the ...
5
votes
2answers
134 views

How do I correctly inform the system about my module's new config?

I'm working on a module that already comes with a config file in mymodule/config/install/mymodule.settings.yml, and I'm working on a new feature that requires its own set of configuration in mymodule/...
5
votes
2answers
252 views

Configuration management with different database and websites

We have a central code base (Git repo). From this code base we deployed several websites already. Till now we used features. The websites which are already in production they have a filled database ...
4
votes
2answers
391 views

variable_get('var') VS $GLOBALS['conf']['var']

Let's say I set a variable in settings.php: $conf['var'] = foo; In my module or theme code, I can access this with either: variable_get('var'); or $GLOBALS['conf']['var']; Which is the preferred ...
4
votes
4answers
5k views

Saving values using variable_set through an array

I have used variable_set to save one value. How can I save multiple values through an array using variable_set?
4
votes
2answers
3k views

How can I programatically change the (D8 core) workflow state of an entity with Content Moderation?

I'm using Drupal 8.4-rc2. When you enable the Workflow and Content Moderation modules, you automatically get the Editorial Workflow as a demonstration. The states are as follows: Archived Draft ...