Hi,
I am in process of migrating data from legacy database to Drupal7. I have created a content type (via CCK) with only one field 'title' (I removed the 'body' which is there by default). So basically my nodes will contain only a single string - the title.
I have written a script which will create a node for my new one field content type for any entry in my legacy database. What the script does for each entry is:
- Get the biggest nid in 'node' table (nextId).
- Get the biggest vid in 'node' table (nextId).
- Compare both and use the bigger value as a start point of nid incrementation - GEN_ID
- Insert a row in 'node' table:
INSERT INTO node VALUES (<GEN_ID>,<GEN_ID>,'person','und', <TITLE_VAL>, 1, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 2, 1, 0, 0, 0);
- Insert a row in 'node_comment_statistics' table:
INSERT INTO node_comment_statistics VALUES ( <GEN_ID>, 0, UNIX_TIMESTAMP(), NULL, 1, 0);
- Insert a row in 'node_revision' table:
INSERT INTO node_revision VALUES ( <GEN_ID>, <GEN_ID>, 1, <TITLE_VAL>, '', UNIX_TIMESTAMP(), 1, 2, 1, 0);