Is there any easy way to reassign/convert the type of a node? For example, I have some book page nodes that i'd rather have as story nodes.

Thanks...

Comments

trailerparkopera’s picture

when I found out the weblinks module didn't work with the simple access module. Basically, I had to export the data that made up the weblinks nodes (3 tables, nodes, a join table, and a weblink table), then reformat data in the node table (I used Filemaker cause it's fast for me, but could have used SQL or Perl if I had felt masochistic), then dumped the resulting node data back into the nodes table.

I haven't seen how books are implemented yet, but suspect you'd have to do a similar thing.

Oh...I used PHPMyAdmin to dump the data to my local machine, played with it in Filemaker, then uploaded it back with PHPMyAdmin. Made a few mistakes: luckily, I made copies of all the tables before starting anything.

pwolanin’s picture

I'd imagined the process you described as a technique of last resort. Since I'm only thinking of a few nodes at a time, copy and pasting the content would be less error-prone than playing directly with the tables.

I wonder if the forthcoming CCK module will make this easier? For the core types, it seems like at least story<->page<->book conversions ought to be relatively easy to do via a module.

---
Work: BioRAFT

yourhiro’s picture

Going from a book node to story node is possible, but not the other way around. Basically "downgrading"(to a node with equal or less data) a node can be done manually but not easily the other way around.

Before you do this though, I don't know how the book nodes interact with each other so if any relations already exist with the node you're changing and other nodes, it could screw it up so do so at your own risk.

In phpMyAdmin, find the row with the nid of the node you want to change in the node table and change the type column from "book" to "page". You will also need to do some clean-up and go into the book table and delete the corresponding row with the same nid.

In command line, you can make the change with: UPDATE node SET type = 'page' WHERE nid = [NODE ID]; while of course changing [NODE ID] to the node you're trying to convert.
To delete from the book table: DELETE FROM book WHERE nid = [NODE ID];