Exporting, reverting, disabling and enabling any exportable with ctools and drush

With the newest release of ctools, a new command was made available for drush to export all objects to code with one simple command to a module. Instead of having to copy and paste all code via the bulk export module to your custom module, a simple drush command now saves you a lot of time. But it doesn't stop there. Damian 'damiankloip' Lee started a sandbox to add more powerful funtionality and this has now been merged in the 7.x branch which will be available in the (soon) next release of ctools. An initial patch to select the exportables by hand has also been committed, but could need some more love on the UX side. Apart from that, the goodies that are in already, should make any developer extremely happy and opens up new possibilities in so many ways. So what commands can you use now and what do they do ?

  • drush ctools-export-disable: disable one or more exportables
  • drush ctools-export-enable: enable one or more exportables
  • drush ctools-export-revert: revert one or more exportables
  • drush ctools-export-info: get an overview of all possible exportables
  • drush ctools-export-view: view one or more exportables
  • drush ctools-export: export all exportables to a module

Excited yet ? We are, so we made a screencast, we're pretty sure you'll love it. Damian and I are planning more things for the future, so anyone who wants to help can post issues to the sandbox. Once they're done, we can commit these easily now Damian has access. Let's make ctools drush extremely powerful!


Sven on Sat, 24/03/2012 - 19:10

With this command, I wonder why one would still use the features UI or features drush commands. Can you explain the difference? I presume that features is built on ctools export, but now that ctools has these commands, what does features offer extra?

swentel on Sat, 24/03/2012 - 19:19

Well, features has the ability to also export not ctools exportables like menu(links) and a couple of others that I currently don't remember on top off my head. My goal is either to work on support for those other configurations directly via ctools or via contrib module, that's something that we'll be working on the next couple of weeks.

BarisW on Sun, 25/03/2012 - 00:35

See http://bariswanschers.com/blog/exporting-your-module-configuration-usin…

In my blog I describe two reasons when it's better to write custom feature hooks instead of using ctools exportables.

Another reason to still use the Features interface is when you need to new configurations to an existing feature; eg a new View or new strong arm variable.

Add reply

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Have you written a response to this? Let me know the URL by sending a webmention.