[Drupal 8] use sed (on OSX) to strip the uuid line from exported config files being used for module default configuration; i.e. [module_name]/config/optional|install
NOTE: this can also by bypassed in the export by using Drupal Cnnsole and including the --remove-uuid
flag. Also using the --remove-config-hash
flag can help prevent additional headaches.
Ex:
drupal config:export --directory=”[full-path-to-location]” --tar --remove-uuid --remove-config-hash
The UUID should never be included when using when using these exported config yaml files as the default configuration pagaged with a custom module. This is suppoedly not to be a thing in the exported yaml files at some point, but until then stripping the uuid line out is a manual process which can be a pain as there can be a lot of files.
To automate this, run the following sed command in the directory containing the yaml files:
sed -i.bak '/^uuid: /d' ./*
The i.bak
arg will create a backup of the affected file. When satistifed with the results, you can safely get rid of the .bak files:
rm *.bak
References:
I would not recommend removing the UUID. That would prevent your module from been able to manage / update its own resources.
See: https://www.drupal.org/project/config_split/issues/2967961