Importing and Exporting Rules

Starting with Drupal 8, Reaction Rules and Rules Components are imported and exported as configuration files in YML format.

Reactions Rules are named rules.reaction.<rule_machine_name>.yml
Rules Components are named rules.component.<rule_machine_name>.yml

To import or export these configurations, we use the Configuration manager module that is part of core Drupal. Go to /admin/modules on your site and enable "Configuration manager". After you have enabled this module, the user interface may be found at /admin/config/development/configuration. There will be three tabs on this page: "Synchronize", "Import", and "Export". We are concerned only with "Import" and "Export" here in this guide.

Importing

How to import a Rule from a configuration file

Exporting

How to export a Rule to a configuration file

Drush

The "drush" command is very useful when dealing with configuration files

Guide maintainers

TR's picture