Score:2

How to automize the config export to a custom distribution

kp flag

We use a custom Drupal distribution on our websites. There are also our custom modules in the distribution. The modules contain configurations.

When I change some configurations in Drupal Administration and export them with drush cex, they are updated only at the config/sync folder, but not in the distribution. I have to find the configs, copy them to the custom distribution modules and delete uuid and _core.

Is there some way, how to automize the config export to the distribution?

leymannx avatar
ne flag
Don't you just manually need to copy them into the right place and remove the config UUID? I guess it's hard to automate that as there would need to be a way that this automation-mechanism needs to know beforehand where the original distro config came from (spread across multiple custom modules probably), but I'd like to be proven wrong.
kp flag
It is not so easy, when you have to update many configs in multiple custom distribution modules. If no automation exists, then I will write a shell script or a drush command. Till now, I have found nothing, what I could use.
ru flag
I also had this problem. I stopped using custom profiles at all, and instead use a workflow based on the minimal profile with `drush site:install --existing-config` to save the work of manually updating the profile.
Geat avatar
de flag
It looks like I came to the exactly the same conclusion as you, Antonin. We maintain a perfectly-configured base Drupal installation, and every time it changes I run a "sync config" script that uses bash and Drush to export the config, copy it to the profile, and remove the UUIDs and _core from all files.
kp flag
Hi @Geat is the "sync config" script publically available?
Geat avatar
de flag
It's not, @AntonínSlejška - but it's not too complicated. I export the config with `drush` (config:export), copy the exported files to the /config/install folder of the profile, remove "core.extension.yml" and "update.settings.yml", then use `sed` to remove the uuid and core entries.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.