A short handnote to sync configuration between different environments like local, dev, staging or production using Drupal and Drush commands.
To export using drupal command
./vendor/bin/drupal config:export:entity \
paragraphs_type [MACHINE_NAME_OF_PARAGRAPH_TYPE] \
--module="[YOUR_MODULE]" \
--optional-config \
--remove-uuid \
--remove-config-hash \
--include-module-dependenciesSample
./vendor/bin/drupal config:export:entity \
paragraphs_type machine_name_of_paragraph \
--module="$MODULE_NAME" \
--optional-config \
--remove-uuid \
--remove-config-hash \
--include-module-dependenciesTo import using drush command
./vendor/bin/drush cim --partial \
--source=$PATH_OF_THE_CONFIG_DIRECTORYSample
./vendor/bin/drush cim --partial \
--source=$PWD/web/modules/custom/$MODULE_NAME/config/optional/Similarly, content_type or paragraphs_type can be export with updating the below flag in the above command.
| Entity Type | Command Type |
|---|---|
content_type |
node_type |
paragraphs_type |
paragraphs_type |
taxonomy. Or the others I didn't try.