Stack Exchange Network

Stack Exchange network consists of 174 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.

42
votes
7answers
23k 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
10answers
22k 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 ...
29
votes
5answers
8k 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 ...
25
votes
9answers
3k views

How to prevent devel module to be installed on production enviroments?

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 ...
16
votes
7answers
6k 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
294 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
6k 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?
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
2answers
782 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
4k 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
1k 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
21k 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
1answer
3k 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 ...
8
votes
2answers
602 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 ...
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
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 ...
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
591 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
949 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
3k 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
907 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
3answers
4k 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 ...
6
votes
1answer
659 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
1answer
315 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
92 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
338 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 ...
5
votes
2answers
6k 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 ...
5
votes
2answers
562 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
4answers
903 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
1k 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 ...
5
votes
1answer
658 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
3answers
936 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 ...
5
votes
2answers
291 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
1answer
410 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
696 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: ...
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
215 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
122 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
226 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
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
2k 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 ...
4
votes
4answers
3k views

Is there a way to clone a content type and its fields?

I have a content type named "event_xyz" that I want to rename to "event". I figure I can clone the content type and then delete the original. But I don't see any tuts or modules on how to do this. ...
4
votes
3answers
620 views

What are configuration entities used for?

I’m trying to wrap my head around D8 Configuration Entities (CFE). The concept of a Content Entity (CTE) seems easy – if you want an application that keeps the information for a CD music collection ...
4
votes
2answers
3k views

Does get_defined_vars() show variables defined in variable_set()?

I'm using Drupal 6, and I'm having problems retrieving a set of variables I set with variable_set() using variable_get(). I'm doing a dpr(get_defined_vars()) to see what's defined, and I don't see my ...
4
votes
3answers
308 views

Is it possible to hardcode views as part of the custom module to avoid `config/sync`?

I've exported views into the custom module using Drupal Console and config:export:view command, so they exist as part of the module in modules/custom/my_module/config/install (YAML files). After I've ...
4
votes
2answers
968 views

Add default image to image file programmatically

I am trying to add a default image to an image field in Drupal 8 using the configuration management interface (CMI). Normally once I have a field configured through the admin UI, I would then export ...
4
votes
1answer
523 views

Bandwidth Optimization options locked

I'm running a largely default Drupal 8.0.0-RC2 site. At /admin/config/development/performance the "Bandwidth Optimization" settings for "Aggregate CSS Files" and "Aggregate Javascript files" are ...