Questions tagged [configuration-management]

Managing configurations across environments is part of the configuration management.

Filter by
Sorted by
Tagged with
41
votes
13answers
26k 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 ...
47
votes
6answers
30k 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 ...
80
votes
7answers
8k views

Suggestions for settings.php - Local dev, Development server, Live server

Basically, one of the greatest questions of all time: What are some ways you're using settings.php in your development/staging workflow? Right now, I have my settings.php file set up like the ...
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 ...
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 ...
32
votes
6answers
10k 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 ...
2
votes
1answer
510 views

How can I exclude API keys, passwords, and so on from configuration management?

I am using Drupal 8 and drush cex to commit my configuration to my repository. However, I want to keep passwords and API keys out of the repository. How do I do that? (selectively exclude sensitive ...
21
votes
3answers
14k views

How do I set a variable in the configuration file setting.php and use it from code?

How do I set a variable in the configuration file setting.php and use it from code?
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 ...
6
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 ...
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 ...
4
votes
5answers
1k views

Block error on CMI

I have two identical sites on Drupal 8 (A and B), on (A) I created a custom block(block/add), and then I export the configuration(drush config-export) and import this config on (B) (drush config-...
3
votes
3answers
897 views

How do I export my site structure?

Since Drupal 8 is days away from release, I've started experimenting with rebuilding my personal site on it. The one feature I am really looking forward to is configuration management in code. ...
1
vote
2answers
449 views

Adding script conditionally

In the module I am developing I need to add script which require jQuery.The will be added depending on configuration settings. Hence I am using template_preprocess_module(&$variables) where I am ...
18
votes
3answers
9k 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?
8
votes
2answers
383 views

Why is settings.php in the web folder?

In the default installation, settings.php is located at sites/default/. There are no recommendations in the official Drupal website about changing the location of this file. Doesn't it pose a ...
0
votes
2answers
3k views

How to use different domains for multilingual sites and keep users logged in?

I have a site that is in French and English. I am able to successfully setup so that users can switch back and forth between the two domains to view either language, however I cannot seem to keep ...
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 ...
4
votes
1answer
488 views

Development with git branches/ gitflow and new modules

I wonder if somebody found a solution for the following issue related to Drupal 8 development with Git branches: You work on a new feature in a local feature branch for that you activate a ...
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 ...
2
votes
2answers
3k views

How to change default language for configuration entities

I made a mistake during development of my Drupal 8 site. Some time ago I changed the default language (to german) - but I continued to create the configuration entities (like fields and so on) in ...
0
votes
1answer
830 views

How to override “active configuration” when the theme is installing?

I have a theme that imports configuration when is installed. The problem is when the configuration is already there and is active. Unable to install MYTHEME, field.field.user.user.user_picture, ...
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 ...
1
vote
2answers
1k views

Programmatically changing the global site name?

I'm making a multi-site setup using the same install and the same database, basing it off domains. I'm trying to programmatically alter the site_name variable so that it displays a different site name ...
1
vote
2answers
1k views

Ajax submission leads to => An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (2 MB) that this server supports

So i'm trying to submit a form using ajax, in my form i have the following: $form['actions']['#type'] = 'actions'; $form['actions']['submit'] = array( '#type' => 'submit', ...
15
votes
3answers
314 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 ...
3
votes
1answer
650 views

What are the alternatives to Features module in Drupal 8 [closed]

I am trying to export configurations from one Drupal site to other. This is not a one time operation, I will need to do this multiple times and Single Import, Simple Export is not an option as there ...
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 ...
7
votes
0answers
1k views
+50

How do I translate theme settings?

How do you translate custom theme settings in Drupal 8? I use hook_form_system_theme_settings_alter to add custom settings to a theme. One setting is the text string (e.g. 'Menu') to display beside ...
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\...
11
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 ...
5
votes
1answer
852 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
1k views

YML For Enabling a Contrib Module

I am adding a contrib module to a project and I would like the module enabling to happen automatically on deployment. My deployment script pulls the code and runs a config update via drush config-...
3
votes
4answers
7k views

Remove the strict warnings from being shown

I have a site using Drupal 6; after upgrading PHP to 5.4 , some strict warning appear. I set error_reporoting in settings.php with the following code, but I still see the E_STRICT warnings. ...
2
votes
2answers
1k views

Is there a way with drush or console to delete all active config with a certain prefix?

I'm currently trying to migrate a site with drush migrate-upgrade --configure-only ... and copying the export migrate_plus.migration_*.yml into a custom module for tweaking. Now I want to enable that ...
10
votes
2answers
792 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 ...
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
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 ...
5
votes
2answers
255 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
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 ...
2
votes
3answers
5k views

PDO exception error [database].semaphore doesnot exist [duplicate]

I created a website in drupal 7, tested it in my localhost and works good. Now, I want to host the site in our Main server. So, I uploaded the site directory to the server and created a corresponding ...
2
votes
2answers
2k views

The best way to store drupal Configuration

I know three options to store the configurations: Use the UI and store the values into the variable table. Also you can store them in settings.php and use the $conf[''] array to store the ...
1
vote
1answer
26 views

Export Paragraph bundle with Drupal Console

I know there is a command to export a content type config:export:content:type But is there a way to do this for a Paragraph bundle? Something like this isn't working config:export:paragraph:type
1
vote
1answer
594 views

How to clear cache for config entity after making changes?

We have a custom form mymoduleForm that has mymodule.settings which stores some values that we need to run some logic when calling mymodule_preprocess_node() hook. The form just has a text area where ...
1
vote
2answers
1k views

All links point to the old site after migration [duplicate]

I migrated a Drupal 7 site from 1 server to another. Let's call the old site URL http://oldsite.com and the new site url http://newsite.com. I have copied over the code base and the database. The site ...
5
votes
1answer
2k views

Drupal reuses its hash salt

The instructions in default.settings.php say This variable will be set to a random value by the installer. All one-time login links will be invalidated if the value is changed. Note that if ...
4
votes
1answer
728 views

When 'cron_safe_threshold' is set to 0 in settings.php, should the dropdown value on admin/config/system/cron be “Never”? or is it irrelevant?

I've installed Drupal 8.1.6. As Ultimate_Cron won't work on this site consistently or reliably, I've decided to just use Drupal's core cron, triggered externally (via /etc/crontab) rather than using ...
3
votes
2answers
1k views

Custom Block in custom 404 node

I have a node. This node is set to be the 'Default 404 (not found) page' in admin/config/system/site-information I've got a custom block that I want to show within the node mentioned previous. I ...
3
votes
1answer
370 views

When to create schema while working with config entity?

We have a custom form mymoduleForm.php that is used to perform some logic by calling mymodule_preprocess_node(). We were able to add addCacheableDependency() and now the mymodule_preprocess_node hook ...