The last several projects I've worked on have all had some striking similarities. On each of these projects, we used features to export as much as we could into modules. We also built a simple install profile to enable these features at install time. Finally, we wrote an import for some (and in one case, ALL) of the existing content. These type of similarities are an instant sign that we could be doing a better job of building reusable some code. Since we are already using features to export most of the site setup, I started to wonder how we could export some of the site content in a similar way. After investigating, several import/export type modules, I was left wanting something as simple as features. I really wanted to use features to manage this content.
The uuid module is a simple, yet powerful piece of code. It provides a UUID for several common Drupal entities that normally rely on a serial ID for uniqueness. Using UUID to identify the content to export was the missing piece of the puzzle.
The uuid features module is an implementation of the features API for nodes, vocabularies, terms and files based on the UUID's generated by the uuid module. After setting up the uuid module to automatically create UUID's for certain node types, vocabularies and files, you will have the option to add these objects to your features.
uuid_node component
The uuid_node component is responsible for exporting nodes. It provides hooks to allow other modules to interact with nodes as they are being exported and before they are imported/rebuilt. This is how taxonomy and cck fields are able to add to the export. Currently, the uuid_node component supports taxonomy and most CCK fields, with special handling for nodereference and filefield fields. Nodereferences are handled recursively, so that the referenced node will also be exported. Filefields are handled by the uuid_file component, so the entire file object is managed by features. Taxonomy terms are handled by the uuid_term component.
uuid_term component
The uuid_term component represents a taxonomy term. When a term is added, the term's vocabulary will also be added to the feature using uuid_vocabulary.
uuid_vocabulary component
The uuid_vocabulary component is the simplest of the uuid components. It simply exports and syncs the database fields for vocabulary objects.
uuid_file component
The uuid_file component is simple, except for the actual file. Since features provides no mechanism to add arbitrary files to the downloaded tar file, this becomes a two-step process, and at least at the moment, requires drush. After exporting, downloading, unpacking and enabling the feature, run
drush uuid-features-update-files
to move the files into the module folder. This definitely needs much better documentation and some sort of warning.
And finally, a screenshot.

A really exciting development for features.
thanks Roger, great work!
I'm really curious why you decided to write this module given that Deploy already exists and does literally 95% of what you specified above, tested, running in multiple production environments worldwide at companies like The New York Times and Foreign Affairs magazine. Your architecture of dividing your components into divisions based on their core equivalents (node, taxonomy, files, etc) is even the exact same as Deploy's architecture. The only thing this module adds that deploy does not is it replaces Deploy's XMLRPC transfer layer with Features integration. A pluggable transfer layer would have made an awesome patch addition to Deploy, and would have been a welcome addition (it has actually been discussed in several places in the queue.) That you decided to go on your own and begin a whole new project is really frustrating and can only hurt the efforts to provide a serious content deployment and update system for Drupal.
- Greg Dunlap (heyrocker)
If you want to read more on heyrocker's comment, see the uuid_features issue tracker: http://drupal.org/node/887282
Thanks for developing this helpful module. I'm still troubleshooting content types with file fields but otherwise this tool works awesome. I really like featurizing webform nodes that I need to use for multiple projects.
Thanks again!
Post new comment