How to copy content type in Drupal 7 ?
I can't find a button to duplicate content type.
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
If you mean export by duplicate use the Features module.
The features module enables the capture and management of features in Drupal. A feature is a collection of Drupal entities which taken together satisfy a certain use-case.
Features provides a UI and API for taking different site building components from modules with exportables and bundling them together in a single feature module. A feature module is like any other Drupal module except that it declares its components (e.g. views, contexts, CCK fields, etc.) in its .info file so that it can be checked, updated, or reverted programmatically.
Maybe too late you can use the Bundle Copy module:
Bundle copy is a replacement for the Content copy module which lives in the CCK project for Drupal 6. Has export/import support for: Node types, Taxonomy, User, Field API fields, Field groups
UPDATE 7.x-2.x-dev notes
The following features have been added:
Drupal 8: Bundle Copy is in Drupal 8 Core CMI.
I used the Field tools module, and it worked flawlessly.
All I did was create my second content type, used this module functionality to clone all the fields to the new content type, then uninstalled the module. Bundle copy and Features seem like ridiculous ways to duplicate a content type, this was super simple and exactly what I wanted.
Clone Fieldstab up top, select the fields to copy, the node to copy them to, and you're done. May 29, 2013 at 17:26
Clone fields to this bundle, select fields from an existing node content type,
Add field instances.
The easiest way is to use Bundle Copy - the 7.2 version which is in development but worked perfectly for me.
After installing the module, go to your "content types" page and click on the new "clone" tab.
Under "Source Bundle", select the content type you want to clone.
In "New Bundle Name", enter the name of the new content type you want to create. Click on "clone" and you'll now see that new content type in your list.
Field Tools also does the job but it's not as straight forward.
I found the (relatively new) Bundle Inherit module to be a very easy way of doing this. Be sure to enable the "Bundle Inheritance Node" (bundle_inherit_node) module in addition to the bundle_inherit module, then you'll get a new "Inheritance" tab when creating new content types.
(It also gives you a choice between "soft inherit" and "strict inherit"...as far as I can gather, "soft inherit" simply does a one-time copy of the fields whereas "strict inherit" keeps track of the inheritance hierarchy.)
Just for the history, there is one more module that can handle this.
Otherwise, Content Type Clone allows you to do it quickly and simply, without having to look at PHP code or perform complex manipulations:
It's a sandbox project at the moment, but it will soon be available as an official Drupal module.
Edit: The official release of Content Type Clone for Drupal 7 is here! https://www.drupal.org/project/content_type_clone Drupal 8 version coming soon.