I thought I'd ask here as the answer could be useful to others.
I'm building a site with config being managed by this module. What is the correct/best way to sync config during an install?
It needs to be at a particular point, because other install tasks require the vocabularies/content types etc. that are created.
I've currently used drush to trigger a sync:
drush_invoke_process('@self', 'csyn', array());
However, this is leaving some components overridden (mainly the Search API components, which are just Entity API parts). It also means the profile has to be installed by drush.
The content needs to be synced rather than migrated, as once the project is live I'll be looking to re-sync using update hooks.
Any advice would be greatly appreciated.
Cheers
Comments
Comment #1
Mark F CreditAttribution: Mark F as a volunteer commentedIf I use drush_invoke_process('@self', 'csyn', array()); and install a site using my custom installation profile I get some errors, namely:
I tried
this gave the same errors but I'm a complete novice at writing code. Any ideas anyone?
Comment #2
GDrupal CreditAttribution: GDrupal commentedYou can check configuration_import_directory() we were using it on install task on profiles with success. Cheers!
Comment #3
Mark F CreditAttribution: Mark F as a volunteer commentedBravo GDrupal - that information plus finding this snippet provided the answer. Thanks
Comment #4
Mark F CreditAttribution: Mark F as a volunteer commentedQuick note in case anyone else battles with this - this method will only work when the configuration has been exported. It will fail if you try to import the set of files generated while tracking. The error complaining that the file configurations.inc could not be found is the giveaway.
Comment #5
GDrupal CreditAttribution: GDrupal commentedCool that you found that snippet! I totally forgot it... :)