This module allows to convert one or many nodes between different node types. It can transfer most fields, and node-specific options for book and forum types. Support of more basic types will be in future releases. Also the module provides an API for converting nodes and fields, hooks for processing additional options of custom node types, integrates with hook_node_operations and Drupal's Action API.
I. Single node conversion:
- Go to permissions page and set 'administer conversion' and 'convert to x', 'convert from y' permissions.
- Go to /node/x/convert and follow the provided steps to convert the node.
II. Multiple node conversion (using hook_node_operations):
- Set appropriate permissions.
- Go to Node Convert templates.
- Create a new template following the the provided steps.
- Go to the content page.
- Select the correct nodes.
- Choose "Convert template: x" (based on the template name created above) from the update options.
- Click Update.
III. Multiple node conversion (using Actions API + Views Bulk Operations):
Note: This requires the contributed modules Views and Views Bulk Operations
- Set appropriate permissions.
- Go to Node Convert templates.
- Create a new template following the the provided steps (also check Create Action).
- Create a new view with the options you require.
- Select Views Bulk Operations as the style.
- Configure all options as necessary
- Select as an operation one of the convert templates.
Note: Most probably there will be duplicates of the same template, this is because VBO uses both Actions API and hook_node_operations to show possible operations - Save the view. View it.
- Select the necessary nodes and click the Convert x button.
Useful API calls:
node_convert_node_convert($nid, $dest_node_type, $source_fields, $dest_fields, $no_fields_flag, $hook_options = NULL);
node_convert_field_convert($nid, $source_field, $dest_field);
hook_node_convert_change($data, $op);