diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php
index 3535b00..318b928 100644
--- a/core/modules/field/field.api.php
+++ b/core/modules/field/field.api.php
@@ -589,7 +589,7 @@ function hook_field_storage_update_field($field, $prior_field) {
 function hook_field_delete(\Drupal\Core\Entity\EntityInterface $entity, $field, $instance, $langcode, &$items) {
   // Delete all file usages within this entity.
   foreach ($items as $delta => $item) {
-    file_usage()->delete(file_load($item['fid']), 'file', $entity->entityType(), $entity->id(), 0);
+    file_usage()->delete(file_load($item['target_id']), 'file', $entity->entityType(), $entity->id(), 0);
   }
 }
 
@@ -614,7 +614,7 @@ function hook_field_delete(\Drupal\Core\Entity\EntityInterface $entity, $field,
 function hook_field_delete_revision(\Drupal\Core\Entity\EntityInterface $entity, $field, $instance, $langcode, &$items) {
   foreach ($items as $delta => $item) {
     // Decrement the file usage count by 1.
-    file_usage()->delete(file_load($item['fid']), 'file', $entity->entityType(), $entity->id());
+    file_usage()->delete(file_load($item['target_id']), 'file', $entity->entityType(), $entity->id());
   }
 }
 
diff --git a/core/modules/file/file.api.php b/core/modules/file/file.api.php
index 49d9af8..c713214 100644
--- a/core/modules/file/file.api.php
+++ b/core/modules/file/file.api.php
@@ -38,7 +38,7 @@ function hook_file_load($files) {
   $result = db_query('SELECT * FROM {upload} u WHERE u.fid IN (:fids)', array(':fids' => array_keys($files)))->fetchAll(PDO::FETCH_ASSOC);
   foreach ($result as $record) {
     foreach ($record as $key => $value) {
-      $files[$record['fid']]->$key = $value;
+      $files[$record['target_id']]->$key = $value;
     }
   }
 }
diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index 9a327c9..f475805 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -194,9 +194,9 @@ function file_field_prepare_view($entity_type, $entities, $field, $instances, $l
       if (!file_field_displayed($item, $field)) {
         unset($items[$id][$delta]);
       }
-      elseif (!empty($item['fid'])) {
+      elseif (!empty($item['target_id'])) {
         // Load the files from the files table.
-        $fids[] = $item['fid'];
+        $fids[] = $item['target_id'];
       }
     }
     // Ensure consecutive deltas.
@@ -207,11 +207,11 @@ function file_field_prepare_view($entity_type, $entities, $field, $instances, $l
   foreach ($entities as $id => $entity) {
     foreach ($items[$id] as $delta => $item) {
       // If the file does not exist, mark the entire item as empty.
-      if (empty($item['fid']) || !isset($files[$item['fid']])) {
+      if (empty($item['target_id']) || !isset($files[$item['target_id']])) {
         $items[$id][$delta] = NULL;
       }
       else {
-        $items[$id][$delta]['entity'] = $files[$item['fid']];
+        $items[$id][$delta]['entity'] = $files[$item['target_id']];
       }
     }
   }
@@ -223,7 +223,7 @@ function file_field_prepare_view($entity_type, $entities, $field, $instances, $l
 function file_field_insert(EntityInterface $entity, $field, $instance, $langcode, &$items) {
   // Add a new usage of each uploaded file.
   foreach ($items as $item) {
-    file_usage()->add(file_load($item['fid']), 'file', $entity->entityType(), $entity->id());
+    file_usage()->add(file_load($item['target_id']), 'file', $entity->entityType(), $entity->id());
   }
 }
 
@@ -237,7 +237,7 @@ function file_field_update(EntityInterface $entity, $field, $instance, $langcode
   // deletion of previous file usages are necessary.
   if (!empty($entity->original) && $entity->getRevisionId() != $entity->original->getRevisionId()) {
     foreach ($items as $item) {
-      file_usage()->add(file_load($item['fid']), 'file', $entity->entityType(), $entity->id());
+      file_usage()->add(file_load($item['target_id']), 'file', $entity->entityType(), $entity->id());
     }
     return;
   }
@@ -245,7 +245,7 @@ function file_field_update(EntityInterface $entity, $field, $instance, $langcode
   // Build a display of the current FIDs.
   $current_fids = array();
   foreach ($items as $item) {
-    $current_fids[] = $item['fid'];
+    $current_fids[] = $item['target_id'];
   }
 
   // Compare the original field values with the ones that are being saved.
@@ -253,18 +253,18 @@ function file_field_update(EntityInterface $entity, $field, $instance, $langcode
   $original_fids = array();
   if (!empty($original->{$field['field_name']}[$langcode])) {
     foreach ($original->{$field['field_name']}[$langcode] as $original_item) {
-      $original_fids[] = $original_item['fid'];
-      if (isset($original_item['fid']) && !in_array($original_item['fid'], $current_fids)) {
+      $original_fids[] = $original_item['target_id'];
+      if (isset($original_item['target_id']) && !in_array($original_item['target_id'], $current_fids)) {
         // Decrement the file usage count by 1.
-        file_usage()->delete(file_load($original_item['fid']), 'file', $entity->entityType(), $entity->id());
+        file_usage()->delete(file_load($original_item['target_id']), 'file', $entity->entityType(), $entity->id());
       }
     }
   }
 
   // Add new usage entries for newly added files.
   foreach ($items as $item) {
-    if (!in_array($item['fid'], $original_fids)) {
-      file_usage()->add(file_load($item['fid']), 'file', $entity->entityType(), $entity->id());
+    if (!in_array($item['target_id'], $original_fids)) {
+      file_usage()->add(file_load($item['target_id']), 'file', $entity->entityType(), $entity->id());
     }
   }
 }
@@ -275,7 +275,7 @@ function file_field_update(EntityInterface $entity, $field, $instance, $langcode
 function file_field_delete(EntityInterface $entity, $field, $instance, $langcode, &$items) {
   // Delete all file usages within this entity.
   foreach ($items as $delta => $item) {
-    file_usage()->delete(file_load($item['fid']), 'file', $entity->entityType(), $entity->id(), 0);
+    file_usage()->delete(file_load($item['target_id']), 'file', $entity->entityType(), $entity->id(), 0);
   }
 }
 
@@ -285,7 +285,7 @@ function file_field_delete(EntityInterface $entity, $field, $instance, $langcode
 function file_field_delete_revision(EntityInterface $entity, $field, $instance, $langcode, &$items) {
   foreach ($items as $delta => $item) {
     // Decrement the file usage count by 1.
-    file_usage()->delete(file_load($item['fid']), 'file', $entity->entityType(), $entity->id());
+    file_usage()->delete(file_load($item['target_id']), 'file', $entity->entityType(), $entity->id());
   }
 }
 
@@ -293,7 +293,7 @@ function file_field_delete_revision(EntityInterface $entity, $field, $instance,
  * Implements hook_field_is_empty().
  */
 function file_field_is_empty($item, $field_type) {
-  return empty($item['fid']);
+  return empty($item['target_id']);
 }
 
 /**
diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index 7ce65bb..049325d 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -5,6 +5,8 @@
  * Install, update and uninstall functions for File module.
  */
 
+use Drupal\field\Plugin\Core\Entity\Field;
+
 /**
  * Implements hook_schema().
  */
@@ -154,10 +156,10 @@ function file_schema() {
 function file_field_schema($field) {
   return array(
     'columns' => array(
-      'fid' => array(
-        'description' => 'The {file_managed}.fid being referenced in this field.',
+      'target_id' => array(
+        'description' => 'The ID of the target entity.',
         'type' => 'int',
-        'not null' => FALSE,
+        'not null' => TRUE,
         'unsigned' => TRUE,
       ),
       'display' => array(
@@ -175,12 +177,12 @@ function file_field_schema($field) {
       ),
     ),
     'indexes' => array(
-      'fid' => array('fid'),
+      'target_id' => array('target_id'),
     ),
     'foreign keys' => array(
-      'fid' => array(
+      'target_id' => array(
         'table' => 'file_managed',
-        'columns' => array('fid' => 'fid'),
+        'columns' => array('target_id' => 'fid'),
       ),
     ),
   );
@@ -242,6 +244,12 @@ function file_update_dependencies() {
   $dependencies['field'][8003] = array(
     'file' => 8001,
   );
+
+  // Convert the 'fid' column of file fields to 'target_id' after fields and
+  // instances have been moved to the config system.
+  $dependencies['file'][8002] = array(
+    'field' => 8003,
+  );
   return $dependencies;
 }
 
@@ -271,3 +279,46 @@ function file_update_8001() {
   );
   db_change_field('file_usage', 'id', 'id', $spec);
 }
+
+/**
+ * Update file field tables to use target_id instead of fid.
+ */
+function file_update_8003() {
+  foreach (config_get_storage_names_with_prefix('field.field.') as $config_name) {
+    $field_config = config($config_name);
+    // Only update file fields that use the default SQL storage.
+    if (in_array($field_config->get('type'), array('file', 'image')) && $field_config->get('storage.type') == 'field_sql_storage') {
+      $field = new Field($field_config->get());
+
+      $tables = array(
+        _field_sql_storage_tablename($field),
+        _field_sql_storage_revision_tablename($field),
+      );
+
+      foreach ($tables as $table_name) {
+        // Skip fields which were created during the upgrade process.
+        if (!db_field_exists($table_name, $field->id() . '_fid')) {
+          continue 2;
+        }
+
+        db_change_field($table_name, $field->id() . '_fid', $field->id() . '_target_id', array(
+          'description' => 'The ID of the target entity.',
+          'type' => 'int',
+          'unsigned' => TRUE,
+          'not null' => FALSE,
+        ));
+
+        // Change the index.
+        db_drop_index($table_name, $field->id() . '_fid');
+        db_add_index($table_name, $field->id() . '_target_id', array($field->id() . '_target_id'));
+      }
+
+      // Update the indexes in field config as well.
+      $indexes = $field_config->get('indexes');
+      unset($indexes['fid']);
+      $indexes['target_id'] = array('target_id');
+      $field_config->set('indexes', $indexes);
+      $field_config->save();
+    }
+  }
+}
diff --git a/core/modules/file/file.views.inc b/core/modules/file/file.views.inc
index c9e271f..5c2743f 100644
--- a/core/modules/file/file.views.inc
+++ b/core/modules/file/file.views.inc
@@ -455,11 +455,11 @@ function file_field_views_data($field) {
   $data = field_views_field_default_views_data($field);
   foreach ($data as $table_name => $table_data) {
     // Add the relationship only on the fid field.
-    $data[$table_name][$field['field_name'] . '_fid']['relationship'] = array(
+    $data[$table_name][$field['field_name'] . '_target_id']['relationship'] = array(
       'id' => 'standard',
       'base' => 'file_managed',
       'entity type' => 'file',
-      'base field' => 'fid',
+      'base field' => 'target_id',
       'label' => t('file from !field_name', array('!field_name' => $field['field_name'])),
     );
   }
@@ -489,7 +489,7 @@ function file_field_views_data_views_data_alter(&$data, $field) {
       'id' => 'entity_reverse',
       'field_name' => $field['field_name'],
       'field table' => _field_sql_storage_tablename($field),
-      'field field' => $field['field_name'] . '_fid',
+      'field field' => $field['field_name'] . '_target_id',
       'base' => $entity_info['base_table'],
       'base field' => $entity_info['entity_keys']['id'],
       'label' => t('!field_name', array('!field_name' => $field['field_name'])),
diff --git a/core/modules/file/lib/Drupal/file/Plugin/field/widget/FileWidget.php b/core/modules/file/lib/Drupal/file/Plugin/field/widget/FileWidget.php
index 4603288..c63df17 100644
--- a/core/modules/file/lib/Drupal/file/Plugin/field/widget/FileWidget.php
+++ b/core/modules/file/lib/Drupal/file/Plugin/field/widget/FileWidget.php
@@ -209,8 +209,8 @@ public function formElement(array $items, $delta, array $element, $langcode, arr
 
     // Field stores FID value in a single mode, so we need to transform it for
     // form element to recognize it correctly.
-    if (!isset($items[$delta]['fids']) && isset($items[$delta]['fid'])) {
-      $items[$delta]['fids'][0] = $items[$delta]['fid'];
+    if (!isset($items[$delta]['fids']) && isset($items[$delta]['target_id'])) {
+      $items[$delta]['fids'][0] = $items[$delta]['target_id'];
     }
     $element['#default_value'] = !empty($items[$delta]) ? $items[$delta] : $defaults;
 
@@ -237,7 +237,7 @@ public function massageFormValues(array $values, array $form, array &$form_state
     foreach ($values as &$value) {
       foreach ($value['fids'] as $fid) {
         $new_value = $value;
-        $new_value['fid'] = $fid;
+        $new_value['target_id'] = $fid;
         unset($new_value['fids']);
         $new_values[] = $new_value;
       }
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
index ebce0b1..c7d0071 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
@@ -60,7 +60,7 @@ function testNodeDisplay() {
 
     // Check that the default formatter is displaying with the file name.
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $default_output = theme('file_link', array('file' => $node_file));
     $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.'));
 
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php
index efe7aa0..498fd1c 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php
@@ -35,7 +35,7 @@ function testUploadPath() {
 
     // Check that the file was uploaded to the file root.
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertPathMatch('public://' . $test_file->getFilename(), $node_file->getFileUri(), t('The file %file was uploaded to the correct path.', array('%file' => $node_file->getFileUri())));
 
     // Change the path to contain multiple subdirectories.
@@ -46,7 +46,7 @@ function testUploadPath() {
 
     // Check that the file was uploaded into the subdirectory.
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'], TRUE);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'], TRUE);
     $this->assertPathMatch('public://foo/bar/baz/' . $test_file->getFilename(), $node_file->getFileUri(), t('The file %file was uploaded to the correct path.', array('%file' => $node_file->getFileUri())));
 
     // Check the path when used with tokens.
@@ -58,7 +58,7 @@ function testUploadPath() {
 
     // Check that the file was uploaded into the subdirectory.
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     // Do token replacement using the same user which uploaded the file, not
     // the user running the test case.
     $data = array('user' => $this->admin_user);
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php
index a3b86ea..7847a16 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php
@@ -67,7 +67,7 @@ function testFileFieldRSSContent() {
 
     // Get the uploaded file from the node.
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
 
     // Check that the RSS enclosure appears in the RSS feed.
     $this->drupalGet('rss.xml');
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
index 2d8cc3a..84b111d 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
@@ -47,7 +47,7 @@ function testRevisions() {
 
     // Check that the file exists on disk and in the database.
     $node = node_load($nid, TRUE);
-    $node_file_r1 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file_r1 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $node_vid_r1 = $node->vid;
     $this->assertFileExists($node_file_r1, t('New file saved to disk on node creation.'));
     $this->assertFileEntryExists($node_file_r1, t('File entry exists in database on node creation.'));
@@ -56,7 +56,7 @@ function testRevisions() {
     // Upload another file to the same node in a new revision.
     $this->replaceNodeFile($test_file, $field_name, $nid);
     $node = node_load($nid, TRUE);
-    $node_file_r2 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file_r2 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $node_vid_r2 = $node->vid;
     $this->assertFileExists($node_file_r2, t('Replacement file exists on disk after creating new revision.'));
     $this->assertFileEntryExists($node_file_r2, t('Replacement file entry exists in database after creating new revision.'));
@@ -64,7 +64,7 @@ function testRevisions() {
 
     // Check that the original file is still in place on the first revision.
     $node = node_revision_load($node_vid_r1);
-    $current_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $current_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertEqual($node_file_r1->id(), $current_file->id(), t('Original file still in place after replacing file in new revision.'));
     $this->assertFileExists($node_file_r1, t('Original file still in place after replacing file in new revision.'));
     $this->assertFileEntryExists($node_file_r1, t('Original file entry still in place after replacing file in new revision'));
@@ -74,7 +74,7 @@ function testRevisions() {
     // Check that the file is still the same as the previous revision.
     $this->drupalPost('node/' . $nid . '/edit', array('revision' => '1'), t('Save and keep published'));
     $node = node_load($nid, TRUE);
-    $node_file_r3 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file_r3 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $node_vid_r3 = $node->vid;
     $this->assertEqual($node_file_r2->id(), $node_file_r3->id(), t('Previous revision file still in place after creating a new revision without a new file.'));
     $this->assertFileIsPermanent($node_file_r3, t('New revision file is permanent.'));
@@ -82,7 +82,7 @@ function testRevisions() {
     // Revert to the first revision and check that the original file is active.
     $this->drupalPost('node/' . $nid . '/revisions/' . $node_vid_r1 . '/revert', array(), t('Revert'));
     $node = node_load($nid, TRUE);
-    $node_file_r4 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file_r4 = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $node_vid_r4 = $node->vid;
     $this->assertEqual($node_file_r1->id(), $node_file_r4->id(), t('Original revision file still in place after reverting to the original revision.'));
     $this->assertFileIsPermanent($node_file_r4, t('Original revision file still permanent after reverting to the original revision.'));
@@ -96,7 +96,7 @@ function testRevisions() {
 
     // Attach the second file to a user.
     $user = $this->drupalCreateUser();
-    $user->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'] = $node_file_r3->id();
+    $user->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'] = $node_file_r3->id();
     $user->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['display'] = 1;
     $user->save();
     $this->drupalGet('user/' . $user->uid . '/edit');
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
index 93bf379..8972fac 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
@@ -47,7 +47,7 @@ function testRequired() {
 
     $node = node_load($nid, TRUE);
 
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertFileExists($node_file, t('File exists after uploading to the required field.'));
     $this->assertFileEntryExists($node_file, t('File entry exists after uploading to the required field.'));
 
@@ -63,7 +63,7 @@ function testRequired() {
     // Create a new node with the uploaded file into the multivalue field.
     $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertFileExists($node_file, t('File exists after uploading to the required multiple value field.'));
     $this->assertFileEntryExists($node_file, t('File entry exists after uploading to the required multipel value field.'));
   }
@@ -93,7 +93,7 @@ function testFileMaxSize() {
       // Create a new node with the small file, which should pass.
       $nid = $this->uploadNodeFile($small_file, $field_name, $type_name);
       $node = node_load($nid, TRUE);
-      $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+      $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
       $this->assertFileExists($node_file, t('File exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->getSize()), '%maxsize' => $max_filesize)));
       $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->getSize()), '%maxsize' => $max_filesize)));
 
@@ -109,7 +109,7 @@ function testFileMaxSize() {
     // Upload the big file successfully.
     $nid = $this->uploadNodeFile($large_file, $field_name, $type_name);
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertFileExists($node_file, t('File exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->getSize()))));
     $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->getSize()))));
   }
@@ -131,7 +131,7 @@ function testFileExtension() {
     // Check that the file can be uploaded with no extension checking.
     $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertFileExists($node_file, t('File exists after uploading a file with no extension checking.'));
     $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file with no extension checking.'));
 
@@ -149,7 +149,7 @@ function testFileExtension() {
     // Check that the file can be uploaded with extension checking.
     $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertFileExists($node_file, t('File exists after uploading a file with extension checking.'));
     $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file with extension checking.'));
   }
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
index 702c8a2..2b3e837 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
@@ -46,7 +46,7 @@ function testSingleValuedWidget() {
       //   does not yet support file uploads.
       $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
       $node = node_load($nid, TRUE);
-      $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+      $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
       $this->assertFileExists($node_file, t('New file saved to disk on node creation.'));
 
       // Ensure the file can be downloaded.
@@ -79,7 +79,7 @@ function testSingleValuedWidget() {
       // Save the node and ensure it does not have the file.
       $this->drupalPost(NULL, array(), t('Save and keep published'));
       $node = node_load($nid, TRUE);
-      $this->assertTrue(empty($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']), t('File was successfully removed from the node.'));
+      $this->assertTrue(empty($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']), t('File was successfully removed from the node.'));
     }
   }
 
@@ -196,7 +196,7 @@ function testMultiValuedWidget() {
       preg_match('/node\/([0-9]+)/', $this->getUrl(), $matches);
       $nid = $matches[1];
       $node = node_load($nid, TRUE);
-      $this->assertTrue(empty($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']), t('Node was successfully saved without any files.'));
+      $this->assertTrue(empty($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']), t('Node was successfully saved without any files.'));
     }
   }
 
@@ -216,7 +216,7 @@ function testPrivateFileSetting() {
     $this->drupalPost("admin/structure/types/manage/$type_name/fields/$instance->id/field", $edit, t('Save field settings'));
     $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
     $node = node_load($nid, TRUE);
-    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $node_file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertFileExists($node_file, t('New file saved to disk on node creation.'));
 
     // Ensure the private file is available to the user who uploaded it.
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileItemTest.php b/core/modules/file/lib/Drupal/file/Tests/FileItemTest.php
index ee27703..b1d13d1 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileItemTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileItemTest.php
@@ -69,7 +69,7 @@ public function setUp() {
   public function testFileItem() {
     // Create a test entity with the
     $entity = entity_create('entity_test', array());
-    $entity->file_test->fid = $this->file->id();
+    $entity->file_test->target_id = $this->file->id();
     $entity->file_test->display = 1;
     $entity->file_test->description = $description = $this->randomName();
     $entity->name->value = $this->randomName();
@@ -78,7 +78,7 @@ public function testFileItem() {
     $entity = entity_load('entity_test', $entity->id());
     $this->assertTrue($entity->file_test instanceof FieldInterface, 'Field implements interface.');
     $this->assertTrue($entity->file_test[0] instanceof FieldItemInterface, 'Field item implements interface.');
-    $this->assertEqual($entity->file_test->fid, $this->file->id());
+    $this->assertEqual($entity->file_test->target_id, $this->file->id());
     $this->assertEqual($entity->file_test->display, 1);
     $this->assertEqual($entity->file_test->description, $description);
     $this->assertEqual($entity->file_test->entity->getFileUri(), $this->file->getFileUri());
@@ -92,7 +92,7 @@ public function testFileItem() {
     ));
     $file2->save();
 
-    $entity->file_test->fid = $file2->id();
+    $entity->file_test->target_id = $file2->id();
     $this->assertEqual($entity->file_test->entity->id(), $file2->id());
     $this->assertEqual($entity->file_test->entity->getFileUri(), $file2->getFileUri());
   }
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
index b7d3e9f..274de4d 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
@@ -47,7 +47,7 @@ function testFileTokenReplacement() {
 
     // Load the node and the file.
     $node = node_load($nid, TRUE);
-    $file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $file = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
 
     // Generate and test sanitized tokens.
     $tests = array();
diff --git a/core/modules/file/lib/Drupal/file/Type/FileItem.php b/core/modules/file/lib/Drupal/file/Type/FileItem.php
index 0b2c74b..0653eab 100644
--- a/core/modules/file/lib/Drupal/file/Type/FileItem.php
+++ b/core/modules/file/lib/Drupal/file/Type/FileItem.php
@@ -7,13 +7,12 @@
 
 namespace Drupal\file\Type;
 
-use Drupal\Core\Entity\Field\FieldItemBase;
-use Drupal\Core\TypedData\TypedDataInterface;
+use Drupal\Core\Entity\Field\Type\EntityReferenceItem;
 
 /**
  * Defines the 'file_field' entity field item.
  */
-class FileItem extends FieldItemBase {
+class FileItem extends EntityReferenceItem {
 
   /**
    * Property definitions of the contained properties.
@@ -25,14 +24,14 @@ class FileItem extends FieldItemBase {
   static $propertyDefinitions;
 
   /**
-   * Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyDefinitions().
+   * {@inheritdoc}
    */
   public function getPropertyDefinitions() {
+    $this->definition['settings']['target_type'] = 'file';
+
     if (!isset(static::$propertyDefinitions)) {
-      static::$propertyDefinitions['fid'] = array(
-        'type' => 'integer',
-        'label' => t('Referenced file id.'),
-      );
+      static::$propertyDefinitions = parent::getPropertyDefinitions();
+
       static::$propertyDefinitions['display'] = array(
         'type' => 'boolean',
         'label' => t('Flag to control whether this file should be displayed when viewing content.'),
@@ -41,35 +40,8 @@ public function getPropertyDefinitions() {
         'type' => 'string',
         'label' => t('A description of the file.'),
       );
-      static::$propertyDefinitions['entity'] = array(
-        'type' => 'entity',
-        'constraints' => array(
-          'EntityType' => 'file',
-        ),
-        'label' => t('File'),
-        'description' => t('The referenced file'),
-        // The entity object is computed out of the fid.
-        'computed' => TRUE,
-        'read-only' => FALSE,
-        'settings' => array('id source' => 'fid'),
-      );
     }
     return static::$propertyDefinitions;
   }
 
-  /**
-   * Overrides \Drupal\Core\Entity\Field\FieldItemBase::get().
-   */
-  public function setValue($values, $notify = TRUE) {
-    // Treat the values as property value of the entity property, if no array is
-    // given.
-    if (isset($values) && !is_array($values)) {
-      $values = array('entity' => $values);
-    }
-    // Make sure that the 'entity' property gets set as 'fid'.
-    if (isset($values['fid']) && !isset($values['entity'])) {
-      $values['entity'] = $values['fid'];
-    }
-    parent::setValue($values, $notify);
-  }
 }
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 7cc950f..d549abc 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -300,11 +300,11 @@ function forum_node_validate(EntityInterface $node, $form) {
       foreach ($node->taxonomy_forums[$langcode] as $delta => $item) {
         // If no term was selected (e.g. when no terms exist yet), remove the
         // item.
-        if (empty($item['tid'])) {
+        if (empty($item['target_id'])) {
           unset($node->taxonomy_forums[$langcode][$delta]);
           continue;
         }
-        $term = taxonomy_term_load($item['tid']);
+        $term = taxonomy_term_load($item['target_id']);
         if (!$term) {
           form_set_error('taxonomy_forums', t('Select a forum.'));
           continue;
@@ -333,13 +333,13 @@ function forum_node_presave(EntityInterface $node) {
     reset($node->taxonomy_forums);
     $langcode = key($node->taxonomy_forums);
     if (!empty($node->taxonomy_forums[$langcode])) {
-      $node->forum_tid = $node->taxonomy_forums[$langcode][0]['tid'];
+      $node->forum_tid = $node->taxonomy_forums[$langcode][0]['target_id'];
       // Only do a shadow copy check if this is not a new node.
       if (!$node->isNew()) {
         $old_tid = db_query_range("SELECT f.tid FROM {forum} f INNER JOIN {node} n ON f.vid = n.vid WHERE n.nid = :nid ORDER BY f.vid DESC", 0, 1, array(':nid' => $node->nid))->fetchField();
         if ($old_tid && isset($node->forum_tid) && ($node->forum_tid != $old_tid) && !empty($node->shadow)) {
           // A shadow copy needs to be created. Retain new term and add old term.
-          $node->taxonomy_forums[$langcode][] = array('tid' => $old_tid);
+          $node->taxonomy_forums[$langcode][] = array('target_id' => $old_tid);
         }
       }
     }
@@ -538,7 +538,7 @@ function forum_field_storage_pre_insert(EntityInterface $entity, &$skip_fields)
       $query->values(array(
         'nid' => $entity->id(),
         'title' => $translation->title->value,
-        'tid' => $translation->taxonomy_forums->tid,
+        'tid' => $translation->taxonomy_forums->target_id,
         'sticky' => $entity->sticky,
         'created' => $entity->created,
         'comment_count' => 0,
@@ -573,7 +573,7 @@ function forum_field_storage_pre_update(EntityInterface $entity, &$skip_fields)
           $query->values(array(
             'nid' => $entity->nid,
             'title' => $entity->title,
-            'tid' => $item['tid'],
+            'tid' => $item['target_id'],
             'sticky' => $entity->sticky,
             'created' => $entity->created,
             'comment_count' => 0,
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index f8c0479..c28b1dc 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -529,7 +529,7 @@ function createForumTopic($forum, $container = FALSE) {
     // Retrieve node object, ensure that the topic was created and in the proper forum.
     $node = $this->drupalGetNodeByTitle($title);
     $this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
-    $this->assertEqual($node->taxonomy_forums[Language::LANGCODE_NOT_SPECIFIED][0]['tid'], $tid, 'Saved forum topic was in the expected forum');
+    $this->assertEqual($node->taxonomy_forums[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'], $tid, 'Saved forum topic was in the expected forum');
 
     // View forum topic.
     $this->drupalGet('node/' . $node->nid);
diff --git a/core/modules/image/image.field.inc b/core/modules/image/image.field.inc
index ab64ffe..06fd5e7 100644
--- a/core/modules/image/image.field.inc
+++ b/core/modules/image/image.field.inc
@@ -22,7 +22,7 @@ function image_field_info() {
         'column_groups' => array(
           'file' => array(
             'label' => t('File'),
-            'columns' => array('fid', 'width', 'height'),
+            'columns' => array('target_id', 'width', 'height'),
           ),
           'alt' => array(
             'label' => t('Alt'),
diff --git a/core/modules/image/image.install b/core/modules/image/image.install
index 8a05660..fd440da 100644
--- a/core/modules/image/image.install
+++ b/core/modules/image/image.install
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Component\Uuid\Uuid;
+use Drupal\field\Plugin\Core\Entity\Field;
 
 /**
  * Implements hook_install().
@@ -30,10 +31,10 @@ function image_uninstall() {
 function image_field_schema($field) {
   return array(
     'columns' => array(
-      'fid' => array(
-        'description' => 'The {file_managed}.fid being referenced in this field.',
+      'target_id' => array(
+        'description' => 'The ID of the target entity.',
         'type' => 'int',
-        'not null' => FALSE,
+        'not null' => TRUE,
         'unsigned' => TRUE,
       ),
       'alt' => array(
@@ -60,12 +61,12 @@ function image_field_schema($field) {
       ),
     ),
     'indexes' => array(
-      'fid' => array('fid'),
+      'target_id' => array('target_id'),
     ),
     'foreign keys' => array(
-      'fid' => array(
+      'target_id' => array(
         'table' => 'file_managed',
-        'columns' => array('fid' => 'fid'),
+        'columns' => array('target_id' => 'fid'),
       ),
     ),
   );
diff --git a/core/modules/image/image.views.inc b/core/modules/image/image.views.inc
index 77c4ea3..0d3ab9b 100644
--- a/core/modules/image/image.views.inc
+++ b/core/modules/image/image.views.inc
@@ -22,7 +22,7 @@ function image_field_views_data($field) {
     $data[$table_name][$field['field_name'] . '_fid']['relationship'] = array(
       'id' => 'standard',
       'base' => 'file_managed',
-      'base field' => 'fid',
+      'base field' => 'target_id',
       'label' => t('image from !field_name', array('!field_name' => $field['field_name'])),
     );
   }
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php
index 96941b3..973a8ef 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php
@@ -273,7 +273,7 @@ function testStyleReplacement() {
 
     // Test that image is displayed using newly created style.
     $this->drupalGet('node/' . $nid);
-    $this->assertRaw(image_style_url($style_name, file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri()), format_string('Image displayed using style @style.', array('@style' => $style_name)));
+    $this->assertRaw(image_style_url($style_name, file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri()), format_string('Image displayed using style @style.', array('@style' => $style_name)));
 
     // Rename the style and make sure the image field is updated.
     $new_style_name = strtolower($this->randomName(10));
@@ -285,7 +285,7 @@ function testStyleReplacement() {
     $this->drupalPost($style_path . $style_name, $edit, t('Update style'));
     $this->assertText(t('Changes to the style have been saved.'), format_string('Style %name was renamed to %new_name.', array('%name' => $style_name, '%new_name' => $new_style_name)));
     $this->drupalGet('node/' . $nid);
-    $this->assertRaw(image_style_url($new_style_name, file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri()), 'Image displayed using style replacement style.');
+    $this->assertRaw(image_style_url($new_style_name, file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri()), 'Image displayed using style replacement style.');
 
     // Delete the style and choose a replacement style.
     $edit = array(
@@ -296,7 +296,7 @@ function testStyleReplacement() {
     $this->assertRaw($message);
 
     $this->drupalGet('node/' . $nid);
-    $this->assertRaw(image_style_url('thumbnail', file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri()), 'Image displayed using style replacement style.');
+    $this->assertRaw(image_style_url('thumbnail', file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri()), 'Image displayed using style replacement style.');
   }
 
   /**
@@ -362,7 +362,7 @@ function testConfigImport() {
 
     // Test that image is displayed using newly created style.
     $this->drupalGet('node/' . $nid);
-    $this->assertRaw(image_style_url($style_name, file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri()), format_string('Image displayed using style @style.', array('@style' => $style_name)));
+    $this->assertRaw(image_style_url($style_name, file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri()), format_string('Image displayed using style @style.', array('@style' => $style_name)));
 
     // Copy config to staging, and delete the image style.
     $staging = $this->container->get('config.storage.staging');
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
index ccc39bd..c0f0cfd 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
@@ -58,7 +58,7 @@ function _testImageFieldFormatters($scheme) {
     $node = node_load($nid, TRUE);
 
     // Test that the default formatter is being used.
-    $image_uri = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri();
+    $image_uri = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri();
     $image_info = array(
       'uri' => $image_uri,
       'width' => 40,
@@ -165,7 +165,7 @@ function testImageFieldSettings() {
     // style.
     $node = node_load($nid, TRUE);
     $image_info = array(
-      'uri' => file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri(),
+      'uri' => file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri(),
       'width' => 220,
       'height' => 110,
       'style_name' => 'medium',
@@ -175,7 +175,7 @@ function testImageFieldSettings() {
 
     // Add alt/title fields to the image and verify that they are displayed.
     $image_info = array(
-      'uri' => file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri(),
+      'uri' => file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri(),
       'alt' => $this->randomName(),
       'title' => $this->randomName(),
       'width' => 40,
@@ -243,7 +243,7 @@ function testImageFieldDefaultImage() {
     $nid = $this->uploadNodeImage($images[1], $field_name, 'article');
     $node = node_load($nid, TRUE);
     $image_info = array(
-      'uri' => file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri(),
+      'uri' => file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri(),
       'width' => 40,
       'height' => 20,
     );
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageItemTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageItemTest.php
index bed3d3a..758b44c 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageItemTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageItemTest.php
@@ -68,7 +68,7 @@ public function setUp() {
   public function testImageItem() {
     // Create a test entity with the image field set.
     $entity = entity_create('entity_test', array());
-    $entity->image_test->fid = $this->image->id();
+    $entity->image_test->target_id = $this->image->id();
     $entity->image_test->alt = $alt = $this->randomName();
     $entity->image_test->title = $title = $this->randomName();
     $entity->name->value = $this->randomName();
@@ -77,7 +77,7 @@ public function testImageItem() {
     $entity = entity_load('entity_test', $entity->id());
     $this->assertTrue($entity->image_test instanceof FieldInterface, 'Field implements interface.');
     $this->assertTrue($entity->image_test[0] instanceof FieldItemInterface, 'Field item implements interface.');
-    $this->assertEqual($entity->image_test->fid, $this->image->id());
+    $this->assertEqual($entity->image_test->target_id, $this->image->id());
     $this->assertEqual($entity->image_test->alt, $alt);
     $this->assertEqual($entity->image_test->title, $title);
     $info = image_get_info('public://example.jpg');
@@ -93,7 +93,7 @@ public function testImageItem() {
     ));
     $image2->save();
 
-    $entity->image_test->fid = $image2->id();
+    $entity->image_test->target_id = $image2->id();
     $entity->image_test->alt = $new_alt = $this->randomName();
     // The width and height is only updated when width is not set.
     $entity->image_test->width = NULL;
@@ -107,7 +107,7 @@ public function testImageItem() {
 
     // Check that the image item can be set to the referenced file directly.
     $entity->image_test = $this->image;
-    $this->assertEqual($entity->image_test->fid, $this->image->id());
+    $this->assertEqual($entity->image_test->target_id, $this->image->id());
 
     // Delete the image and try to save the entity again.
     $this->image->delete();
diff --git a/core/modules/image/lib/Drupal/image/Type/ImageItem.php b/core/modules/image/lib/Drupal/image/Type/ImageItem.php
index f6cedf2..778bbed 100644
--- a/core/modules/image/lib/Drupal/image/Type/ImageItem.php
+++ b/core/modules/image/lib/Drupal/image/Type/ImageItem.php
@@ -7,12 +7,12 @@
 
 namespace Drupal\image\Type;
 
-use Drupal\Core\Entity\Field\FieldItemBase;
+use Drupal\Core\Entity\Field\Type\EntityReferenceItem;
 
 /**
  * Defines the 'image_field' entity field item.
  */
-class ImageItem extends FieldItemBase {
+class ImageItem extends EntityReferenceItem {
 
   /**
    * Property definitions of the contained properties.
@@ -24,14 +24,14 @@ class ImageItem extends FieldItemBase {
   static $propertyDefinitions;
 
   /**
-   * Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyDefinitions().
+   * {@inheritdoc}
    */
   public function getPropertyDefinitions() {
+    $this->definition['settings']['target_type'] = 'file';
+
     if (!isset(static::$propertyDefinitions)) {
-      static::$propertyDefinitions['fid'] = array(
-        'type' => 'integer',
-        'label' => t('Referenced file id.'),
-      );
+      static::$propertyDefinitions = parent::getPropertyDefinitions();
+
       static::$propertyDefinitions['alt'] = array(
         'type' => 'boolean',
         'label' => t("Alternative image text, for the image's 'alt' attribute."),
@@ -48,35 +48,8 @@ public function getPropertyDefinitions() {
         'type' => 'integer',
         'label' => t('The height of the image in pixels.'),
       );
-      static::$propertyDefinitions['entity'] = array(
-        'type' => 'entity',
-        'constraints' => array(
-          'EntityType' => 'file',
-        ),
-        'label' => t('Image'),
-        'description' => t('The referenced file'),
-        // The entity object is computed out of the fid.
-        'computed' => TRUE,
-        'read-only' => FALSE,
-        'settings' => array('id source' => 'fid'),
-      );
     }
     return static::$propertyDefinitions;
   }
 
-  /**
-   * Overrides \Drupal\Core\Entity\Field\FieldItemBase::get().
-   */
-  public function setValue($values, $notify = TRUE) {
-    // Treat the values as property value of the entity property, if no array is
-    // given.
-    if (isset($values) && !is_array($values)) {
-      $values = array('entity' => $values);
-    }
-    // Make sure that the 'entity' property gets set as 'fid'.
-    if (isset($values['fid']) && !isset($values['entity'])) {
-      $values['entity'] = $values['fid'];
-    }
-    parent::setValue($values, $notify);
-  }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
index 9d022c5..6063677 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
@@ -87,7 +87,7 @@ public function testForumPager() {
         'nid' => NULL,
         'type' => 'forum',
         'taxonomy_forums' => array(
-          array('tid' => $tid)
+          array('target_id' => $tid),
         ),
       ));
     }
diff --git a/core/modules/picture/lib/Drupal/picture/Tests/PictureFieldDisplayTest.php b/core/modules/picture/lib/Drupal/picture/Tests/PictureFieldDisplayTest.php
index 927097d..b79ad21 100644
--- a/core/modules/picture/lib/Drupal/picture/Tests/PictureFieldDisplayTest.php
+++ b/core/modules/picture/lib/Drupal/picture/Tests/PictureFieldDisplayTest.php
@@ -123,7 +123,7 @@ public function _testPictureFieldFormatters($scheme) {
     $node = node_load($nid, TRUE);
 
     // Test that the default formatter is being used.
-    $image_uri = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['fid'])->getFileUri();
+    $image_uri = file_load($node->{$field_name}[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'])->getFileUri();
     $image_info = array(
       'uri' => $image_uri,
       'width' => 40,
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php
index 320126c..cb6007a 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php
@@ -156,8 +156,8 @@ function testAttributesInMarkupFile() {
     // Prepares filenames for lookup in RDF graph.
     $node = node_load($node->nid);
     $node_uri = url('node/' . $node->nid, array('absolute' => TRUE));
-    $file_uri = file_create_url(file_load($node->file_test['und'][0]['fid'])->getFileUri());
-    $image_uri = image_style_url('medium', file_load($node->field_image['und'][0]['fid'])->getFileUri());
+    $file_uri = file_create_url(file_load($node->file_test['und'][0]['target_id'])->getFileUri());
+    $image_uri = image_style_url('medium', file_load($node->field_image['und'][0]['target_id'])->getFileUri());
     $base_uri = url('<front>', array('absolute' => TRUE));
 
     // Edits the node to add tags.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php
index f36fca7..66fc524 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php
@@ -111,7 +111,7 @@ public function setUp() {
       $entity->name->value = $this->randomName();
       $index = $i ? 1 : 0;
       $entity->user_id->target_id = $this->accounts[$index]->uid;
-      $entity->{$this->fieldName}->tid = $this->terms[$index]->id();
+      $entity->{$this->fieldName}->target_id = $this->terms[$index]->id();
       $entity->save();
       $this->entities[] = $entity;
     }
@@ -153,7 +153,7 @@ public function testQuery() {
     // This returns the 0th entity as that's only one pointing to the 0th
     // term (test with specifying the column name).
     $this->queryResults = $this->factory->get('entity_test')
-      ->condition("$this->fieldName.tid.entity.name", $this->terms[0]->name->value)
+      ->condition("$this->fieldName.target_id.entity.name", $this->terms[0]->name->value)
       ->execute();
     $this->assertResults(array(0));
     // This returns the 1st and 2nd entity as those point to the 1st term.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
index 5ad7a44..ba4bca5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
@@ -102,7 +102,7 @@ function setUp() {
       'title' => $this->xss_label,
       'type' => 'article',
       'promote' => NODE_PROMOTED,
-      'field_tags' => array(array('tid' => $this->term->id())),
+      'field_tags' => array(array('target_id' => $this->term->id())),
     ));
 
     // Create a test comment on the test node.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/UserPictureUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UserPictureUpgradePathTest.php
index 376f1e9..dd9bcf9 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/UserPictureUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UserPictureUpgradePathTest.php
@@ -69,7 +69,7 @@ public function testUserPictureUpgrade() {
 
     // Check the user picture and file usage record.
     $user = user_load(1);
-    $file = file_load($user->user_picture[Language::LANGCODE_NOT_SPECIFIED][0]['fid']);
+    $file = file_load($user->user_picture[Language::LANGCODE_NOT_SPECIFIED][0]['target_id']);
     $this->assertEqual('public://user_pictures_dir/faked_image.png', $file->getFileUri());
     $usage = file_usage()->listUsage($file);
     $this->assertEqual(1, $usage['file']['user'][1]);
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php
index 63dbc0f..b44002e 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php
@@ -33,9 +33,10 @@ class LinkFormatter extends TaxonomyFormatterBase {
   public function viewElements(EntityInterface $entity, $langcode, array $items) {
     $elements = array();
 
-    // Terms without tid do not exist yet, theme such terms as just their name.
+    // Terms without target_id do not exist yet, theme such terms as just their
+    // name.
     foreach ($items as $delta => $item) {
-      if (!$item['tid']) {
+      if (!$item['target_id']) {
         $elements[$delta] = array(
           '#markup' => check_plain($item['entity']->label()),
         );
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php
index e1cd48d..2a2af05 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php
@@ -31,10 +31,10 @@ class RSSCategoryFormatter extends TaxonomyFormatterBase {
    * {@inheritdoc}
    */
   public function viewElements(EntityInterface $entity, $langcode, array $items) {
-    // Terms whose tid is 'autocreate' do not exist yet and $item['entity'] is
-    // not set. Theme such terms as just their name.
+    // Terms whose target_id is 'autocreate' do not exist yet and
+    // $item['entity'] is not set. Theme such terms as just their name.
     foreach ($items as $item) {
-      if ($item['tid']) {
+      if ($item['target_id']) {
         $value = $item['entity']->label();
 
         $uri = $item['entity']->uri();
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php
index 6f688da..90f76ad 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php
@@ -30,8 +30,8 @@ public function prepareView(array $entities, $langcode, array &$items) {
     foreach ($entities as $id => $entity) {
       foreach ($items[$id] as $delta => $item) {
         // Force the array key to prevent duplicates.
-        if ($item['tid'] !== 0) {
-          $tids[$item['tid']] = $item['tid'];
+        if ($item['target_id'] !== 0) {
+          $tids[$item['target_id']] = $item['target_id'];
         }
       }
     }
@@ -46,12 +46,12 @@ public function prepareView(array $entities, $langcode, array &$items) {
         foreach ($items[$id] as $delta => $item) {
           // Check whether the taxonomy term field instance value could be
           // loaded.
-          if (isset($terms[$item['tid']])) {
+          if (isset($terms[$item['target_id']])) {
             // Replace the instance value with the term data.
-            $items[$id][$delta]['entity'] = $terms[$item['tid']];
+            $items[$id][$delta]['entity'] = $terms[$item['target_id']];
           }
           // Terms to be created are not in $terms, but are still legitimate.
-          elseif ($item['tid'] === 0 && isset($item['entity'])) {
+          elseif ($item['target_id'] === 0 && isset($item['entity'])) {
             // Leave the item in place.
           }
           // Otherwise, unset the instance value, since the term does not exist.
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php
index c0ef1f6..78f8fb3 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php
@@ -50,7 +50,7 @@ public function settingsForm(array $form, array &$form_state) {
   public function formElement(array $items, $delta, array $element, $langcode, array &$form, array &$form_state) {
     $tags = array();
     foreach ($items as $item) {
-      $tags[$item['tid']] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['tid']);
+      $tags[$item['target_id']] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['target_id']);
     }
     $element += array(
       '#type' => 'textfield',
@@ -86,7 +86,7 @@ public function massageFormValues(array $values, array $form, array &$form_state
       // otherwise, create a new term.
       if ($possibilities = entity_load_multiple_by_properties('taxonomy_term', array('name' => trim($value), 'vid' => array_keys($vocabularies)))) {
         $term = array_pop($possibilities);
-        $item = array('tid' => $term->id());
+        $item = array('target_id' => $term->id());
       }
       else {
         $vocabulary = reset($vocabularies);
@@ -94,7 +94,7 @@ public function massageFormValues(array $values, array $form, array &$form_state
           'vid' => $vocabulary->id(),
           'name' => $value,
         ));
-        $item = array('tid' => 0, 'entity' => $term);
+        $item = array('target_id' => 0, 'entity' => $term);
       }
       $items[] = $item;
     }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php
index a8aefcb..e9180d6 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php
@@ -78,14 +78,14 @@ public function testTaxonomyTermReferenceItem() {
     $tid = $this->term->id();
     // Just being able to create the entity like this verifies a lot of code.
     $entity = entity_create('entity_test', array());
-    $entity->field_test_taxonomy->tid = $this->term->id();
+    $entity->field_test_taxonomy->target_id = $this->term->id();
     $entity->name->value = $this->randomName();
     $entity->save();
 
     $entity = entity_load('entity_test', $entity->id());
     $this->assertTrue($entity->field_test_taxonomy instanceof FieldInterface, 'Field implements interface.');
     $this->assertTrue($entity->field_test_taxonomy[0] instanceof FieldItemInterface, 'Field item implements interface.');
-    $this->assertEqual($entity->field_test_taxonomy->tid, $this->term->id());
+    $this->assertEqual($entity->field_test_taxonomy->target_id, $this->term->id());
     $this->assertEqual($entity->field_test_taxonomy->entity->name->value, $this->term->name->value);
     $this->assertEqual($entity->field_test_taxonomy->entity->id(), $tid);
     $this->assertEqual($entity->field_test_taxonomy->entity->uuid(), $this->term->uuid());
@@ -106,7 +106,7 @@ public function testTaxonomyTermReferenceItem() {
     ));
     $term2->save();
 
-    $entity->field_test_taxonomy->tid = $term2->id();
+    $entity->field_test_taxonomy->target_id = $term2->id();
     $this->assertEqual($entity->field_test_taxonomy->entity->id(), $term2->id());
     $this->assertEqual($entity->field_test_taxonomy->entity->name->value, $term2->name->value);
   }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
index 53a53b1..458cf9e 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
@@ -85,7 +85,7 @@ function testTaxonomyTermFieldValidation() {
     $langcode = Language::LANGCODE_NOT_SPECIFIED;
     $entity = entity_create('entity_test', array());
     $term = $this->createTerm($this->vocabulary);
-    $entity->{$this->field_name}->tid = $term->id();
+    $entity->{$this->field_name}->target_id = $term->id();
     try {
       field_attach_validate($entity);
       $this->pass('Correct term does not cause validation error.');
@@ -96,7 +96,7 @@ function testTaxonomyTermFieldValidation() {
 
     $entity = entity_create('entity_test', array());
     $bad_term = $this->createTerm($this->createVocabulary());
-    $entity->{$this->field_name}->tid = $bad_term->id();
+    $entity->{$this->field_name}->target_id = $bad_term->id();
     try {
       field_attach_validate($entity);
       $this->fail('Wrong term causes validation error.');
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
index d6280c8..5ef5a97 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
@@ -175,7 +175,7 @@ function testTaxonomyIndex() {
     $this->assertEqual(1, $index_count, 'Term 2 is indexed once.');
 
     // Update the article to change one term.
-    $node->{$this->field_name_1}[$langcode] = array(array('tid' => $term_1->id()));
+    $node->{$this->field_name_1}[$langcode] = array(array('target_id' => $term_1->id()));
     $node->save();
 
     // Check that both terms are indexed.
@@ -191,7 +191,7 @@ function testTaxonomyIndex() {
     $this->assertEqual(1, $index_count, 'Term 2 is indexed.');
 
     // Update the article to change another term.
-    $node->{$this->field_name_2}[$langcode] = array(array('tid' => $term_1->id()));
+    $node->{$this->field_name_2}[$langcode] = array(array('target_id' => $term_1->id()));
     $node->save();
 
     // Check that only one term is indexed.
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php
index 74c546b..f8f315b 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php
@@ -55,8 +55,8 @@ function setUp() {
 
     $node = array();
     $node['type'] = 'article';
-    $node['field_views_testing_tags'][]['tid'] = $this->term1->id();
-    $node['field_views_testing_tags'][]['tid'] = $this->term2->id();
+    $node['field_views_testing_tags'][]['target_id'] = $this->term1->id();
+    $node['field_views_testing_tags'][]['target_id'] = $this->term2->id();
     $this->nodes[] = $this->drupalCreateNode($node);
     $this->nodes[] = $this->drupalCreateNode($node);
   }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php
index b558d97..6b9a763 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php
@@ -9,11 +9,12 @@
 
 use Drupal\Core\Entity\Field\FieldItemBase;
 use Drupal\Core\TypedData\TypedDataInterface;
+use Drupal\Core\Entity\Field\Type\EntityReferenceItem;
 
 /**
  * Defines the 'taxonomy_term_reference' entity field item.
  */
-class TaxonomyTermReferenceItem extends FieldItemBase {
+class TaxonomyTermReferenceItem extends EntityReferenceItem {
 
   /**
    * Property definitions of the contained properties.
@@ -28,40 +29,7 @@ class TaxonomyTermReferenceItem extends FieldItemBase {
    * Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyDefinitions().
    */
   public function getPropertyDefinitions() {
-    if (!isset(static::$propertyDefinitions)) {
-      static::$propertyDefinitions['tid'] = array(
-        'type' => 'integer',
-        'label' => t('Referenced taxonomy term id.'),
-      );
-      static::$propertyDefinitions['entity'] = array(
-        'type' => 'entity',
-        'constraints' => array(
-          'EntityType' => 'taxonomy_term',
-        ),
-        'label' => t('Term'),
-        'description' => t('The referenced taxonomy term'),
-        // The entity object is computed out of the tid.
-        'computed' => TRUE,
-        'read-only' => FALSE,
-        'settings' => array('id source' => 'tid'),
-      );
-    }
-    return static::$propertyDefinitions;
-  }
-
-  /**
-   * Overrides \Drupal\Core\Entity\Field\FieldItemBase::get().
-   */
-  public function setValue($values, $notify = TRUE) {
-    // Treat the values as property value of the entity property, if no array is
-    // given.
-    if (isset($values) && !is_array($values)) {
-      $values = array('entity' => $values);
-    }
-    // Make sure that the 'entity' property gets set as 'tid'.
-    if (isset($values['tid']) && !isset($values['entity'])) {
-      $values['entity'] = $values['tid'];
-    }
-    parent::setValue($values, $notify);
+    $this->definition['settings']['target_type'] = 'taxonomy_term';
+    return parent::getPropertyDefinitions();
   }
 }
diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
index d89b89c..f579755 100644
--- a/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Component\Uuid\Uuid;
+use Drupal\field\Plugin\Core\Entity\Field;
 
 /**
  * Implements hook_uninstall().
@@ -175,25 +176,37 @@ function taxonomy_schema() {
 function taxonomy_field_schema($field) {
   return array(
     'columns' => array(
-      'tid' => array(
+      'target_id' => array(
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => FALSE,
       ),
     ),
     'indexes' => array(
-      'tid' => array('tid'),
+      'target_id' => array('target_id'),
     ),
     'foreign keys' => array(
-      'tid' => array(
+      'target_id' => array(
         'table' => 'taxonomy_term_data',
-        'columns' => array('tid' => 'tid'),
+        'columns' => array('target_id' => 'tid'),
       ),
     ),
   );
 }
 
 /**
+ * Implements hook_update_dependencies().
+ */
+function taxonomy_update_dependencies() {
+  // Convert the 'tid' column of the taxonomy reference field to 'target_id'
+  // after fields and instances have been moved to the config system.
+  $dependencies['taxonomy'][8007] = array(
+    'field' => 8003,
+  );
+  return $dependencies;
+}
+
+/**
  * Remove the {taxonomy_vocabulary}.module field.
  */
 function taxonomy_update_8000() {
@@ -335,3 +348,41 @@ function taxonomy_update_8006() {
       ->execute();
   }
 }
+
+/**
+ * Update taxonomy_term_reference field tables to use target_id instead of tid.
+ */
+function taxonomy_update_8007() {
+  foreach (config_get_storage_names_with_prefix('field.field.') as $config_name) {
+    $field_config = config($config_name);
+    // Only update taxonomy reference fields that use the default SQL storage.
+    if ($field_config->get('type') == 'taxonomy_term_reference' && $field_config->get('storage.type') == 'field_sql_storage') {
+      $field = new Field($field_config->get());
+
+      $tables = array(
+        _field_sql_storage_tablename($field),
+        _field_sql_storage_revision_tablename($field),
+      );
+
+      foreach ($tables as $table_name) {
+        db_change_field($table_name, $field->id() . '_tid', $field->id() . '_target_id', array(
+          'description' => 'The ID of the target entity.',
+          'type' => 'int',
+          'unsigned' => TRUE,
+          'not null' => FALSE,
+        ));
+
+        // Change the index.
+        db_drop_index($table_name, $field->id() . '_tid');
+        db_add_index($table_name, $field->id() . '_target_id', array($field->id() . '_target_id'));
+      }
+
+      // Update the indexes in field config as well.
+      $indexes = $field_config->get('indexes');
+      unset($indexes['tid']);
+      $indexes['target_id'] = array('target_id');
+      $field_config->set('indexes', $indexes);
+      $field_config->save();
+    }
+  }
+}
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 980ad00..b2c6b83 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -948,8 +948,8 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
   // Build an array of existing term IDs so they can be loaded with
   // taxonomy_term_load_multiple();
   foreach ($items as $delta => $item) {
-    if (!empty($item['tid']) && $item['tid'] != 'autocreate') {
-      $tids[] = $item['tid'];
+    if (!empty($item['target_id']) && $item['target_id'] != 'autocreate') {
+      $tids[] = $item['target_id'];
     }
   }
   if (!empty($tids)) {
@@ -959,12 +959,12 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
     // allowed values for this field.
     foreach ($items as $delta => $item) {
       $validate = TRUE;
-      if (!empty($item['tid']) && $item['tid'] != 'autocreate') {
+      if (!empty($item['target_id']) && $item['target_id'] != 'autocreate') {
         $validate = FALSE;
         foreach ($field['settings']['allowed_values'] as $settings) {
           // If no parent is specified, check if the term is in the vocabulary.
           if (isset($settings['vocabulary']) && empty($settings['parent'])) {
-            if ($settings['vocabulary'] == $terms[$item['tid']]->bundle()) {
+            if ($settings['vocabulary'] == $terms[$item['target_id']]->bundle()) {
               $validate = TRUE;
               break;
             }
@@ -972,7 +972,7 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
           // If a parent is specified, then to validate it must appear in the
           // array returned by taxonomy_term_load_parents_all().
           elseif (!empty($settings['parent'])) {
-            $ancestors = taxonomy_term_load_parents_all($item['tid']);
+            $ancestors = taxonomy_term_load_parents_all($item['target_id']);
             foreach ($ancestors as $ancestor) {
               if ($ancestor->id() == $settings['parent']) {
                 $validate = TRUE;
@@ -996,7 +996,7 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
  * Implements hook_field_is_empty().
  */
 function taxonomy_field_is_empty($item, $field_type) {
-  return !is_array($item) || (empty($item['tid']) && empty($item['entity']));
+  return !is_array($item) || (empty($item['target_id']) && empty($item['entity']));
 }
 
 /**
@@ -1153,10 +1153,9 @@ function taxonomy_rdf_mapping() {
  */
 function taxonomy_field_presave(EntityInterface $entity, $field, $instance, $langcode, &$items) {
   foreach ($items as $delta => $item) {
-    if (!$item['tid'] && isset($item['entity'])) {
-      unset($item['tid']);
+    if (!$item['target_id'] && isset($item['target_id'])) {
       $item['entity']->save();
-      $items[$delta]['tid'] = $item['entity']->id();
+      $items[$delta]['target_id'] = $item['entity']->id();
     }
   }
 }
@@ -1216,7 +1215,7 @@ function taxonomy_build_node_index($node) {
         foreach (field_available_languages('node', $field) as $langcode) {
           if (!empty($items[$langcode])) {
             foreach ($items[$langcode] as $item) {
-              $tid_all[$item['tid']] = $item['tid'];
+              $tid_all[$item['target_id']] = $item['target_id'];
             }
           }
         }
diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc
index d52819b..876c6c8 100644
--- a/core/modules/taxonomy/taxonomy.views.inc
+++ b/core/modules/taxonomy/taxonomy.views.inc
@@ -346,7 +346,7 @@ function taxonomy_field_views_data($field) {
     }
 
     // Add the relationship only on the tid field.
-    $data[$table_name][$field['field_name'] . '_tid']['relationship'] = array(
+    $data[$table_name][$field['field_name'] . '_target_id']['relationship'] = array(
       'id' => 'standard',
       'base' => 'taxonomy_term_data',
       'base field' => 'tid',
@@ -380,7 +380,7 @@ function taxonomy_field_views_data_views_data_alter(&$data, $field) {
       'id' => 'entity_reverse',
       'field_name' => $field['field_name'],
       'field table' => _field_sql_storage_tablename($field),
-      'field field' => $field['field_name'] . '_tid',
+      'field field' => $field['field_name'] . '_target_id',
       'base' => $entity_info['base_table'],
       'base field' => $entity_info['entity_keys']['id'],
       'label' => t('!field_name', array('!field_name' => $field['field_name'])),
diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSyncImageTest.php b/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSyncImageTest.php
index 95826ac..a0e4c17 100644
--- a/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSyncImageTest.php
+++ b/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSyncImageTest.php
@@ -121,7 +121,7 @@ function testImageFieldSync() {
       // Generate the item for the current image file entity and attach it to
       // the entity.
       $item = array(
-        'fid' => $fid,
+        'target_id' => $fid,
         'alt' => $default_langcode . '_' . $fid . '_' . $this->randomName(),
         'title' => $default_langcode . '_' . $fid . '_' . $this->randomName(),
       );
@@ -146,7 +146,7 @@ function testImageFieldSync() {
       // the entity.
       $fid = $this->files[$index]->fid;
       $item = array(
-        'fid' => $fid,
+        'target_id' => $fid,
         'alt' => $langcode . '_' . $fid . '_' . $this->randomName(),
         'title' => $langcode . '_' . $fid . '_' . $this->randomName(),
       );
@@ -168,11 +168,11 @@ function testImageFieldSync() {
     // have been retained.
     $fids = array();
     foreach ($entity->{$this->fieldName} as $delta => $item) {
-      $value = $values[$default_langcode][$item->fid];
+      $value = $values[$default_langcode][$item->target_id];
       $source_item = $entity->getTranslation($langcode)->{$this->fieldName}->offsetGet($delta);
-      $assert = $item->fid == $source_item->fid && $item->alt == $value['alt'] && $item->title == $value['title'];
-      $this->assertTrue($assert, format_string('Field item @fid has been successfully synchronized.', array('@fid' => $item->fid)));
-      $fids[$item->fid] = TRUE;
+      $assert = $item->target_id == $source_item->target_id && $item->alt == $value['alt'] && $item->title == $value['title'];
+      $this->assertTrue($assert, format_string('Field item @fid has been successfully synchronized.', array('@fid' => $item->target_id)));
+      $fids[$item->target_id] = TRUE;
     }
 
     // Check that the dropped value is the right one.
@@ -181,7 +181,7 @@ function testImageFieldSync() {
 
     // Add back an item for the dropped value and perform synchronization again.
     $values[$langcode][$removed_fid] = array(
-      'fid' => $removed_fid,
+      'target_id' => $removed_fid,
       'alt' => $langcode . '_' . $removed_fid . '_' . $this->randomName(),
       'title' => $langcode . '_' . $removed_fid . '_' . $this->randomName(),
     );
@@ -198,11 +198,11 @@ function testImageFieldSync() {
       // When adding an item its value is copied over all the target languages,
       // thus in this case the source language needs to be used to check the
       // values instead of the target one.
-      $fid_langcode = $item->fid != $removed_fid ? $default_langcode : $langcode;
-      $value = $values[$fid_langcode][$item->fid];
+      $fid_langcode = $item->target_id != $removed_fid ? $default_langcode : $langcode;
+      $value = $values[$fid_langcode][$item->target_id];
       $source_item = $entity->getTranslation($langcode)->{$this->fieldName}->offsetGet($delta);
-      $assert = $item->fid == $source_item->fid && $item->alt == $value['alt'] && $item->title == $value['title'];
-      $this->assertTrue($assert, format_string('Field item @fid has been successfully synchronized.', array('@fid' => $item->fid)));
+      $assert = $item->target_id == $source_item->target_id && $item->alt == $value['alt'] && $item->title == $value['title'];
+      $this->assertTrue($assert, format_string('Field item @fid has been successfully synchronized.', array('@fid' => $item->target_id)));
     }
   }
 
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
index 633e0cf..282dd65 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
@@ -135,6 +135,6 @@ function saveUserPicture($image) {
 
     // Load actual user data from database.
     $account = user_load($this->web_user->uid, TRUE);
-    return file_load($account->user_picture[Language::LANGCODE_NOT_SPECIFIED][0]['fid'], TRUE);
+    return file_load($account->user_picture[Language::LANGCODE_NOT_SPECIFIED][0]['target_id'], TRUE);
   }
 }
diff --git a/core/modules/user/user.install b/core/modules/user/user.install
index 94c9d5d..02bc63c 100644
--- a/core/modules/user/user.install
+++ b/core/modules/user/user.install
@@ -309,7 +309,7 @@ function user_install_picture_field() {
     'type' => 'image',
     'cardinality' => 1,
     'locked' => FALSE,
-    'indexes' => array('fid' => array('fid')),
+    'indexes' => array('target_id' => array('target_id')),
     'settings' => array(
       'uri_scheme' => 'public',
       'default_image' => FALSE,
@@ -714,7 +714,7 @@ function user_update_8011() {
     'type' => 'image',
     'cardinality' => 1,
     'locked' => FALSE,
-    'indexes' => array('fid' => array('fid')),
+    'indexes' => array('target_id' => array('target_id')),
     'settings' => array(
       'uri_scheme' => 'public',
       'default_image' => FALSE,
@@ -837,7 +837,7 @@ function user_update_8012(&$sandbox) {
           'revision_id' => $uid,
           'langcode' => Language::LANGCODE_NOT_SPECIFIED,
           'delta' => 0,
-          'user_picture_fid' => $fid,
+          'user_picture_target_id' => $fid,
         ))
         ->execute();
       db_insert('field_revision_user_picture')
@@ -848,7 +848,7 @@ function user_update_8012(&$sandbox) {
           'revision_id' => $uid,
           'langcode' => Language::LANGCODE_NOT_SPECIFIED,
           'delta' => 0,
-          'user_picture_fid' => $fid,
+          'user_picture_target_id' => $fid,
         ))
         ->execute();
 
diff --git a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
index 9cfdce9..9df7c23 100644
--- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
@@ -89,7 +89,7 @@ protected function setUp() {
       $term = $this->createTerm($this->vocabulary);
 
       $values = array('created' => $time, 'type' => 'page');
-      $values[$this->field_name][]['tid'] = $term->id();
+      $values[$this->field_name][]['target_id'] = $term->id();
 
       // Make every other node promoted.
       if ($i % 2) {
diff --git a/core/profiles/standard/config/field.field.field_image.yml b/core/profiles/standard/config/field.field.field_image.yml
index 42204e4..e60c96e 100644
--- a/core/profiles/standard/config/field.field.field_image.yml
+++ b/core/profiles/standard/config/field.field.field_image.yml
@@ -28,7 +28,7 @@ cardinality: '1'
 translatable: '0'
 entity_types: {  }
 indexes:
-  fid:
-    - fid
+  target_id:
+    - target_id
 status: 1
 langcode: und
diff --git a/core/profiles/standard/config/field.field.field_tags.yml b/core/profiles/standard/config/field.field.field_tags.yml
index eaa1971..e0f6952 100644
--- a/core/profiles/standard/config/field.field.field_tags.yml
+++ b/core/profiles/standard/config/field.field.field_tags.yml
@@ -17,7 +17,7 @@ cardinality: '-1'
 translatable: '0'
 entity_types: {  }
 indexes:
-  tid:
-    - tid
+  target_id:
+    - target_id
 status: 1
 langcode: und
