2

It looks like I went a bit too overboard with number of features modules on my website (~50), but it really made initial development easy (for multiple people). Now the question is - what would be a safe procedure that would allow to merge them into less number of beefier features?

Is creating those new ones with "Allow conflicts to be added" option, and then disabling and UNINSTALLING the smaller ones safe? Should I firstly enable conflicting new modules? What is the order and procedures?

1 Answer 1

3

Sometimes the best way to merge/split features is to edit the module code directly. It's pretty straightforward where everything is laid out in a module created by Features. And it's a great way to start learning module development (if you're new to it). Just start at the *.info file - that's where Features describes all the various things it manages in the module. Then you can pretty easily find those things in the *.module file and other *.inc files. Just clone the whole module, rename it and all the files, search and replace all occurrences of the name in the code, then remove the stuff you don't want in each.

4
  • Ok, but at some point I will need to disable/uninstall old features - how to do this and not screw up anything in database ;) . Commented Sep 23, 2015 at 8:33
  • That's one of the beauties of Featues - it doesn't hold any information in the database. Everything is in code. So if you move the code around, it will just work. You will be able to go to the Features UI and see that none of them are overridden, and if you click into one you changed, you should see that the things you moved are no longer there. As longs as everything remains functionally the same, Features doesn't really care what module it's in.
    – m.stenta
    Commented Sep 24, 2015 at 12:53
  • Oooh, so features even after uninstalling doesn't remove anything from database? I though otherwise because some modules are using features... but that would mean that module that is using features cannot be properly uninstalled? Commented Sep 24, 2015 at 14:43
  • If you uninstall a Feature, and that Feature is managing some configruations - those configurations might be deleted from the database when you install the Feature (this probably varies depending on the type of configuration, though I'm not 100% sure). BUT: if you move all of the code for certain configurations from Feature A to Feature B, and then uninstall Feature A nothing will be deleted from the database - because it is managed by Feature B.
    – m.stenta
    Commented Sep 25, 2015 at 1:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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