54

You can get the UUID with: drush config-get "system.site" uuid And you can change it with drush config-set "system.site" uuid "fjfj34-e3bb-2ab8-4d21-9100-b5etgetgd99d5" With that you gotta have the same sites.


53

The easiest way to do this at the moment is to use drush php (or core-cli) to open an interactive session. Then use: Drupal::configFactory()->getEditable('system.menu.devel')->delete(); This functionality will be added into Drupal console as well.


35

A 128M memory limit is often not "more than average" for a Drupal project. Also, just because you've specified 128M as the memory limit, that doesn't mean your webhost is giving you that much (or even half as much). Let me explain. I'll use Commerce Kickstart v2 with the demo store installed as an example (matching a medium-sized Commerce store). It has 10 ...


29

Drush command to delete configuration object: drush config-delete <config_name>.


28

The easiest way is to ensure that the config has a dependency on your module. dependencies: module: - yourmodule enforced: module: - yourmodule Then Drupal will automatically remove that configuration and also warn in the UI that it will be removed. Note that this only works for new installations, it won't fix existing ones. An ...


24

Maybe you hope to learn that variable_set is the magical way to store all kinds of structured data in your database, and that variable_get is the way to get it out again. Unfortunately, it is not. The "persistent variables", as they are often called, are meant for relatively simple key-value pairs that should persist across requests, users and sessions, ...


23

As mentioned in the original question, and follow-up comments, there are a variety of contrib modules and manual methods to accomplish this. To do it automatically, or in a custom fashion, I think hook_update_N() is still probably the most viable option. For instance, this is an example from the Head 2 Head to update system.site to set the default_langcode:...


18

Method: Drush Drush can ignore the enabled states of extensions when synchronizing configuration. drush cex --skip-modules=devel drush cim --skip-modules=devel With Drush CMI tools you can operate with a list of configuration to ignore. drush cexy --ignore-list=/path/to/config-ignore.yml drush cimy --delete-list=/path/to/config-ignore.yml Method: ...


17

The Configuration Management only allow sync configuration between same site or project to avoid issues importing configuration from site a.com to b.com, to accomplish this validation Drupal 8 generate a UUID for each site. You cat get your current site UUID executing the following command: drush cget system.site The command above we will have a similar ...


14

You can use $ drush cim --partial --source=only-few-configs/ Your help says: $ drush cim --help Import config from a config directory. Examples: drush config-import --partial Import configuration; do not remove missing configuration. Arguments: label A config directory label (i.e. a key in $...


13

As others have mentioned, you must set the permissions on the /sites/default folder. The default permissions are set to 0555, set them to 0755 for editing. Don't forget to restore the default values afterwards!


13

I have migrated other CMS's to Drupal and had experience moving user accounts. Drupal's password algorithm is extremely good. The salt you are referring to in the settings.php is not used for passwords. The drupal_hash_salt salt is used for generation of things like cookies. Hence why it says you must keep it the same across all web servers if you are in ...


13

You can use the following methods. Use the following code in hook_uninstall Drupal::configFactory()->reset('field.storage.bloom_stem.bs_twitter_ac'); OR in the yml file you can put the dependencies like dependencies: module: - yourmodule enforced: module: - yourmodule then drupal will automatically remove this configurations on ...


13

Configuration management is exporting exactly what it was designed to do: Export the configuration settings. The actual taxonomy terms themselves are sitting in the taxonomy_term_field_data table in the database.


13

In Drupal 7 $data = variable_get('test_content_types'); In Drupal 8 $data = \Drupal::state()->get('test_content_types'); For more information about about "get", "set", "delete" visit - Step 5: How to upgrade D7 variables to D8's state system.


13

You can import one configuration by running the following command: drupal config:import:single If you are trying to run multiple import you can create a chain for that. Command Documentation - config:import:single


11

It's the same: The variable_set function saves the variable to database serializing it. variable_get takes the variable from $conf where the variable is already unserialized. Example: $var1 = array( 'key1' => 'value1', 'key2' => 'value2' ); variable_set('var1', $var1); print_r variable_get('var1'); Output Array ( [key1] => value1 [...


11

Cloned site means that you copied the database instead of installing twice from scratch. Drupal identifies two different sites as cloned sites by checking their uuid. If the uuids match, then it will assume that the sites are cloned instances. Faulty configuration imports can lead to broken sites which we may not be able to restore. Hence to avoid this ...


10

In the case of Windows 8, Acquia Dev Desktop 2 generates the settings file in this location: C:\Users\\[user]\\.acquia\DevDesktop\DrupalSettings\loc_Testing_local.inc


10

Variables are cached, so deleting manually is fine so long as you invalidate that cache, e.g. db_delete('variable') ->condition('name', 'mymodule_%', 'LIKE') ->execute(); cache_clear_all('variables', 'cache_bootstrap');


10

Yes and no. (I am not sure if this will be too technical). The configuration is stored in configuration objects. Drupal has by default an active and a staging storage for those configuration objects. The default active storage is in the database, yes, for performance and easier backup/restore, among other reasons. But that is an implementation detail. It ...


10

Using Drupal Console You can achieve the same with Drupal Console by overriding the system.site — uuid key. $ drupal config:override Then enter the configuration name system.site, the configuration key uuid and the appropriate value when prompted. Enter configuration name [advagg.settings]: > system.site Enter the configuration key [uuid]: > ...


10

You can use the "Config Ignore" module: https://www.drupal.org/project/config_ignore Ever experienced that your site's configuration was overridden by the configuration on the filesystem, when doing a drush cim? Not anymore! This module is a tool to let you keep the configuration you want, in place.


10

Updates must be run before configuration is imported A pending issue against core will ensure that the code and schema versions match before allowing configuration to be imported. Problems with config import before updates An update hook relying on a configuration value could end in a different result than if it were run on the pre-import value. An update ...


10

UPDATE You might also try Drupal Console's drupal config:export:content:type command. It's description says: The config:export:content:type command Export a specific content type and their fields. Content types and Fields are 2 separate configuration in Drupal 8, so if you want to export content type with fields you have to export all it's fields ...


10

You can create a new setting in your settings.local.php or settings.php file like: $settings['event_base_url'] = 'https://www.example.com'; or some people are adding switch block based on the server host, e.g.: switch (@$_SERVER['HTTP_HOST']) { default: case 'dev.example.com': $settings['event_base_url'] = 'http://dev.example.com'; break; ...


9

To elaborate on @dawehner's answers, default configuration is not cached. It is only imported when you install a module. After that, if you make changes to default configuration, the only way to add it to existing installations is to write an update function that adds it manually. During development, there are modules like Configuration development, that ...


9

Using the drupal console: $ drupal config:delete 'the_config_to_delete'


9

As I landed on this question as well but did not really find the correct answer for my situation here, I'd like to add another answer. Please note: Anti-pattern ahead! Use case When we're developing projects we constantly update our test / acceptance environment with new configuration updates. Take for example a simple fictional News-module, we'd like to ...


9

I've found this Gist on GitHub, which reverts/reloads given module's configuration using drush: drush cim -y --partial --source=modules/path/to/module/config/install/


Only top voted, non community-wiki answers of a minimum length are eligible