0

I've inherited a Drupal 8 site but it has no config_HASH folder with it which means that the majority of admin paths throw an exception.

How do I generate a new configuration folder based on the current site?

  • Open your settings.php file and at the end there is the 'sync' variable. Create that directory in your files directory and use drush to clear cache. Although if that site is some old version of Drupal where the config was still presen on the file system and not in the database then I guess you will have to dump the active config from db table and parse it into yml files manually. – user21641 Oct 25 '15 at 18:47
  • What version of Drupal 8 do you use? What is set for $config_directories in settings.php? (grep config_directories settings.php) – 4k4 Oct 26 '15 at 7:40
0

To generate a new config folder do the following:

In settings.php add the following line:

$config_directories['sync'] = 'dest/to/config-sync';

This is relative to your docroot or index.php file. My permission were set in a way that drupal could create this directory but you may have to create your own. Next you will want to populate your sync directory with active config. Run

drush cex -y

Now your active config can be version controlled and deployed to your other environments. Remember to make a database backup first before importing config.

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.