CCK Import/Export

Events happening in the community are now at Drupal community events on www.drupal.org.
karens's picture

I've put together a module for CCK 5.x to import/export content type, group, and field definitions. You can import a complete package of a content type with its group and field definitions into a new installation, or export selected field and/or group definitions from one content type and import them into another. Similar to the Views import/export function, you select the type, fields, and groups you want to export and it creates text you can copy and paste into an import text box as an import. It's built using the new drupal_execute() function which just chugs along and submits all the necessary forms, creating a macro in the export and playing it back in the import.

The drupal_execute() is pretty simple and works great. Most of the complexity is doing things like making sure all the right modules are enabled, checking for duplicate fieldnames, and figuring how to patch CCK to work better with programmatic submissions.

This was only possible because of the work done by Eaton, chx, Adrian and everyone else who got FAPI2 working, along with a lot of ideas generated from moshe's macro module on how to record macros that could be played back elsewhere, so I owe all you guys big time!!

Anyway, the import/export module is at http://drupal.org/node/99446 and it requires a patch to CCK at http://drupal.org/node/105270. Both the module and the patch need reviews by anyone who has time and is interested in seeing this move forward.

Comments

Import export and modules

Egon Bianchet's picture

The module was eventually committed ... Thanks for the great work!

Is it already possible to embed content types into modules like Views does?

You're talking about the

karens's picture

You're talking about the default views that modules can create? This would be the next step and it should be possible. I yet tried to see what, if anything, needs to be altered to get this behavior working completely.

Is this functioning for vers. 6.14 and cck-6.x-2.5

tinem's picture

Sorry if I have posted the wrong place I'm fairly new to Drupal.

I have tried to export/import content types/cck fields but it didn't functioning. Is there something that I should be aware of getting this to functioning, please?

It does import OK but the info is not in only ONE table as it was in the Content type I copied from. It makes several tables for each field. Is this how it should be?

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: