Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.501
diff -u -r1.501 system.install
--- modules/system/system.install	27 Aug 2010 11:59:51 -0000	1.501
+++ modules/system/system.install	27 Aug 2010 16:38:37 -0000
@@ -2777,6 +2781,7 @@
       // Create the field. Save the field id for the data insertion later on.
       $field = field_create_field($field);
       $sandbox['field_id'] = $field['id'];
+      $sandbox['table_name'] = _field_sql_storage_tablename($field);
 
       // Create the instances.
       foreach ($context['types'] as $bundle) {
@@ -2862,7 +2867,28 @@
 
     // Insert the revision's files into the field_upload table.
     $node = (object) $revision;
-    field_sql_storage_field_storage_write('node', $node, FIELD_STORAGE_INSERT, array($sandbox['field_id']));
+
+    // If there is already a node inserted use the update constant.
+    // Therefore check whether the etid is stored already.
+    $entity_id = $node->nid;
+    $etid = variable_get('field_sql_storage_node_etid', NULL);
+    $exists = (bool) db_select($sandbox['table_name'], 'f')
+      ->fields('f')
+      ->condition('etid', $etid)
+      ->condition('entity_id', $entity_id)
+      ->range(0, 1)
+      ->execute()
+      ->fetchField();
+    if ($exists) {
+      $mode = FIELD_STORAGE_UPDATE;
+    }
+    else {
+      $mode = FIELD_STORAGE_INSERT;
+    }
+
+    field_sql_storage_field_storage_write('node', $node, $mode, array($sandbox['field_id']));
+    // Store the nodes which was converted already.
+    $sandbox['nids'][$node->nid] = $node->nid;
 
     // Update our progress information for the batch update.
     $sandbox['progress']++;
