Index: migrate_2.php
===================================================================
--- migrate_2.php	(revision 794)
+++ migrate_2.php	(working copy)
@@ -432,6 +432,7 @@
     $user->uid = $previous_uid;
 
     $map_postid_nodeid[$post['ID']] = $node->nid;
+    $map_postid_vid[$post['ID']] = $node->vid;
 
     _wp2d_add_row('ok', 'Post <em>'. $node->title .'</em> was sucessfully migrated.');
 
@@ -559,14 +560,14 @@
     // Verify that this post or page was transferred.
     // Some WP content types are skipped, e.g. attachments, revisions
     if (array_key_exists($binding['object_id'], $map_postid_nodeid)) {
-      db_query($query, $map_postid_nodeid[$binding['object_id']], $map_postid_nodeid[$binding['object_id']], $map_catid_termid[$binding['term_taxonomy_id']]);
+      db_query($query, $map_postid_nodeid[$binding['object_id']], $map_postid_vid[$binding['object_id']], $map_catid_termid[$binding['term_taxonomy_id']]);
     }
   }
   foreach ($wp['post2term'] as $binding) {
     // Verify that this post or page was transferred.
     // Some WP content types are skipped, e.g. attachments, revisions
     if (array_key_exists($binding['object_id'], $map_postid_nodeid)) {
-      db_query($query, $map_postid_nodeid[$binding['object_id']], $map_postid_nodeid[$binding['object_id']], $map_catid_termid[$binding['term_taxonomy_id']]);
+      db_query($query, $map_postid_nodeid[$binding['object_id']], $map_postid_vid[$binding['object_id']], $map_catid_termid[$binding['term_taxonomy_id']]);
     }
   }
   _wp2d_add_row('ok', 'Nodes were sucessfully assigned to taxonomy terms according to Wordpress posts-to-category mappings.');
