Moving forum posts to stories in Drupal

I feels Slashdot-like stories in Drupal are very similiar as posts in oldie discussion board (aka forum). The only big difference between story and forum are discussion grouping, old-style forum are grouped topics into hierarchy style, but story with taxonomy provides free tagging.

So I decided to move forum posts in to stories, and disabled the forum function 2 weeks ago.

Forum and Taxonomy

Taxonomy module is required for forum operation in Drupal. So firstly, we look at how taxonomy module works in Drupal.

Table *_term_data got few fields. tid, vid and name are important fields which represents each terms in taxonomy, vocabulary type (forum/…) id, and name of terms.

Table *_term_hierarchy got 2 fields – tid and parent, which are term id and parent term id for a many-to-one hierarchy relationship of taxonomy terms and their parent terms.

Table *_term_node got 2 fields – nid and tid, which are node id and term id for many-to-many relationship of nodes and taxonomy terms.

So, I should move forum related taxonomy terms to normal one, or simply remove them. But I think old forum name were not good tags for stories, number of posts in forum are few, so I removed them in database and added much suitable tags to them myself.

Changing node types

I run the following SQL to change the node type of all forum contents, and promote them to front page,

update node set type=’story’ and promote=1 where type=’forum’