Drupal: Switching Content Types the Easy Way
One thing that I've had to do every now and then is switch a node between one content type (for instance, 'story'), and another (a new content type 'blog post').
I used to go into the database via PHPMyAdmin, and change the nodes in the node table, but that was getting quite tedious, and would take forever for a list of a hundred or thousands of nodes!
Instead, I wrote up a nice little script that you can paste directly into the 'Execute PHP' block provided by the excellent Devel module:
<?php return; // Paste the following into the ‘Execute PHP’ Devel page to update nodes to a certain content type.
// Put a comma-separated list of all the nids you’d like to change in this array $nodes_to_switch = array(7402, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7428, 7429, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7435, 7436, 7437, 7438, 7438, 7441, 7442, 37143, 37144);
// This function will update all the nodes in the node table to the proper type
// You will need to change the type = ‘