Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Module Monday: Bundle Copy

Parent Feed: 

Back in the olden days of Drupal 5 and 6, the venerable CCK module came with a useful add-on: Content Copy. While it had rough edges, Content Copy allowed you to export a given content type and all of its custom fields into a snippet of PHP. The same module could be used to import that snippet of PHP code on another site and re-create the content type, with all of its settings and custom fields.

Sadly, that feature didn't make the cut when the CCK module became Drupal 7's built-in FieldAPI. While the Features modules has eclipsed Content Copy for serious site deployment, sometimes it would be handy to have the same easy "Export, save, and reuse later" option in Drupal 7. Enter Bundle Copy, the successor to Content Copy.

Screenshot of the Bundle Copy export screen

Like is ancestor, Bundle Copy is pretty straightforward: visit Content Types administration page and click the Export tab, then choose the content types you want to export. Pick the individual fields, submit the form, and voila -- a pile of PHP that can be saved to a text file, and re-imported to another site running Bundle Copy. The module also supports the new entity types that ship with Drupal 7: Users and Taxonomy Terms. If you've heavily customized user profiles with Drupal 7's FieldAPI, it's a quick and easy way to share the tweaks.

Screenshot of the Bundle Copy import screen

Although the Features module is a great solution for full-fledged deployment of Drupal configuration, it carries its own list of module dependencies. If you're simply trying to share some quick tweaks to a content type with a friend, or you'd like to move a content type from one of your sites to another without the overhead of a dedicated Feature module, Bundle Copy is worth checking out.

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web