5

The Drupal 8 documentation seems to be lacking in regards to the core.extension.yml file, so I'm a little confused on the right way of updating it.

  1. Should drush be populating it on config export, or are you supposed to manually update it?

  2. Do I need to move it from core to my config/sync folder, or leave it in core?

My file's contents are this, even though I have a handful of modules enabled on the site and have exported my config numerous times:

module: {}
theme: {}
profile: ''

On the site I am exporting from (site a) I am using composer to download modules and drush en to enable them, then drush cex to export the configuration to my sync folder. When I copy the sync folder contents over site b and import via drush cim I run into errors that the modules are not installed / enabled. Manually enabling each module then re-importing was successful.

Both sites are 8.3.7.

  • 1
    I'm going to mark Adrian's answer below as correct with the following clarification in case it helps anyone else who finds this. I didn't realize that the drush export created a copy of core.extension.yml inside the sync folder. This keeps everything separate from the copy in Drupal core and allows it to be bundled and moved with the other exported yml files. I also realized that I was forgetting to run composer update on site b to download and install the modules. They didn't exist, so the import couldn't enable them. Running composer first before the import made everything work. – tomster2300 Sep 27 '17 at 6:06
1

I think that the problem comes from where you have the config files, to be sure that they are really in the config/sync folder go to check if you have this following line in the settings.php file:

$config_directories = array(CONFIG_SYNC_DIRECTORY => 'config/sync');

Keep in mind that this line will have the location of the site configuration files.

Each time you use the drush cex or drush cex sync command the core.extension.yml file will be updated (if needed) with the actual modules (and others) configuration.

  • at project-root/web/sites/default/settings.php I have the following: $config_directories['sync'] = '../config/sync'; I am basing my install off of github.com/drupal-composer/drupal-project so my /web folder is my docroot. – tomster2300 Sep 21 '17 at 19:08
  • @tomster2300 use $config_directories = array(CONFIG_SYNC_DIRECTORY => 'config/sync'); and your sync directory will be inside the drupal directory where usually is placed. – Adrian Cid Almaguer Sep 21 '17 at 19:12
  • 1
    @tomster2300 I don't know maybe you want to use the ../config/sync location – Adrian Cid Almaguer Sep 21 '17 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.