1

Scenario: I have a website which was initially developed with a single site (A) in mind. Now, because reasons, I need to make this a multi-site setup (A & B). So, I have functionality in A I want to share with B. We built A with all config exported to it's config sync folder, which means all config is intertwined.

Problem: How would I go about converting all sharable configuration to modules, which would allow me to maintain the modules from one codebase in both A & B? Putting everything into module_foobar/config/install/ will not work that easily for A, since it already has that config in it's active config.

1

Use Features: It basically does exactly what you want, it turns your existing configuration into a module_foobar/config/install/

Be aware though that Features merges config (it does add and update existing config, but it does not remove/delete unused config like core configuration management).

  • I've been trying to keep our workflow as light as possible. We've used Features as a necessary evil in Drupal 7 and would preferably avoid using Features. – Ambidex May 15 '17 at 10:53
  • 2
    I've never used Features in D7, but from what I've read it's working completely different (and way better) than in 7. In 8 you don't even need Features on the target site, it is only required on the source site and generates stand-alone modules with config. It now uses the API from core configuration management, I really think you should give it a second chance ;-) – Hudri May 15 '17 at 11:12
  • Thanks, I've read the same notes; Features is completely different in D8. But you've now convinced me to give it another chance. I'll be back with conclusions. Thanks ;-) – Ambidex May 15 '17 at 11:21
  • Been fiddling with Features for hours now. It does look great, but still cannot get it to work since it creates config which creates a lot of ... already exist in active configuration errors on a new installation. One, big, drama... – Ambidex May 15 '17 at 14:24
  • After a few days of research, I think you're right; features is the way to go and make modules reusable. Though, I'm still having major dependency issues. That might be a different issue, therefor I have created a new question: drupal.stackexchange.com/questions/236449/… – Ambidex May 18 '17 at 11:28

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.