Question

I want to create a Drupal 8 profile installer with a config export, to export regulary my config to push data modifications in git.

I tried this tutorial: https://www.valuebound.com/resources/blog/how-to-create-installation-profile-in-Drupal8 but it dont worked. And i exported the configuration with drupal config:export –remove-uuid --remove-config-hash

Was it helpful?

Solution

1) learn about drush cex (drush config-export)

and Sync

https://www.drupal.org/docs/8/configuration-management/changing-the-storage-location-of-the-sync-directory

2) when you make config changes run drush cex then commit the changes.

3) on live when updated form git you need to run drush cmi (which imports the config)

4) stuff to watch out for you want to make sure your site uuids match: aka

drush cget system.site uuid (gets uuid) 
drush cset system.site uuid (sets uuid) 

5) if still stuck read How can I import the configuration on a different site?

OTHER TIPS

Welcome to the community. I'll do my best to try and help here - You may want to look into Features - https://www.drupal.org/project/features. At this time, it's actually a really easy way to bundle functionality into an install profile in the form of modules. All the UUIDs are stripped out, and you can package up your functionality into discrete modules. Once "out in the wild", you'll have to consider that sites may modify the configuration, so any updates you provide will have the caveat that users manually reconcile the changes if they've started using configuration management on their site. If they haven't they can use features_revert and "update" the config to match whatever changes you shipped in the "Features module".

It's certainly not perfect, but given current options, it's workable for a distribution, or in many cases an install profile. As the Features project page puts it, "Most Drupal 8 sites should not need Features", but they go on to say "If you are building a Distribution you can still use Features to export specific configuration into your profile or modules."

Hopefully, we'll have some great improvements to this system with "CMI 2.0" - https://www.drupal.org/project/cmi2

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top