This project is not covered by Drupal’s security advisory policy.

Adds more functionality to the CTools drush bulk export commands.

drush ctex modulename will export all known ctools exportables of a site to a module. But there are also other configurations you'd like to have in code. This project fills in that gap with extra configuration and drush commands.

To install it just drush dl drush_ctex_bonus in your .drush folder, or - even better - in a system-wide drush commands folder.

If you want additional configuration, please create an issue with a patch or you can also implement hook_drush_ctex_files_alter, which is invoked in the main CTools' drush export command.


  • Exports content types to
  • Exports vocabularies to
  • Exports fields and instances to
  • Exports filter formats to
  • Exports wysiwyg profiles to
  • Exports aliases to
  • Exports date formats to
  • Exports languages to
  • Exports menus to
  • Exports blocks to
  • Exports workbench moderation to
  • Exports nodequeues to
  • Exports variables to
  • Exports roles and permissions to
  • Exports any entity exportable (includes rules and others) to the .module file in the right hook.
  • Exports image styles to modulename.module in modulename_hook_image_default_styles().
  • Exports dependencies and files info to You can manually edit this file to add/remove dependencies or indicate which files you don't want to overwrite again when doing a new export.


  • drush cbum modulename: Uber master command which performs following things when trying to enable an export module. It won't do anything if the module is enabled.
    1. Check if any i18n modules need to be enabled - due to #1681414: Enabling i18n modules fail in install profile - might be removed in case this bug fixed one day.
    2. Enable the exported module
    3. Run all commands underneath
    4. Clear the cache
  • drush cbrm modulename: master command to select one or all actions underneath which have a key 'ctex run all' set to TRUE.
  • drush cbcd modulename: compare dependencies of the module with the current enabled modules on the site. It will print out the drush command to disable all those modules afterwards.
  • drush cbcdb modulename: compare database configuration with code. If a configuration is not in code, you have to option to delete them one by one. Support for content types, fields, variables, vocabularies, languages and nodequeues. More will be added if they prove to be necessary.
  • drush cbsa modulename: save all CTools, entity exportables and image styles to the database. This allows you to disable the module after all other configuration has been saved. Note that it's safer to clone existing default objects first so you don't revert by accident after disabling.
  • drush cbrv modulename: (re)build all vocabularies.
  • drush cbrf modulename: (re)build all fields and instances.
  • drush cbrl modulename: (re)build all languages.
  • drush cbrb modulename: (re)build all blocks.
  • drush cbrp modulename: (re)build all roles and permissions.
  • drush cbrw modulename: (re)build all wysiwyg profiles.
  • drush cbra modulename: (re)build all aliases.
  • drush cbrn modulename: (re)build all nodequeues.
  • drush cbrs modulename: (re)build all image styles.
  • drush cbrme modulename: (re)build all menus.
  • drush cbrdf modulename: (re)build all date formats.
  • drush cbrwm modulename: (re)build all workbench moderation settings.
  • drush cbrct modulename: (re)build all content types.
  • drush cbrvv modulename: (re)build all variables.
  • drush cbrff modulename: (re)build all filter formats.
  • drush cbrea modulename: revert all entity api exportables.

Using the action master command (cbrm) is the easiest command to get an overview of all options that this project offers. It also takes an automatic backup of your database if you select the 'All' option. When selecting an individual command, you will be asked for confirmation.


Before every command starts to run, it will ask if you want to take a backup of your database, except for the cbum and the 'All' option in the cbrm command which do this automatically. As with the sql-dump command, you can also use the --result-file option to override the default backup directory.

Logging of actions

Besides being printed to the screen, al messages are also logged to 2 logfiles: ctex.log and ctex-error.log. By default, the directory is going to be something like ~/drush-ctex-logs/db_name/. This can be overridden by setting the 'ctex-log-location' option.

Project information

  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Module categories: Drush, Import/Export, Utility
  • chart icon2,795 downloads
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.