diff --git a/core/includes/form.inc b/core/includes/form.inc
index d602d54..5abf669 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -4929,7 +4929,7 @@ function _drupal_form_send_response(Response $response) {
  *
  *   $nodes = entity_load_multiple_by_properties('node', array('uid' => $uid, 'type' => $type));
  *   $node = reset($nodes);
- *   $context['results'][] = $node->nid . ' : ' . check_plain($node->label());
+ *   $context['results'][] = $node->id() . ' : ' . check_plain($node->label());
  *   $context['message'] = check_plain($node->label());
  * }
  *
diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc
index 63118ab..611537b 100644
--- a/core/modules/book/book.admin.inc
+++ b/core/modules/book/book.admin.inc
@@ -86,7 +86,7 @@ function book_admin_edit_submit($form, &$form_state) {
         $node->log = t('Title changed from %original to %current.', array('%original' => $node->title, '%current' => $values['title']));
 
         $node->save();
-        watchdog('content', 'book: updated %title.', array('%title' => $node->label()), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
+        watchdog('content', 'book: updated %title.', array('%title' => $node->label()), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->id()));
       }
     }
   }
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index f548952..d6fd482 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -137,7 +137,7 @@ function book_node_view_link(EntityInterface $node, $view_mode) {
       if (user_access('access printer-friendly version')) {
         $links['book_printer'] = array(
           'title' => t('Printer-friendly version'),
-          'href' => 'book/export/html/' . $node->nid,
+          'href' => 'book/export/html/' . $node->id(),
           'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))
         );
       }
@@ -265,7 +265,7 @@ function _book_outline_remove_access(EntityInterface $node) {
  *   The node to remove from the outline.
  */
 function _book_node_is_removable(EntityInterface $node) {
-  return (!empty($node->book['bid']) && (($node->book['bid'] != $node->nid) || !$node->book['has_children']));
+  return (!empty($node->book['bid']) && (($node->book['bid'] != $node->id()) || !$node->book['has_children']));
 }
 
 /**
@@ -307,7 +307,7 @@ function book_form_node_form_alter(&$form, &$form_state, $form_id) {
   $node = $form_state['controller']->getEntity();
   $access = user_access('administer book outlines');
   if (!$access) {
-    if (user_access('add content to books') && ((!empty($node->book['mlid']) && !empty($node->nid)) || book_type_is_allowed($node->type))) {
+    if (user_access('add content to books') && ((!empty($node->book['mlid']) && !$node->isNew()) || book_type_is_allowed($node->type))) {
       // Already in the book hierarchy, or this node type is allowed.
       $access = TRUE;
     }
@@ -447,11 +447,11 @@ function _book_add_form_elements(&$form, &$form_state, EntityInterface $node) {
     '#description' => t('Pages at a given level are ordered first by weight and then by title.'),
   );
   $options = array();
-  $nid = isset($node->nid) ? $node->nid : 'new';
+  $nid = $node->id() ? $node->id() : 'new';
 
-  if (isset($node->nid) && ($nid == $node->book['original_bid']) && ($node->book['parent_depth_limit'] == 0)) {
+  if ($node->id() && ($nid == $node->book['original_bid']) && ($node->book['parent_depth_limit'] == 0)) {
     // This is the top level node in a maximum depth book and thus cannot be moved.
-    $options[$node->nid] = $node->label();
+    $options[$node->id()] = $node->label();
   }
   else {
     foreach (book_get_books() as $book) {
@@ -519,13 +519,13 @@ function _book_update_outline(EntityInterface $node) {
   }
   $new = empty($node->book['mlid']);
 
-  $node->book['link_path'] = 'node/' . $node->nid;
+  $node->book['link_path'] = 'node/' . $node->id();
   $node->book['link_title'] = $node->label();
   $node->book['parent_mismatch'] = FALSE; // The normal case.
 
-  if ($node->book['bid'] == $node->nid) {
+  if ($node->book['bid'] == $node->id()) {
     $node->book['plid'] = 0;
-    $node->book['menu_name'] = book_menu_name($node->nid);
+    $node->book['menu_name'] = book_menu_name($node->id());
   }
   else {
     // Check in case the parent is not is this book; the book takes precedence.
@@ -548,7 +548,7 @@ function _book_update_outline(EntityInterface $node) {
       // Insert new.
       db_insert('book')
         ->fields(array(
-          'nid' => $node->nid,
+          'nid' => $node->id(),
           'mlid' => $node->book['mlid'],
           'bid' => $node->book['bid'],
         ))
@@ -558,7 +558,7 @@ function _book_update_outline(EntityInterface $node) {
     }
     else {
       if ($node->book['bid'] != db_query("SELECT bid FROM {book} WHERE nid = :nid", array(
-          ':nid' => $node->nid,
+          ':nid' => $node->id(),
         ))->fetchField()) {
         // Update the bid for this page and all children.
         book_update_bid($node->book);
@@ -816,7 +816,7 @@ function book_node_presave(EntityInterface $node) {
     $node->setNewRevision();
   }
   // Make sure a new node gets a new menu link.
-  if (empty($node->nid)) {
+  if ($node->isNew()) {
     $node->book['mlid'] = NULL;
   }
 }
@@ -828,9 +828,9 @@ function book_node_insert(EntityInterface $node) {
   if (!empty($node->book['bid'])) {
     if ($node->book['bid'] == 'new') {
       // New nodes that are their own book.
-      $node->book['bid'] = $node->nid;
+      $node->book['bid'] = $node->id();
     }
-    $node->book['nid'] = $node->nid;
+    $node->book['nid'] = $node->id();
     $node->book['menu_name'] = book_menu_name($node->book['bid']);
     _book_update_outline($node);
   }
@@ -843,9 +843,9 @@ function book_node_update(EntityInterface $node) {
   if (!empty($node->book['bid'])) {
     if ($node->book['bid'] == 'new') {
       // New nodes that are their own book.
-      $node->book['bid'] = $node->nid;
+      $node->book['bid'] = $node->id();
     }
-    $node->book['nid'] = $node->nid;
+    $node->book['nid'] = $node->id();
     $node->book['menu_name'] = book_menu_name($node->book['bid']);
     _book_update_outline($node);
   }
@@ -856,14 +856,14 @@ function book_node_update(EntityInterface $node) {
  */
 function book_node_predelete(EntityInterface $node) {
   if (!empty($node->book['bid'])) {
-    if ($node->nid == $node->book['bid']) {
+    if ($node->id() == $node->book['bid']) {
       // Handle deletion of a top-level post.
       $result = db_query("SELECT b.nid FROM {menu_links} ml INNER JOIN {book} b on b.mlid = ml.mlid WHERE ml.plid = :plid", array(
         ':plid' => $node->book['mlid']
       ));
       foreach ($result as $child) {
-        $child_node = node_load($child->nid);
-        $child_node->book['bid'] = $child_node->nid;
+        $child_node = node_load($child->id());
+        $child_node->book['bid'] = $child_node->id();
         _book_update_outline($child_node);
       }
     }
@@ -884,7 +884,7 @@ function book_node_prepare_form(NodeInterface $node, $form_display, $operation,
     $node->book = array();
 
     $query = \Drupal::request()->query;
-    if (empty($node->nid) && !is_null($query->get('parent')) && is_numeric($query->get('parent'))) {
+    if ($node->isNew() && !is_null($query->get('parent')) && is_numeric($query->get('parent'))) {
       // Handle "Add child page" links:
       $parent = book_link_load($query->get('parent'));
 
@@ -895,7 +895,7 @@ function book_node_prepare_form(NodeInterface $node, $form_display, $operation,
       }
     }
     // Set defaults.
-    $node->book += _book_link_defaults(!empty($node->nid) ? $node->nid : 'new');
+    $node->book += _book_link_defaults(!$node->isNew() ? $node->id() : 'new');
   }
   else {
     if (isset($node->book['bid']) && !isset($node->book['original_bid'])) {
diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc
index bc5ec53..4cd7e25 100644
--- a/core/modules/book/book.pages.inc
+++ b/core/modules/book/book.pages.inc
@@ -115,7 +115,7 @@ function book_outline(EntityInterface $node) {
 function book_outline_form($form, &$form_state, EntityInterface $node) {
   if (!isset($node->book)) {
     // The node is not part of any book yet - set default options.
-    $node->book = _book_link_defaults($node->nid);
+    $node->book = _book_link_defaults($node->id());
   }
   else {
     $node->book['original_bid'] = $node->book['bid'];
@@ -154,7 +154,7 @@ function book_outline_form($form, &$form_state, EntityInterface $node) {
  * @see book_outline_form_submit()
  */
 function book_remove_button_submit($form, &$form_state) {
-  $form_state['redirect'] = 'node/' . $form['#node']->nid . '/outline/remove';
+  $form_state['redirect'] = 'node/' . $form['#node']->id() . '/outline/remove';
 }
 
 /**
@@ -164,7 +164,7 @@ function book_remove_button_submit($form, &$form_state) {
  */
 function book_outline_form_submit($form, &$form_state) {
   $node = $form['#node'];
-  $form_state['redirect'] = "node/" . $node->nid;
+  $form_state['redirect'] = "node/" . $node->id();
   $book_link = $form_state['values']['book'];
   if (!$book_link['bid']) {
     drupal_set_message(t('No changes were made'));
@@ -178,7 +178,7 @@ function book_outline_form_submit($form, &$form_state) {
     if ($node->book['parent_mismatch']) {
       // This will usually only happen when JS is disabled.
       drupal_set_message(t('The post has been added to the selected book. You may now position it relative to other pages.'));
-      $form_state['redirect'] = "node/" . $node->nid . "/outline";
+      $form_state['redirect'] = "node/" . $node->id() . "/outline";
     }
     else {
       drupal_set_message(t('The book outline has been updated.'));
@@ -210,7 +210,7 @@ function book_remove_form($form, &$form_state, EntityInterface $node) {
     $description = t('%title may be added to hierarchy again using the Outline tab.', $title);
   }
 
-  return confirm_form($form, t('Are you sure you want to remove %title from the book hierarchy?', $title), 'node/' . $node->nid, $description, t('Remove'));
+  return confirm_form($form, t('Are you sure you want to remove %title from the book hierarchy?', $title), 'node/' . $node->id(), $description, t('Remove'));
 }
 
 /**
@@ -221,9 +221,9 @@ function book_remove_form_submit($form, &$form_state) {
   if (_book_node_is_removable($node)) {
     menu_link_delete($node->book['mlid']);
     db_delete('book')
-      ->condition('nid', $node->nid)
+      ->condition('nid', $node->id())
       ->execute();
     drupal_set_message(t('The post has been removed from the book.'));
   }
-  $form_state['redirect'] = 'node/' . $node->nid;
+  $form_state['redirect'] = 'node/' . $node->id();
 }
diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
index b13a4e7..c1ed99d 100644
--- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php
+++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
@@ -91,11 +91,11 @@ function createBook() {
      *  |- Node 4
      */
     $nodes = array();
-    $nodes[] = $this->createBookNode($book->nid); // Node 0.
-    $nodes[] = $this->createBookNode($book->nid, $nodes[0]->book['mlid']); // Node 1.
-    $nodes[] = $this->createBookNode($book->nid, $nodes[0]->book['mlid']); // Node 2.
-    $nodes[] = $this->createBookNode($book->nid); // Node 3.
-    $nodes[] = $this->createBookNode($book->nid); // Node 4.
+    $nodes[] = $this->createBookNode($book->id()); // Node 0.
+    $nodes[] = $this->createBookNode($book->id(), $nodes[0]->book['mlid']); // Node 1.
+    $nodes[] = $this->createBookNode($book->id(), $nodes[0]->book['mlid']); // Node 2.
+    $nodes[] = $this->createBookNode($book->id()); // Node 3.
+    $nodes[] = $this->createBookNode($book->id()); // Node 4.
 
     $this->drupalLogout();
 
@@ -126,9 +126,9 @@ function testBook() {
     // Create a second book, and move an existing book page into it.
     $this->drupalLogin($this->book_author);
     $other_book = $this->createBookNode('new');
-    $node = $this->createBookNode($book->nid);
-    $edit = array('book[bid]' => $other_book->nid);
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $node = $this->createBookNode($book->id());
+    $edit = array('book[bid]' => $other_book->id());
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
 
     $this->drupalLogout();
     $this->drupalLogin($this->web_user);
@@ -163,7 +163,7 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F
     // $number does not use drupal_static as it should not be reset
     // since it uniquely identifies each call to checkBookNode().
     static $number = 0;
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
 
     // Check outline structure.
     if ($nodes !== NULL) {
@@ -175,22 +175,22 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F
 
     // Check previous, up, and next links.
     if ($previous) {
-      $this->assertRaw(l('<b>‹</b> ' . $previous->label(), 'node/' . $previous->nid, array('html' => TRUE, 'attributes' => array('rel' => array('prev'), 'title' => t('Go to previous page')))), 'Previous page link found.');
+      $this->assertRaw(l('<b>‹</b> ' . $previous->label(), 'node/' . $previous->id(), array('html' => TRUE, 'attributes' => array('rel' => array('prev'), 'title' => t('Go to previous page')))), 'Previous page link found.');
     }
 
     if ($up) {
-      $this->assertRaw(l('Up', 'node/' . $up->nid, array('html'=> TRUE, 'attributes' => array('title' => t('Go to parent page')))), 'Up page link found.');
+      $this->assertRaw(l('Up', 'node/' . $up->id(), array('html'=> TRUE, 'attributes' => array('title' => t('Go to parent page')))), 'Up page link found.');
     }
 
     if ($next) {
-      $this->assertRaw(l($next->label() . ' <b>›</b>', 'node/' . $next->nid, array('html'=> TRUE, 'attributes' => array('rel' => array('next'), 'title' => t('Go to next page')))), 'Next page link found.');
+      $this->assertRaw(l($next->label() . ' <b>›</b>', 'node/' . $next->id(), array('html'=> TRUE, 'attributes' => array('rel' => array('next'), 'title' => t('Go to next page')))), 'Next page link found.');
     }
 
     // Compute the expected breadcrumb.
     $expected_breadcrumb = array();
     $expected_breadcrumb[] = url('');
     foreach ($breadcrumb as $a_node) {
-      $expected_breadcrumb[] = url('node/' . $a_node->nid);
+      $expected_breadcrumb[] = url('node/' . $a_node->id());
     }
 
     // Fetch links in the current breadcrumb.
@@ -204,7 +204,7 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F
     $this->assertIdentical($expected_breadcrumb, $got_breadcrumb, 'The breadcrumb is correctly displayed on the page.');
 
     // Check printer friendly version.
-    $this->drupalGet('book/export/html/' . $node->nid);
+    $this->drupalGet('book/export/html/' . $node->id());
     $this->assertText($node->label(), 'Printer friendly title found.');
     $this->assertRaw(check_markup($node->body[Language::LANGCODE_NOT_SPECIFIED][0]['value'], $node->body[Language::LANGCODE_NOT_SPECIFIED][0]['format']), 'Printer friendly body found.');
 
@@ -223,10 +223,10 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F
   function generateOutlinePattern($nodes) {
     $outline = '';
     foreach ($nodes as $node) {
-      $outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->label() . ')(.*?)';
+      $outline .= '(node\/' . $node->id() . ')(.*?)(' . $node->label() . ')(.*?)';
     }
 
-    return '/<nav id="book-navigation-' . $this->book->nid . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s';
+    return '/<nav id="book-navigation-' . $this->book->id() . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s';
   }
 
   /**
@@ -275,7 +275,7 @@ function testBookExport() {
 
     // Login as web user and view printer-friendly version.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $this->book->nid);
+    $this->drupalGet('node/' . $this->book->id());
     $this->clickLink(t('Printer-friendly version'));
 
     // Make sure each part of the book is there.
@@ -285,7 +285,7 @@ function testBookExport() {
     }
 
     // Make sure we can't export an unsupported format.
-    $this->drupalGet('book/export/foobar/' . $this->book->nid);
+    $this->drupalGet('book/export/foobar/' . $this->book->id());
     $this->assertResponse('404', 'Unsupported export format returned "not found".');
 
     // Make sure we get a 404 on a not existing book node.
@@ -296,18 +296,18 @@ function testBookExport() {
     $this->drupalLogout();
 
     // Load the book and verify there is no printer-friendly version link.
-    $this->drupalGet('node/' . $this->book->nid);
+    $this->drupalGet('node/' . $this->book->id());
     $this->assertNoLink(t('Printer-friendly version'), 'Anonymous user is not shown link to printer-friendly version.');
 
     // Try getting the URL directly, and verify it fails.
-    $this->drupalGet('book/export/html/' . $this->book->nid);
+    $this->drupalGet('book/export/html/' . $this->book->id());
     $this->assertResponse('403', 'Anonymous user properly forbidden.');
 
     // Now grant anonymous users permission to view the printer-friendly
     // version and verify that node access restrictions still prevent them from
     // seeing it.
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access printer-friendly version'));
-    $this->drupalGet('book/export/html/' . $this->book->nid);
+    $this->drupalGet('book/export/html/' . $this->book->id());
     $this->assertResponse('403', 'Anonymous user properly forbidden from seeing the printer-friendly version when denied by node access.');
   }
 
@@ -352,12 +352,12 @@ function testNavigationBlockOnAccessModuleEnabled() {
 
     // Test correct display of the block to registered users.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $this->book->nid);
+    $this->drupalGet('node/' . $this->book->id());
     $this->assertText($block->label(), 'Book navigation block is displayed to registered users.');
     $this->drupalLogout();
 
     // Test correct display of the block to anonymous users.
-    $this->drupalGet('node/' . $this->book->nid);
+    $this->drupalGet('node/' . $this->book->id());
     $this->assertText($block->label(), 'Book navigation block is displayed to anonymous users.');
 
     // Test the 'book pages' block_mode setting.
@@ -374,19 +374,19 @@ function testBookDelete() {
      $edit = array();
 
      // Test access to delete top-level and child book nodes.
-     $this->drupalGet('node/' . $this->book->nid . '/outline/remove');
+     $this->drupalGet('node/' . $this->book->id() . '/outline/remove');
      $this->assertResponse('403', 'Deleting top-level book node properly forbidden.');
-     $this->drupalPost('node/' . $nodes[4]->nid . '/outline/remove', $edit, t('Remove'));
-     $node4 = node_load($nodes[4]->nid, TRUE);
+     $this->drupalPost('node/' . $nodes[4]->id() . '/outline/remove', $edit, t('Remove'));
+     $node4 = node_load($nodes[4]->id(), TRUE);
      $this->assertTrue(empty($node4->book), 'Deleting child book node properly allowed.');
 
      // Delete all child book nodes and retest top-level node deletion.
      foreach ($nodes as $node) {
-       $nids[] = $node->nid;
+       $nids[] = $node->id();
      }
      entity_delete_multiple('node', $nids);
-     $this->drupalPost('node/' . $this->book->nid . '/outline/remove', $edit, t('Remove'));
-     $node = node_load($this->book->nid, TRUE);
+     $this->drupalPost('node/' . $this->book->id() . '/outline/remove', $edit, t('Remove'));
+     $node = node_load($this->book->id(), TRUE);
      $this->assertTrue(empty($node->book), 'Deleting childless top-level book node properly allowed.');
    }
 
@@ -492,22 +492,22 @@ public function testBookOrdering() {
     $book = $this->book;
 
     $this->drupalLogin($this->admin_user);
-    $node1 = $this->createBookNode($book->nid);
-    $node2 = $this->createBookNode($book->nid);
+    $node1 = $this->createBookNode($book->id());
+    $node2 = $this->createBookNode($book->id());
     $plid = $node1->book['mlid'];
 
     // Head to admin screen and attempt to re-order.
-    $this->drupalGet('admin/structure/book/' . $book->nid);
+    $this->drupalGet('admin/structure/book/' . $book->id());
     $edit = array(
-      "table[book-admin-{$node1->nid}][weight]" => 1,
-      "table[book-admin-{$node2->nid}][weight]" => 2,
+      "table[book-admin-{$node1->id()}][weight]" => 1,
+      "table[book-admin-{$node2->id()}][weight]" => 2,
       // Put node 2 under node 1.
-      "table[book-admin-{$node2->nid}][plid]" => $plid,
+      "table[book-admin-{$node2->id()}][plid]" => $plid,
     );
     $this->drupalPost(NULL, $edit, t('Save book pages'));
     // Verify weight was updated.
-    $this->assertFieldByName("table[book-admin-{$node1->nid}][weight]", 1);
-    $this->assertFieldByName("table[book-admin-{$node2->nid}][weight]", 2);
-    $this->assertFieldByName("table[book-admin-{$node2->nid}][plid]", $plid);
+    $this->assertFieldByName("table[book-admin-{$node1->id()}][weight]", 1);
+    $this->assertFieldByName("table[book-admin-{$node2->id()}][weight]", 2);
+    $this->assertFieldByName("table[book-admin-{$node2->id()}][plid]", $plid);
   }
 }
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index f436966..5bdee72 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -452,7 +452,7 @@ function comment_new_page_count($num_comments, $new_replies, EntityInterface $no
     // 1. Find all the threads with a new comment.
     $unread_threads_query = db_select('comment')
       ->fields('comment', array('thread'))
-      ->condition('nid', $node->nid)
+      ->condition('nid', $node->id())
       ->condition('status', COMMENT_PUBLISHED)
       ->orderBy('created', 'DESC')
       ->orderBy('cid', 'DESC')
@@ -472,7 +472,7 @@ function comment_new_page_count($num_comments, $new_replies, EntityInterface $no
     // Find the number of the first comment of the first unread thread.
     $count = db_query('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND status = :status AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < :thread', array(
       ':status' => COMMENT_PUBLISHED,
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':thread' => $first_thread,
     ))->fetchField();
 
@@ -521,7 +521,7 @@ function comment_node_view(EntityInterface $node, EntityDisplay $display, $view_
       // Add a comments RSS element which is a URL to the comments of this node.
       $node->rss_elements[] = array(
         'key' => 'comments',
-        'value' => url('node/' . $node->nid, array('fragment' => 'comments', 'absolute' => TRUE))
+        'value' => url('node/' . $node->id(), array('fragment' => 'comments', 'absolute' => TRUE))
       );
     }
     elseif ($view_mode == 'teaser') {
@@ -532,16 +532,16 @@ function comment_node_view(EntityInterface $node, EntityDisplay $display, $view_
         if (!empty($node->comment_count)) {
           $links['comment-comments'] = array(
             'title' => format_plural($node->comment_count, '1 comment', '@count comments'),
-            'href' => "node/$node->nid",
+            'href' => 'node/' . $node->id(),
             'attributes' => array('title' => t('Jump to the first comment of this posting.')),
             'fragment' => 'comments',
             'html' => TRUE,
           );
           // Show a link to the first new comment.
-          if ($new = comment_num_new($node->nid)) {
+          if ($new = comment_num_new($node->id())) {
             $links['comment-new-comments'] = array(
               'title' => format_plural($new, '1 new comment', '@count new comments'),
-              'href' => "node/$node->nid",
+              'href' => 'node/' . $node->id(),
               'query' => comment_new_page_count($node->comment_count, $new, $node),
               'attributes' => array('title' => t('Jump to the first new comment of this posting.')),
               'fragment' => 'new',
@@ -555,12 +555,12 @@ function comment_node_view(EntityInterface $node, EntityDisplay $display, $view_
         if (user_access('post comments')) {
           $links['comment-add'] = array(
             'title' => t('Add new comment'),
-            'href' => "node/$node->nid",
+            'href' => 'node/' . $node->id(),
             'attributes' => array('title' => t('Add a new comment to this page.')),
             'fragment' => 'comment-form',
           );
           if ($comment_form_location == COMMENT_FORM_SEPARATE_PAGE) {
-            $links['comment-add']['href'] = "comment/reply/$node->nid";
+            $links['comment-add']['href'] = 'comment/reply/' . $node->id();
           }
         }
         else {
@@ -589,11 +589,11 @@ function comment_node_view(EntityInterface $node, EntityDisplay $display, $view_
             $links['comment-add'] = array(
               'title' => t('Add new comment'),
               'attributes' => array('title' => t('Share your thoughts and opinions related to this posting.')),
-              'href' => "node/$node->nid",
+              'href' => 'node/' . $node->id(),
               'fragment' => 'comment-form',
             );
             if ($comment_form_location == COMMENT_FORM_SEPARATE_PAGE) {
-              $links['comment-add']['href'] = "comment/reply/$node->nid";
+              $links['comment-add']['href'] = 'comment/reply/' . $node->id();
             }
           }
         }
@@ -684,7 +684,7 @@ function comment_node_page_additions(EntityInterface $node) {
  *   The renderable array for the comment addition form.
  */
 function comment_add(EntityInterface $node, $pid = NULL) {
-  $values = array('nid' => $node->nid, 'pid' => $pid, 'node_type' => 'comment_node_' . $node->type);
+  $values = array('nid' => $node->id(), 'pid' => $pid, 'node_type' => 'comment_node_' . $node->type);
   $comment = entity_create('comment', $values);
   return Drupal::entityManager()->getForm($comment);
 }
@@ -761,7 +761,7 @@ function comment_get_thread(EntityInterface $node, $mode, $comments_per_page) {
     ->extend('Drupal\Core\Database\Query\PagerSelectExtender');
   $query->addField('c', 'cid');
   $query
-    ->condition('c.nid', $node->nid)
+    ->condition('c.nid', $node->id())
     ->addTag('node_access')
     ->addTag('comment_filter')
     ->addMetaData('base_table', 'comment')
@@ -771,7 +771,7 @@ function comment_get_thread(EntityInterface $node, $mode, $comments_per_page) {
   $count_query = db_select('comment', 'c');
   $count_query->addExpression('COUNT(*)');
   $count_query
-    ->condition('c.nid', $node->nid)
+    ->condition('c.nid', $node->id())
     ->addTag('node_access')
     ->addTag('comment_filter')
     ->addMetaData('base_table', 'comment')
@@ -1071,7 +1071,7 @@ function comment_form_node_form_alter(&$form, $form_state) {
     ),
     '#weight' => 30,
   );
-  $comment_count = isset($node->nid) ? db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array(':nid' => $node->nid))->fetchField() : 0;
+  $comment_count = $node->id() ? db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array(':nid' => $node->id()))->fetchField() : 0;
   $comment_settings = ($node->comment == COMMENT_NODE_HIDDEN && empty($comment_count)) ? COMMENT_NODE_CLOSED : $node->comment;
   $form['comment_settings']['comment'] = array(
     '#type' => 'radios',
@@ -1114,7 +1114,7 @@ function comment_node_load($nodes, $types) {
   foreach ($nodes as $node) {
     // Store whether comments are enabled for this node.
     if ($node->comment != COMMENT_NODE_HIDDEN) {
-      $comments_enabled[] = $node->nid;
+      $comments_enabled[] = $node->id();
     }
     else {
       $node->cid = 0;
@@ -1156,7 +1156,7 @@ function comment_node_insert(EntityInterface $node) {
   if (variable_get('comment_maintain_node_statistics', TRUE)) {
     db_insert('node_comment_statistics')
       ->fields(array(
-        'nid' => $node->nid,
+        'nid' => $node->id(),
         'cid' => 0,
         'last_comment_timestamp' => $node->changed,
         'last_comment_name' => NULL,
@@ -1171,10 +1171,10 @@ function comment_node_insert(EntityInterface $node) {
  * Implements hook_node_predelete().
  */
 function comment_node_predelete(EntityInterface $node) {
-  $cids = db_query('SELECT cid FROM {comment} WHERE nid = :nid', array(':nid' => $node->nid))->fetchCol();
+  $cids = db_query('SELECT cid FROM {comment} WHERE nid = :nid', array(':nid' => $node->id()))->fetchCol();
   entity_delete_multiple('comment', $cids);
   db_delete('node_comment_statistics')
-    ->condition('nid', $node->nid)
+    ->condition('nid', $node->id())
     ->execute();
 }
 
@@ -1237,7 +1237,7 @@ function comment_update_index() {
 function comment_node_search_result(EntityInterface $node) {
   // Do not make a string if comments are hidden.
   if (user_access('access comments') && $node->comment != COMMENT_NODE_HIDDEN) {
-    $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
+    $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->id()))->fetchField();
     // Do not make a string if comments are closed and there are currently
     // zero comments.
     if ($node->comment != COMMENT_NODE_CLOSED || $comments > 0) {
@@ -1652,10 +1652,10 @@ function theme_comment_post_forbidden($variables) {
       // We cannot use drupal_get_destination() because these links
       // sometimes appear on /node and taxonomy listing pages.
       if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_SEPARATE_PAGE) {
-        $destination = array('destination' => "comment/reply/$node->nid#comment-form");
+        $destination = array('destination' => 'comment/reply/' . $node->id() . '#comment-form');
       }
       else {
-        $destination = array('destination' => "node/$node->nid#comment-form");
+        $destination = array('destination' => 'node/' . $node->id() . '#comment-form');
       }
 
       if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
diff --git a/core/modules/comment/comment.pages.inc b/core/modules/comment/comment.pages.inc
index 4998f83..221fbfc 100644
--- a/core/modules/comment/comment.pages.inc
+++ b/core/modules/comment/comment.pages.inc
@@ -37,7 +37,7 @@
  */
 function comment_reply(EntityInterface $node, $pid = NULL) {
   // Set the breadcrumb trail.
-  drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->label(), 'node/' . $node->nid)));
+  drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->label(), 'node/' . $node->id())));
   $op = Drupal::request()->request->get('op');
   $build = array();
 
@@ -48,7 +48,7 @@ function comment_reply(EntityInterface $node, $pid = NULL) {
     }
     else {
       drupal_set_message(t('You are not authorized to post comments.'), 'error');
-      return new RedirectResponse(url("node/$node->nid", array('absolute' => TRUE)));
+      return new RedirectResponse(url('node/' . $node->id(), array('absolute' => TRUE)));
     }
   }
   else {
@@ -60,22 +60,22 @@ function comment_reply(EntityInterface $node, $pid = NULL) {
         if ($comment->status->value == COMMENT_PUBLISHED) {
           // If that comment exists, make sure that the current comment and the
           // parent comment both belong to the same parent node.
-          if ($comment->nid->target_id != $node->nid) {
+          if ($comment->nid->target_id != $node->id()) {
             // Attempting to reply to a comment not belonging to the current nid.
             drupal_set_message(t('The comment you are replying to does not exist.'), 'error');
-            return new RedirectResponse(url("node/$node->nid", array('absolute' => TRUE)));
+            return new RedirectResponse(url('node/' . $node->id(), array('absolute' => TRUE)));
           }
           // Display the parent comment
           $build['comment_parent'] = comment_view($comment);
         }
         else {
           drupal_set_message(t('The comment you are replying to does not exist.'), 'error');
-          return new RedirectResponse(url("node/$node->nid", array('absolute' => TRUE)));
+          return new RedirectResponse(url('node/' . $node->id(), array('absolute' => TRUE)));
         }
       }
       else {
         drupal_set_message(t('You are not authorized to view comments.'), 'error');
-        return new RedirectResponse(url("node/$node->nid", array('absolute' => TRUE)));
+        return new RedirectResponse(url('node/' . $node->id(), array('absolute' => TRUE)));
       }
     }
     // This is the case where the comment is in response to a node. Display the node.
@@ -86,14 +86,14 @@ function comment_reply(EntityInterface $node, $pid = NULL) {
     // Should we show the reply box?
     if ($node->comment != COMMENT_NODE_OPEN) {
       drupal_set_message(t("This discussion is closed: you can't post new comments."), 'error');
-      return new RedirectResponse(url("node/$node->nid", array('absolute' => TRUE)));
+      return new RedirectResponse(url('node/' . $node->id(), array('absolute' => TRUE)));
     }
     elseif (user_access('post comments')) {
       $build['comment_form'] = comment_add($node, $pid);
     }
     else {
       drupal_set_message(t('You are not authorized to post comments.'), 'error');
-      return new RedirectResponse(url("node/$node->nid", array('absolute' => TRUE)));
+      return new RedirectResponse(url('node/' . $node->id(), array('absolute' => TRUE)));
     }
   }
 
diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc
index 213f352..299d764 100644
--- a/core/modules/comment/comment.tokens.inc
+++ b/core/modules/comment/comment.tokens.inc
@@ -231,7 +231,7 @@ function comment_tokens($type, $tokens, array $data = array(), array $options =
           break;
 
         case 'comment-count-new':
-          $replacements[$original] = comment_num_new($node->nid);
+          $replacements[$original] = comment_num_new($node->id());
           break;
       }
     }
diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
index 2264290..335cdee 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
@@ -346,13 +346,13 @@ public function save(array $form, array &$form_state) {
         $query['page'] = $page;
       }
       // Redirect to the newly posted comment.
-      $redirect = array('node/' . $node->nid, array('query' => $query, 'fragment' => 'comment-' . $comment->id()));
+      $redirect = array('node/' . $node->id(), array('query' => $query, 'fragment' => 'comment-' . $comment->id()));
     }
     else {
       watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject->value), WATCHDOG_WARNING);
       drupal_set_message(t('Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject->value)), 'error');
       // Redirect the user to the node they are commenting on.
-      $redirect = 'node/' . $node->nid;
+      $redirect = 'node/' . $node->id();
     }
     $form_state['redirect'] = $redirect;
     // Clear the block and page caches so that anonymous users see the comment
diff --git a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php
index fe340cf..84ef0c1 100644
--- a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php
+++ b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php
@@ -123,7 +123,7 @@ public function commentPermalink(Request $request, CommentInterface $comment) {
       // Find the current display page for this comment.
       $page = comment_get_display_page($comment->id(), $node->type);
       // @todo: Cleaner sub request handling.
-      $redirect_request = Request::create('/node/' . $node->nid, 'GET', $request->query->all(), $request->cookies->all(), array(), $request->server->all());
+      $redirect_request = Request::create('/node/' . $node->id(), 'GET', $request->query->all(), $request->cookies->all(), array(), $request->server->all());
       $redirect_request->query->set('page', $page);
       // @todo: Convert the pager to use the request object.
       $request->query->set('page', $page);
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php
index 0c7fbff..79e6986 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php
@@ -120,7 +120,7 @@ public function preRender(&$values) {
         ));
 
       foreach ($result as $node) {
-        foreach ($ids[$node->nid] as $id) {
+        foreach ($ids[$node->id()] as $id) {
           $values[$id]->{$this->field_alias} = $node->num_comments;
         }
       }
@@ -134,7 +134,7 @@ function render_link($data, $values) {
         'type' => $this->getValue($values, 'type'),
       ));
       $this->options['alter']['make_link'] = TRUE;
-      $this->options['alter']['path'] = 'node/' . $node->nid;
+      $this->options['alter']['path'] = 'node/' . $node->id();
       $this->options['alter']['query'] = comment_new_page_count($this->getValue($values, 'comment_count'), $this->getValue($values), $node);
       $this->options['alter']['fragment'] = 'new';
     }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
index f4ef8cf..ae1996c 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
@@ -61,7 +61,7 @@ function testAnonymous() {
     $this->drupalLogout();
 
     // Post anonymous comment with contact info (optional).
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $this->assertTrue($this->commentContactInfoAvailable(), 'Contact information available.');
 
     $anonymous_comment2 = $this->postComment($this->node, $this->randomName(), $this->randomName());
@@ -75,7 +75,7 @@ function testAnonymous() {
       'subject' => $this->randomName(),
       "comment_body[$langcode][0][value]" => $this->randomName(),
     );
-    $this->drupalPost('comment/reply/' . $this->node->nid, $edit, t('Save'));
+    $this->drupalPost('comment/reply/' . $this->node->id(), $edit, t('Save'));
     $this->assertText(t('The name you used belongs to a registered user.'));
 
     // Require contact info.
@@ -84,7 +84,7 @@ function testAnonymous() {
     $this->drupalLogout();
 
     // Try to post comment with contact info (required).
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $this->assertTrue($this->commentContactInfoAvailable(), 'Contact information available.');
 
     $anonymous_comment3 = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE);
@@ -133,12 +133,12 @@ function testAnonymous() {
     // Attempt to view comments while disallowed.
     // NOTE: if authenticated user has permission to post comments, then a
     // "Login or register to post comments" type link may be shown.
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertNoPattern('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
     $this->assertNoLink('Add new comment', 'Link to add comment was found.');
 
     // Attempt to view node-comment form while disallowed.
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $this->assertText('You are not authorized to post comments', 'Error attempting to post comment.');
     $this->assertNoFieldByName('subject', '', 'Subject field not found.');
     $this->assertNoFieldByName("comment_body[$langcode][0][value]", '', 'Comment field not found.');
@@ -148,7 +148,7 @@ function testAnonymous() {
       'post comments' => FALSE,
       'skip comment approval' => FALSE,
     ));
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertPattern('@<h2[^>]*>Comments</h2>@', 'Comments were displayed.');
     $this->assertLink('Log in', 1, 'Link to log in was found.');
     $this->assertLink('register', 1, 'Link to register was found.');
@@ -158,12 +158,12 @@ function testAnonymous() {
       'post comments' => TRUE,
       'skip comment approval' => TRUE,
     ));
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertNoPattern('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
     $this->assertFieldByName('subject', '', 'Subject field found.');
     $this->assertFieldByName("comment_body[$langcode][0][value]", '', 'Comment field found.');
 
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $anonymous_comment3->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $anonymous_comment3->id());
     $this->assertText('You are not authorized to view comments', 'Error attempting to post reply.');
     $this->assertNoText($author_name, 'Comment not displayed.');
   }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
index 5c3f157..6f70b0c 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
@@ -47,7 +47,7 @@ function testApprovalAdminInterface() {
     // Get unapproved comment id.
     $this->drupalLogin($this->admin_user);
     $anonymous_comment4 = $this->getUnapprovedComment($subject);
-    $anonymous_comment4 = entity_create('comment', array('cid' => $anonymous_comment4, 'node_type' => '', 'subject' => $subject, 'comment_body' => $body, 'nid' => $this->node->nid));
+    $anonymous_comment4 = entity_create('comment', array('cid' => $anonymous_comment4, 'node_type' => '', 'subject' => $subject, 'comment_body' => $body, 'nid' => $this->node->id()));
     $this->drupalLogout();
 
     $this->assertFalse($this->commentExists($anonymous_comment4), 'Anonymous comment was not published.');
@@ -57,7 +57,7 @@ function testApprovalAdminInterface() {
     $this->performCommentOperation($anonymous_comment4, 'publish', TRUE);
     $this->drupalLogout();
 
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertTrue($this->commentExists($anonymous_comment4), 'Anonymous comment visible.');
 
     // Post 2 anonymous comments without contact info.
@@ -111,7 +111,7 @@ function testApprovalNodeInterface() {
     // Get unapproved comment id.
     $this->drupalLogin($this->admin_user);
     $anonymous_comment4 = $this->getUnapprovedComment($subject);
-    $anonymous_comment4 = entity_create('comment', array('cid' => $anonymous_comment4, 'node_type' => '', 'subject' => $subject, 'comment_body' => $body, 'nid' => $this->node->nid));
+    $anonymous_comment4 = entity_create('comment', array('cid' => $anonymous_comment4, 'node_type' => '', 'subject' => $subject, 'comment_body' => $body, 'nid' => $this->node->id()));
     $this->drupalLogout();
 
     $this->assertFalse($this->commentExists($anonymous_comment4), 'Anonymous comment was not published.');
@@ -122,11 +122,11 @@ function testApprovalNodeInterface() {
     $this->assertResponse(403, 'Forged comment approval was denied.');
     $this->drupalGet('comment/1/approve', array('query' => array('token' => 'forged')));
     $this->assertResponse(403, 'Forged comment approval was denied.');
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->clickLink(t('approve'));
     $this->drupalLogout();
 
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertTrue($this->commentExists($anonymous_comment4), 'Anonymous comment visible.');
   }
 }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php
index 2b506ce..3948995 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentCSSTest.php
@@ -51,7 +51,7 @@ function testCommentClasses() {
 
       // Add a comment.
       $comment = entity_create('comment', array(
-        'nid' => $node->nid,
+        'nid' => $node->id(),
         'node_type' => 'node_type_' . $node->bundle(),
         'uid' => $case['comment_uid'],
         'status' => $case['comment_status'],
@@ -81,7 +81,7 @@ function testCommentClasses() {
           break;
       }
       // Request the node with the comment.
-      $this->drupalGet('node/' . $node->nid);
+      $this->drupalGet('node/' . $node->id());
 
       // Verify classes if the comment is visible for the current user.
       if ($case['comment_status'] == COMMENT_PUBLISHED || $case['user'] == 'admin') {
@@ -129,7 +129,7 @@ function testCommentClasses() {
           $this->assertTrue(count($comments) == 1, 'new class found.');
 
           // Request the node again. The new class should disappear.
-          $this->drupalGet('node/' . $node->nid);
+          $this->drupalGet('node/' . $node->id());
           $comments = $this->xpath('//*[contains(@class, "comment") and contains(@class, "new")]');
           $this->assertFalse(count($comments), 'new class not found.');
         }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
index ecd464a..8928f4f 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
@@ -112,6 +112,6 @@ function testCommentFormat() {
     // Post a comment without an explicit subject.
     $this->drupalLogin($this->web_user);
     $edit = array('comment_body[und][0][value]' => $this->randomName(8));
-    $this->drupalPost('node/' . $this->node->nid, $edit, t('Save'));
+    $this->drupalPost('node/' . $this->node->id(), $edit, t('Save'));
   }
 }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
index ed1a528..02bbaf6 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
@@ -56,7 +56,7 @@ function testCommentInterface() {
     $this->assertTrue($this->commentExists($comment), 'Comment found.');
 
     // Check comment display.
-    $this->drupalGet('node/' . $this->node->nid . '/' . $comment->id());
+    $this->drupalGet('node/' . $this->node->id() . '/' . $comment->id());
     $this->assertText($subject_text, 'Individual comment subject found.');
     $this->assertText($comment_text, 'Individual comment body found.');
 
@@ -75,7 +75,7 @@ function testCommentInterface() {
     $random_name = $this->randomName();
     $this->drupalGet('comment/' . $comment->id() . '/edit');
     $comment = $this->postComment(NULL, $comment->comment_body->value, $comment->subject->value, array('name' => $random_name));
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertText($random_name . ' (' . t('not verified') . ')', 'Comment author successfully changed to an unverified user.');
 
     // Test changing the comment author to a verified user.
@@ -88,7 +88,7 @@ function testCommentInterface() {
     // Reply to comment #2 creating comment #3 with optional preview and no
     // subject though field enabled.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment->id());
     $this->assertText($subject_text, 'Individual comment-reply subject found.');
     $this->assertText($comment_text, 'Individual comment-reply body found.');
     $reply = $this->postComment(NULL, $this->randomName(), '', TRUE);
@@ -98,7 +98,7 @@ function testCommentInterface() {
     $this->assertEqual(rtrim($comment->thread->value, '/') . '.00/', $reply_loaded->thread->value, 'Thread of reply grows correctly.');
 
     // Second reply to comment #3 creating comment #4.
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment->id());
     $this->assertText($subject_text, 'Individual comment-reply subject found.');
     $this->assertText($comment_text, 'Individual comment-reply body found.');
     $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
@@ -115,34 +115,34 @@ function testCommentInterface() {
     $this->setCommentsPerPage(2);
     $comment_new_page = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE);
     $this->assertTrue($this->commentExists($comment_new_page), 'Page one exists. %s');
-    $this->drupalGet('node/' . $this->node->nid, array('query' => array('page' => 1)));
+    $this->drupalGet('node/' . $this->node->id(), array('query' => array('page' => 1)));
     $this->assertTrue($this->commentExists($reply, TRUE), 'Page two exists. %s');
     $this->setCommentsPerPage(50);
 
     // Attempt to reply to an unpublished comment.
     $reply_loaded->status->value = COMMENT_NOT_PUBLISHED;
     $reply_loaded->save();
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $reply_loaded->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $reply_loaded->id());
     $this->assertText(t('The comment you are replying to does not exist.'), 'Replying to an unpublished comment');
 
     // Attempt to post to node with comments disabled.
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_HIDDEN));
     $this->assertTrue($this->node, 'Article node created.');
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $this->assertText('This discussion is closed', 'Posting to node with comments disabled');
     $this->assertNoField('edit-comment', 'Comment body field found.');
 
     // Attempt to post to node with read-only comments.
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_CLOSED));
     $this->assertTrue($this->node, 'Article node created.');
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $this->assertText('This discussion is closed', 'Posting to node with comments read-only');
     $this->assertNoField('edit-comment', 'Comment body field found.');
 
     // Attempt to post to node with comments enabled (check field names etc).
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_OPEN));
     $this->assertTrue($this->node, 'Article node created.');
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $this->assertNoText('This discussion is closed', 'Posting to node with comments enabled');
     $this->assertField('edit-comment-body-' . $langcode . '-0-value', 'Comment body field found.');
 
@@ -152,7 +152,7 @@ function testCommentInterface() {
     $this->deleteComment($comment);
     $this->deleteComment($comment_new_page);
 
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertFalse($this->commentExists($comment), 'Comment not found.');
     $this->assertFalse($this->commentExists($reply, TRUE), 'Reply not found.');
 
@@ -163,7 +163,7 @@ function testCommentInterface() {
 
     // Submit comment through node form.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $form_comment = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
     $this->assertTrue($this->commentExists($form_comment), 'Form comment found.');
 
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
index 1e443ac..84a080e 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
@@ -111,13 +111,13 @@ function testCommentLanguage() {
           'subject' => $this->randomName(),
           "comment_body[$langcode][0][value]" => $comment_values[$node_langcode][$langcode],
         );
-        $this->drupalPost("{$prefix}node/{$node->nid}", $edit, t('Preview'));
+        $this->drupalPost($prefix . 'node/' . $node->id(), $edit, t('Preview'));
         $this->drupalPost(NULL, $edit, t('Save'));
 
         // Check that comment language matches the current content language.
         $cid = db_select('comment', 'c')
           ->fields('c', array('cid'))
-          ->condition('nid', $node->nid)
+          ->condition('nid', $node->id())
           ->orderBy('cid', 'DESC')
           ->range(0, 1)
           ->execute()
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
index a0f0cdc..8c7a8eb 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
@@ -142,7 +142,7 @@ function setEnvironment(array $info) {
         // $this->postComment() relies on actual user permissions.
         $comment = entity_create('comment', array(
           'cid' => NULL,
-          'nid' => $this->node->nid,
+          'nid' => $this->node->id(),
           'node_type' => $this->node->type,
           'pid' => 0,
           'uid' => 0,
@@ -157,7 +157,7 @@ function setEnvironment(array $info) {
 
         // comment_num_new() relies on history_read(), so ensure that no one has
         // seen the node of this comment.
-        db_delete('history')->condition('nid', $this->node->nid)->execute();
+        db_delete('history')->condition('nid', $this->node->id())->execute();
       }
       else {
         $cids = db_query("SELECT cid FROM {comment}")->fetchCol();
@@ -223,7 +223,7 @@ function setEnvironment(array $info) {
   function assertCommentLinks(array $info) {
     $info = $this->setEnvironment($info);
 
-    $nid = $this->node->nid;
+    $nid = $this->node->id();
 
     foreach (array('node', "node/$nid") as $path) {
       $this->drupalGet($path);
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php
index 6d84a76..04fc481 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php
@@ -48,7 +48,7 @@ public function testCommentNewCommentsIndicator() {
     // comment settings so use $comment->save() to avoid complex setup.
     $comment = entity_create('comment', array(
       'cid' => NULL,
-      'nid' => $this->node->nid,
+      'nid' => $this->node->id(),
       'node_type' => $this->node->type,
       'pid' => 0,
       'uid' => $this->loggedInUser->id(),
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php
index 7910196..9a4dc17 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php
@@ -68,19 +68,19 @@ function testThreadedCommentView() {
     $this->assertTrue($this->commentExists($comment), 'Comment found.');
 
     // Check comment display.
-    $this->drupalGet('node/' . $this->node->nid . '/' . $comment->id());
+    $this->drupalGet('node/' . $this->node->id() . '/' . $comment->id());
     $this->assertText($comment_subject, 'Individual comment subject found.');
     $this->assertText($comment_text, 'Individual comment body found.');
 
     // Reply to comment, creating second comment.
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment->id());
     $reply_text = $this->randomName();
     $reply_subject = $this->randomName();
     $reply = $this->postComment(NULL, $reply_text, $reply_subject, TRUE);
     $this->assertTrue($this->commentExists($reply, TRUE), 'Reply found.');
 
     // Go to the node page and verify comment and reply are visible.
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertText($comment_text);
     $this->assertText($comment_subject);
     $this->assertText($reply_text);
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
index 644001c..a082931 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
@@ -45,20 +45,20 @@ function testCommentPaging() {
 
     // Check the first page of the node, and confirm the correct comments are
     // shown.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertRaw(t('next'), 'Paging links found.');
     $this->assertTrue($this->commentExists($comments[0]), 'Comment 1 appears on page 1.');
     $this->assertFalse($this->commentExists($comments[1]), 'Comment 2 does not appear on page 1.');
     $this->assertFalse($this->commentExists($comments[2]), 'Comment 3 does not appear on page 1.');
 
     // Check the second page.
-    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 1)));
+    $this->drupalGet('node/' . $node->id(), array('query' => array('page' => 1)));
     $this->assertTrue($this->commentExists($comments[1]), 'Comment 2 appears on page 2.');
     $this->assertFalse($this->commentExists($comments[0]), 'Comment 1 does not appear on page 2.');
     $this->assertFalse($this->commentExists($comments[2]), 'Comment 3 does not appear on page 2.');
 
     // Check the third page.
-    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 2)));
+    $this->drupalGet('node/' . $node->id(), array('query' => array('page' => 2)));
     $this->assertTrue($this->commentExists($comments[2]), 'Comment 3 appears on page 3.');
     $this->assertFalse($this->commentExists($comments[0]), 'Comment 1 does not appear on page 3.');
     $this->assertFalse($this->commentExists($comments[1]), 'Comment 2 does not appear on page 3.');
@@ -66,27 +66,27 @@ function testCommentPaging() {
     // Post a reply to the oldest comment and test again.
     $replies = array();
     $oldest_comment = reset($comments);
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $oldest_comment->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $oldest_comment->id());
     $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     $this->setCommentsPerPage(2);
     // We are still in flat view - the replies should not be on the first page,
     // even though they are replies to the oldest comment.
-    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0)));
+    $this->drupalGet('node/' . $node->id(), array('query' => array('page' => 0)));
     $this->assertFalse($this->commentExists($reply, TRUE), 'In flat mode, reply does not appear on page 1.');
 
     // If we switch to threaded mode, the replies on the oldest comment
     // should be bumped to the first page and comment 6 should be bumped
     // to the second page.
     $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.');
-    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0)));
+    $this->drupalGet('node/' . $node->id(), array('query' => array('page' => 0)));
     $this->assertTrue($this->commentExists($reply, TRUE), 'In threaded mode, reply appears on page 1.');
     $this->assertFalse($this->commentExists($comments[1]), 'In threaded mode, comment 2 has been bumped off of page 1.');
 
     // If (# replies > # comments per page) in threaded expanded view,
     // the overage should be bumped.
     $reply2 = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
-    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0)));
+    $this->drupalGet('node/' . $node->id(), array('query' => array('page' => 0)));
     $this->assertFalse($this->commentExists($reply2, TRUE), 'In threaded mode where # replies > # comments per page, the newest reply does not appear on page 1.');
 
     $this->drupalLogout();
@@ -114,19 +114,19 @@ function testCommentOrderingThreading() {
     $comments[] = $this->postComment($node, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the second comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $comments[1]->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $comments[1]->id());
     $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the first comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $comments[0]->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $comments[0]->id());
     $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the last comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $comments[2]->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $comments[2]->id());
     $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the second comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $comments[3]->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $comments[3]->id());
     $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     // At this point, the comment tree is:
@@ -149,7 +149,7 @@ function testCommentOrderingThreading() {
       5,
       6,
     );
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertCommentOrder($comments, $expected_order);
 
     $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.');
@@ -163,7 +163,7 @@ function testCommentOrderingThreading() {
       2,
       5,
     );
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertCommentOrder($comments, $expected_order);
   }
 
@@ -214,15 +214,15 @@ function testCommentNewPageIndicator() {
     $comments[] = $this->postComment($node, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the second comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $comments[1]->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $comments[1]->id());
     $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the first comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $comments[0]->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $comments[0]->id());
     $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the last comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $comments[2]->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $comments[2]->id());
     $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
 
     // At this point, the comment tree is:
@@ -244,7 +244,7 @@ function testCommentNewPageIndicator() {
       6 => 0, // Page of comment 0
     );
 
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
     foreach ($expected_pages as $new_replies => $expected_page) {
       $returned = comment_new_page_count($node->comment_count, $new_replies, $node);
       $returned_page = is_array($returned) ? $returned['page'] : 0;
@@ -262,7 +262,7 @@ function testCommentNewPageIndicator() {
       6 => 0, // Page of comment 0
     );
 
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
     foreach ($expected_pages as $new_replies => $expected_page) {
       $returned = comment_new_page_count($node->comment_count, $new_replies, $node);
       $returned_page = is_array($returned) ? $returned['page'] : 0;
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
index 0b7cd20..9d9b7c4 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
@@ -58,7 +58,7 @@ function testCommentPreview() {
     $edit = array();
     $edit['subject'] = $this->randomName(8);
     $edit['comment_body[' . $langcode . '][0][value]'] = $this->randomName(16);
-    $this->drupalPost('node/' . $this->node->nid, $edit, t('Preview'));
+    $this->drupalPost('node/' . $this->node->id(), $edit, t('Preview'));
 
     // Check that the preview is displaying the title and body.
     $this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".');
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentRssTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentRssTest.php
index f8af21b..ab9ab97 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentRssTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentRssTest.php
@@ -35,7 +35,7 @@ function testCommentRss() {
     $this->drupalLogin($this->web_user);
     $comment = $this->postComment($this->node, $this->randomName(), $this->randomName());
     $this->drupalGet('rss.xml');
-    $raw = '<comments>' . url('node/' . $this->node->nid, array('fragment' => 'comments', 'absolute' => TRUE)) . '</comments>';
+    $raw = '<comments>' . url('node/' . $this->node->id(), array('fragment' => 'comments', 'absolute' => TRUE)) . '</comments>';
     $this->assertRaw($raw, 'Comments as part of RSS feed.');
 
     // Hide comments from RSS feed and check presence.
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php
index 06ebf86..2e6aab3 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php
@@ -48,7 +48,7 @@ function testCommentNodeCommentStatistics() {
     $this->drupalLogout();
 
     // Checks the initial values of node comment statistics with no comment.
-    $node = node_load($this->node->nid);
+    $node = node_load($this->node->id());
     $this->assertEqual($node->last_comment_timestamp, $this->node->created, 'The initial value of node last_comment_timestamp is the node created date.');
     $this->assertEqual($node->last_comment_name, NULL, 'The initial value of node last_comment_name is NULL.');
     $this->assertEqual($node->last_comment_uid, $this->web_user->id(), 'The initial value of node last_comment_uid is the node uid.');
@@ -61,7 +61,7 @@ function testCommentNodeCommentStatistics() {
 
     // Checks the new values of node comment statistics with comment #1.
     // The node needs to be reloaded with a node_load_multiple cache reset.
-    $node = node_load($this->node->nid, TRUE);
+    $node = node_load($this->node->id(), TRUE);
     $this->assertEqual($node->last_comment_name, NULL, 'The value of node last_comment_name is NULL.');
     $this->assertEqual($node->last_comment_uid, $this->web_user2->id(), 'The value of node last_comment_uid is the comment #1 uid.');
     $this->assertEqual($node->comment_count, 1, 'The value of node comment_count is 1.');
@@ -78,13 +78,13 @@ function testCommentNodeCommentStatistics() {
     $this->drupalLogout();
 
     // Post comment #2 as anonymous (comment approval enabled).
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $this->postComment($this->node, $this->randomName(), '', TRUE);
 
     // Checks the new values of node comment statistics with comment #2 and
     // ensure they haven't changed since the comment has not been moderated.
     // The node needs to be reloaded with a node_load_multiple cache reset.
-    $node = node_load($this->node->nid, TRUE);
+    $node = node_load($this->node->id(), TRUE);
     $this->assertEqual($node->last_comment_name, NULL, 'The value of node last_comment_name is still NULL.');
     $this->assertEqual($node->last_comment_uid, $this->web_user2->id(), 'The value of node last_comment_uid is still the comment #1 uid.');
     $this->assertEqual($node->comment_count, 1, 'The value of node comment_count is still 1.');
@@ -99,12 +99,12 @@ function testCommentNodeCommentStatistics() {
     $this->drupalLogout();
 
     // Post comment #3 as anonymous.
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->drupalGet('comment/reply/' . $this->node->id());
     $comment_loaded = $this->postComment($this->node, $this->randomName(), '', array('name' => $this->randomName()));
 
     // Checks the new values of node comment statistics with comment #3.
     // The node needs to be reloaded with a node_load_multiple cache reset.
-    $node = node_load($this->node->nid, TRUE);
+    $node = node_load($this->node->id(), TRUE);
     $this->assertEqual($node->last_comment_name, $comment_loaded->name->value, 'The value of node last_comment_name is the name of the anonymous user.');
     $this->assertEqual($node->last_comment_uid, 0, 'The value of node last_comment_uid is zero.');
     $this->assertEqual($node->comment_count, 2, 'The value of node comment_count is 2.');
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
index 0332dd7..0d27bf9 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
@@ -101,7 +101,7 @@ function postComment($node, $comment, $subject = '', $contact = NULL) {
 
     // Must get the page before we test for fields.
     if ($node !== NULL) {
-      $this->drupalGet('comment/reply/' . $node->nid);
+      $this->drupalGet('comment/reply/' . $node->id());
     }
 
     if ($subject_mode == TRUE) {
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
index 98860fc..a36ae73 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
@@ -51,7 +51,7 @@ function testCommentThreading() {
 
     // Reply to comment #1 creating comment #2.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment1->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment1->id());
     $comment2 = $this->postComment(NULL, $this->randomName(), '', TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment2, TRUE), 'Comment #2. Reply found.');
@@ -60,7 +60,7 @@ function testCommentThreading() {
     $this->assertParentLink($comment2->id(), $comment1->id());
 
     // Reply to comment #2 creating comment #3.
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment2->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment2->id());
     $comment3 = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment3, TRUE), 'Comment #3. Second reply found.');
@@ -70,7 +70,7 @@ function testCommentThreading() {
 
     // Reply to comment #1 creating comment #4.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment1->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment1->id());
     $comment4 = $this->postComment(NULL, $this->randomName(), '', TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment4), 'Comment #4. Third reply found.');
@@ -91,7 +91,7 @@ function testCommentThreading() {
 
     // Reply to comment #5 creating comment #6.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment5->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment5->id());
     $comment6 = $this->postComment(NULL, $this->randomName(), '', TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment6, TRUE), 'Comment #6. Reply found.');
@@ -100,7 +100,7 @@ function testCommentThreading() {
     $this->assertParentLink($comment6->id(), $comment5->id());
 
     // Reply to comment #6 creating comment #7.
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment6->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment6->id());
     $comment7 = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment7, TRUE), 'Comment #7. Second reply found.');
@@ -110,7 +110,7 @@ function testCommentThreading() {
 
     // Reply to comment #5 creating comment #8.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment5->id());
+    $this->drupalGet('comment/reply/' . $this->node->id() . '/' . $comment5->id());
     $comment8 = $this->postComment(NULL, $this->randomName(), '', TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment8), 'Comment #8. Third reply found.');
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
index 0880901..bfabb3e 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
@@ -42,7 +42,7 @@ function testCommentTokenReplacement() {
     $parent_comment = $this->postComment($node, $this->randomName(), $this->randomName(), TRUE);
 
     // Post a reply to the comment.
-    $this->drupalGet('comment/reply/' . $node->nid . '/' . $parent_comment->id());
+    $this->drupalGet('comment/reply/' . $node->id() . '/' . $parent_comment->id());
     $child_comment = $this->postComment(NULL, $this->randomName(), $this->randomName());
     $comment = comment_load($child_comment->id());
     $comment->homepage->value = 'http://example.org/';
@@ -96,7 +96,7 @@ function testCommentTokenReplacement() {
     }
 
     // Load node so comment_count gets computed.
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
 
     // Generate comment tokens for the node (it has 2 comments, both new).
     $tests = array();
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php
index 49d6814..296a3e2 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php
@@ -76,7 +76,7 @@ protected function createEntity($values, $langcode, $node_bundle = NULL) {
       $node_bundle = $this->nodeBundle;
     }
     $node = $this->drupalCreateNode(array('type' => $node_bundle));
-    $values['nid'] = $node->nid;
+    $values['nid'] = $node->id();
     $values['uid'] = $node->uid;
     return parent::createEntity($values, $langcode);
   }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/ArgumentUserUIDTest.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/ArgumentUserUIDTest.php
index 40a6f76..e59b8f0 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/Views/ArgumentUserUIDTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/ArgumentUserUIDTest.php
@@ -32,10 +32,10 @@ function testCommentUserUIDTest() {
     $this->executeView($view, array($this->account->id()));
     $result_set = array(
       array(
-        'nid' => $this->node_user_posted->nid,
+        'nid' => $this->node_user_posted->id(),
       ),
       array(
-        'nid' => $this->node_user_commented->nid,
+        'nid' => $this->node_user_commented->id(),
       ),
     );
     $column_map = array('nid' => 'nid');
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php
index 2a14f1f..138c5d0 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php
@@ -45,7 +45,7 @@ function setUp() {
 
     $comment = array(
       'uid' => $this->loggedInUser->id(),
-      'nid' => $this->node_user_commented->nid,
+      'nid' => $this->node_user_commented->id(),
       'cid' => '',
       'pid' => '',
       'node_type' => '',
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php
index ce5bc3e..6ffa95e 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php
@@ -79,7 +79,7 @@ public function setUp() {
     for ($i = 0; $i < $this->masterDisplayResults; $i++) {
       $comment = entity_create('comment', array('node_type' => 'comment_node_' . $this->node->type));
       $comment->uid->target_id = 0;
-      $comment->nid->target_id = $this->node->nid;
+      $comment->nid->target_id = $this->node->id();
       $comment->subject->value = 'Test comment ' . $i;
       $comment->comment_body->value = 'Test body ' . $i;
       $comment->comment_body->format = 'full_html';
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php
index e775687..9132d5a 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php
@@ -44,10 +44,10 @@ function testCommentUserUIDTest() {
     $this->executeView($view, array($this->account->id()));
     $result_set = array(
       array(
-        'nid' => $this->node_user_posted->nid,
+        'nid' => $this->node_user_posted->id(),
       ),
       array(
-        'nid' => $this->node_user_commented->nid,
+        'nid' => $this->node_user_commented->id(),
       ),
     );
     $this->column_map = array('nid' => 'nid');
diff --git a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
index c4f38e9..3c35e48 100644
--- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
@@ -60,9 +60,9 @@ function testDifferentPermissions() {
     // Now, on the front page, all article nodes should have contextual links
     // placeholders, as should the view that contains them.
     $ids = array(
-      'node:node:' . $node1->nid . ':',
-      'node:node:' . $node2->nid . ':',
-      'node:node:' . $node3->nid . ':',
+      'node:node:' . $node1->id() . ':',
+      'node:node:' . $node2->id() . ':',
+      'node:node:' . $node3->id() . ':',
       'views_ui:admin/structure/views/view:frontpage:location=page&name=frontpage&display_id=page_1',
     );
 
diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
index 5e3f663..46c1b1e 100644
--- a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
+++ b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
@@ -320,13 +320,13 @@ private function doNode($type) {
     $this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
     // Edit the node.
     $edit = $this->getContentUpdate($type);
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->assertResponse(200);
     // Delete the node.
-    $this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
+    $this->drupalPost('node/' . $node->id() . '/delete', array(), t('Delete'));
     $this->assertResponse(200);
     // View the node (to generate page not found event).
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertResponse(404);
     // View the database log report (to generate access denied event).
     $this->drupalGet('admin/reports/dblog');
@@ -356,7 +356,7 @@ private function doNode($type) {
     $this->drupalGet('admin/reports/page-not-found');
     $this->assertResponse(200);
     // Verify that the 'page not found' event was recorded.
-    $this->assertText(t('node/@nid', array('@nid' => $node->nid)), 'DBLog event was recorded: [page not found]');
+    $this->assertText(t('node/@nid', array('@nid' => $node->id())), 'DBLog event was recorded: [page not found]');
   }
 
   /**
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
index f064b77..ac9ba47 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
@@ -126,8 +126,8 @@ public function testNodeHandler() {
         ),
         'result' => array(
           'article' => array(
-            $nodes['published1']->nid => $node_labels['published1'],
-            $nodes['published2']->nid => $node_labels['published2'],
+            $nodes['published1']->id() => $node_labels['published1'],
+            $nodes['published2']->id() => $node_labels['published2'],
           ),
         ),
       ),
@@ -138,7 +138,7 @@ public function testNodeHandler() {
         ),
         'result' => array(
           'article' => array(
-            $nodes['published1']->nid => $node_labels['published1'],
+            $nodes['published1']->id() => $node_labels['published1'],
           ),
         ),
       ),
@@ -149,7 +149,7 @@ public function testNodeHandler() {
         ),
         'result' => array(
           'article' => array(
-            $nodes['published2']->nid => $node_labels['published2'],
+            $nodes['published2']->id() => $node_labels['published2'],
           ),
         ),
       ),
@@ -178,9 +178,9 @@ public function testNodeHandler() {
         ),
         'result' => array(
           'article' => array(
-            $nodes['published1']->nid => $node_labels['published1'],
-            $nodes['published2']->nid => $node_labels['published2'],
-            $nodes['unpublished']->nid => $node_labels['unpublished'],
+            $nodes['published1']->id() => $node_labels['published1'],
+            $nodes['published2']->id() => $node_labels['published2'],
+            $nodes['unpublished']->id() => $node_labels['unpublished'],
           ),
         ),
       ),
@@ -190,7 +190,7 @@ public function testNodeHandler() {
         ),
         'result' => array(
           'article' => array(
-            $nodes['unpublished']->nid => $node_labels['unpublished'],
+            $nodes['unpublished']->id() => $node_labels['unpublished'],
           ),
         ),
       ),
@@ -396,7 +396,7 @@ public function testCommentHandler() {
 
     $comment_values = array(
       'published_published' => array(
-        'nid' => $nodes['published']->nid,
+        'nid' => $nodes['published']->id(),
         'uid' => 1,
         'cid' => NULL,
         'pid' => 0,
@@ -405,7 +405,7 @@ public function testCommentHandler() {
         'language' => Language::LANGCODE_NOT_SPECIFIED,
       ),
       'published_unpublished' => array(
-        'nid' => $nodes['published']->nid,
+        'nid' => $nodes['published']->id(),
         'uid' => 1,
         'cid' => NULL,
         'pid' => 0,
@@ -414,7 +414,7 @@ public function testCommentHandler() {
         'language' => Language::LANGCODE_NOT_SPECIFIED,
       ),
       'unpublished_published' => array(
-        'nid' => $nodes['unpublished']->nid,
+        'nid' => $nodes['unpublished']->id(),
         'uid' => 1,
         'cid' => NULL,
         'pid' => 0,
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php
index f7b8fbc..558c1ce 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php
@@ -127,8 +127,8 @@ public function testSort() {
     // expected.
     $result = $handler->getReferenceableEntities();
     $expected_result = array(
-      $nodes['published2']->nid => $node_labels['published2'],
-      $nodes['published1']->nid => $node_labels['published1'],
+      $nodes['published2']->id() => $node_labels['published2'],
+      $nodes['published1']->id() => $node_labels['published1'],
     );
     $this->assertIdentical($result['article'], $expected_result, 'Query sorted by field returned expected values.');
 
@@ -140,8 +140,8 @@ public function testSort() {
     $handler = entity_reference_get_selection_handler($instance);
     $result = $handler->getReferenceableEntities();
     $expected_result = array(
-      $nodes['published1']->nid => $node_labels['published1'],
-      $nodes['published2']->nid => $node_labels['published2'],
+      $nodes['published1']->id() => $node_labels['published1'],
+      $nodes['published2']->id() => $node_labels['published2'],
     );
     $this->assertIdentical($result['article'], $expected_result, 'Query sorted by property returned expected values.');
   }
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php
index 8127682..01cb776 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php
@@ -36,7 +36,7 @@ public function testSelectionHandler() {
 
     $nodes = array();
     foreach (array($node1, $node2, $node3) as $node) {
-      $nodes[$node->type][$node->nid] = $node->label();
+      $nodes[$node->type][$node->id()] = $node->label();
     }
 
     // Create a field and instance.
diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php
index 02fd704..312ebb5 100644
--- a/core/modules/field/field.api.php
+++ b/core/modules/field/field.api.php
@@ -420,7 +420,7 @@ function hook_field_attach_preprocess_alter(&$variables, $context) {
 function hook_field_attach_purge(\Drupal\Core\Entity\EntityInterface $entity, $field, $instance) {
   // find the corresponding data in mymodule and purge it
   if ($entity->entityType() == 'node' && $field->field_name == 'my_field_name') {
-    mymodule_remove_mydata($entity->nid);
+    mymodule_remove_mydata($entity->id());
   }
 }
 
@@ -1122,7 +1122,7 @@ function hook_field_storage_pre_insert(\Drupal\Core\Entity\EntityInterface $enti
     foreach ($entity->taxonomy_forums as $language) {
       foreach ($language as $delta) {
         $query->values(array(
-          'nid' => $entity->nid,
+          'nid' => $entity->id(),
           'title' => $entity->title,
           'tid' => $delta['value'],
           'sticky' => $entity->sticky,
@@ -1158,9 +1158,9 @@ function hook_field_storage_pre_update(\Drupal\Core\Entity\EntityInterface $enti
     // We don't maintain data for old revisions, so clear all previous values
     // from the table. Since this hook runs once per field, per entity, make
     // sure we only wipe values once.
-    if (!isset($first_call[$entity->nid])) {
-      $first_call[$entity->nid] = FALSE;
-      db_delete('forum_index')->condition('nid', $entity->nid)->execute();
+    if (!isset($first_call[$entity->id()])) {
+      $first_call[$entity->id()] = FALSE;
+      db_delete('forum_index')->condition('nid', $entity->id())->execute();
     }
     // Only save data to the table if the node is published.
     if ($entity->status) {
@@ -1168,7 +1168,7 @@ function hook_field_storage_pre_update(\Drupal\Core\Entity\EntityInterface $enti
       foreach ($entity->taxonomy_forums as $language) {
         foreach ($language as $delta) {
           $query->values(array(
-            'nid' => $entity->nid,
+            'nid' => $entity->id(),
             'title' => $entity->title,
             'tid' => $delta['value'],
             'sticky' => $entity->sticky,
@@ -1181,7 +1181,7 @@ function hook_field_storage_pre_update(\Drupal\Core\Entity\EntityInterface $enti
       $query->execute();
       // The logic for determining last_comment_count is fairly complex, so
       // call _forum_update_forum_index() too.
-      _forum_update_forum_index($entity->nid);
+      _forum_update_forum_index($entity->id());
     }
   }
 }
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAccessTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAccessTest.php
index 58fb767..16fabe5 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldAccessTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldAccessTest.php
@@ -85,14 +85,14 @@ function setUp() {
   function testFieldAccess() {
 
     // Assert the text is visible.
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertText($this->test_view_field_value);
 
     // Assert the text is not visible for anonymous users.
     // The field_test module implements hook_field_access() which will
     // specifically target the 'test_view_field' field.
     $this->drupalLogout();
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertNoText($this->test_view_field_value);
   }
 }
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
index 29ba4ef..87e099e 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
@@ -49,7 +49,7 @@ function testNodeDisplay() {
         "fields[$field_name][type]" => $formatter,
       );
       $this->drupalPost("admin/structure/types/manage/$type_name/display", $edit, t('Save'));
-      $this->drupalGet('node/' . $node->nid);
+      $this->drupalGet('node/' . $node->id());
       $this->assertNoText($field_name, format_string('Field label is hidden when no file attached for formatter %formatter', array('%formatter' => $formatter)));
     }
 
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php
index e241dea..d031ffe 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php
@@ -63,7 +63,7 @@ function testFileFieldRSSContent() {
     $test_file = $this->getTestFile('text');
 
     // Create a new node with the uploaded file.
-    $nid = $this->uploadNodeFile($test_file, $field_name, $node->nid);
+    $nid = $this->uploadNodeFile($test_file, $field_name, $node->id());
 
     // Get the uploaded file from the node.
     $node = node_load($nid, TRUE);
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
index 965c44d..3582893 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
@@ -150,7 +150,7 @@ function uploadNodeFile($file, $field_name, $nid_or_type, $new_revision = TRUE,
       // Add a new node.
       $extras['type'] = $nid_or_type;
       $node = $this->drupalCreateNode($extras);
-      $nid = $node->nid;
+      $nid = $node->id();
       // Save at least one revision to better simulate a real site.
       $node->setNewRevision();
       $node->save();
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
index 2267b1a..4b74bfc 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
@@ -301,7 +301,7 @@ function testPrivateFileComment() {
 
     // Unpublishes node.
     $this->drupalLogin($this->admin_user);
-    $this->drupalPost('node/' . $node->nid . '/edit', array(), t('Save and unpublish'));
+    $this->drupalPost('node/' . $node->id() . '/edit', array(), t('Save and unpublish'));
 
     // Ensures normal user can no longer download the file.
     $this->drupalLogin($user);
@@ -321,7 +321,7 @@ function testWidgetValidation() {
     foreach (array('nojs', 'js') as $type) {
       // Create node and prepare files for upload.
       $node = $this->drupalCreateNode(array('type' => 'article'));
-      $nid = $node->nid;
+      $nid = $node->id();
       $this->drupalGet("node/$nid/edit");
       $test_file_text = $this->getTestFile('text');
       $test_file_image = $this->getTestFile('image');
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
index c2bcd47..5039305 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
@@ -242,7 +242,7 @@ function testFilterAdmin() {
     $node = $this->drupalGetNodeByTitle($edit["title"]);
     $this->assertTrue($node, 'Node found in database.');
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertRaw($body . $extra_text, 'Filter removed invalid tag.');
 
     // Use plain text and see if it escapes all tags, whether allowed or not.
@@ -253,8 +253,8 @@ function testFilterAdmin() {
       ->save();
     $edit = array();
     $edit["body[$langcode][0][format]"] = $plain;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
+    $this->drupalGet('node/' . $node->id());
     $this->assertText(check_plain($text), 'The "Plain text" text format escapes all HTML tags.');
     config('filter.settings')
       ->set('always_show_fallback_choice', FALSE)
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php
index 87ca50c..adc4774 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php
@@ -221,7 +221,7 @@ function testFormatWidgetPermissions() {
 
     // Try to edit with a less privileged user.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->clickLink(t('Edit'));
 
     // Verify that body field is read-only and contains replacement value.
@@ -245,7 +245,7 @@ function testFormatWidgetPermissions() {
     // administrator is never forced to switch the text format to something
     // else.)
     $this->drupalLogin($this->filter_admin_user);
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertFieldByXPath("//textarea[@name='$body_value_key' and @disabled='disabled']", t('This field has been disabled because you do not have sufficient permissions to edit it.'), 'Text format access denied message found.');
 
     // Disable the text format used above.
@@ -256,13 +256,13 @@ function testFormatWidgetPermissions() {
     // is still disabled, since the less privileged user should not be able to
     // edit content that does not have an assigned format.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertFieldByXPath("//textarea[@name='$body_value_key' and @disabled='disabled']", t('This field has been disabled because you do not have sufficient permissions to edit it.'), 'Text format access denied message found.');
 
     // Log back in as the filter administrator and verify that the body field
     // can be edited.
     $this->drupalLogin($this->filter_admin_user);
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertNoFieldByXPath("//textarea[@name='$body_value_key' and @disabled='disabled']", NULL, 'Text format access denied message not found.');
     $this->assertFieldByXPath("//select[@name='$body_format_key']", NULL, 'Text format selector found.');
 
@@ -271,16 +271,16 @@ function testFormatWidgetPermissions() {
     $old_title = $new_edit['title'];
     $new_title = $this->randomName(8);
     $edit = array('title' => $new_title);
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->assertText(t('!name field is required.', array('!name' => t('Text format'))), 'Error message is displayed.');
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($old_title, 'Old title found.');
     $this->assertNoText($new_title, 'New title not found.');
 
     // Now select a new text format and make sure the node can be saved.
     $edit[$body_format_key] = filter_fallback_format();
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertUrl('node/' . $node->nid);
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
+    $this->assertUrl('node/' . $node->id());
     $this->assertText($new_title, 'New title found.');
     $this->assertNoText($old_title, 'Old title not found.');
 
@@ -288,8 +288,8 @@ function testFormatWidgetPermissions() {
     // other formats on the site (leaving only the fallback format).
     $this->drupalLogin($this->admin_user);
     $edit = array($body_format_key => $this->allowed_format->format);
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertUrl('node/' . $node->nid);
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
+    $this->assertUrl('node/' . $node->id());
     foreach (filter_formats() as $format) {
       if ($format->format != filter_fallback_format()) {
         $format->disable()->save();
@@ -305,14 +305,14 @@ function testFormatWidgetPermissions() {
     $old_title = $new_title;
     $new_title = $this->randomName(8);
     $edit = array('title' => $new_title);
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->assertText(t('!name field is required.', array('!name' => t('Text format'))), 'Error message is displayed.');
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($old_title, 'Old title found.');
     $this->assertNoText($new_title, 'New title not found.');
     $edit[$body_format_key] = filter_fallback_format();
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertUrl('node/' . $node->nid);
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
+    $this->assertUrl('node/' . $node->id());
     $this->assertText($new_title, 'New title found.');
     $this->assertNoText($old_title, 'Old title not found.');
   }
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
index 644781e..548eb8e 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
@@ -118,7 +118,7 @@ function testImageSource() {
     $edit = array(
       'comment_body[und][0][value]' => implode("\n", $comment),
     );
-    $this->drupalPost('node/' . $this->node->nid, $edit, t('Save'));
+    $this->drupalPost('node/' . $this->node->id(), $edit, t('Save'));
     foreach ($images as $image => $converted) {
       $found = FALSE;
       foreach ($this->xpath('//img[@testattribute="' . hash('sha256', $image) . '"]') as $element) {
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php
index 13b2b04..75af0b0 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php
@@ -74,7 +74,7 @@ function testDisableFilterModule() {
     $node = $this->drupalCreateNode(array('promote' => 1));
     $body_raw = $node->body[Language::LANGCODE_NOT_SPECIFIED][0]['value'];
     $format_id = $node->body[Language::LANGCODE_NOT_SPECIFIED][0]['format'];
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($body_raw, 'Node body found.');
 
     // Enable the filter_test_replace filter.
@@ -84,7 +84,7 @@ function testDisableFilterModule() {
     $this->drupalPost('admin/config/content/formats/manage/' . $format_id, $edit, t('Save configuration'));
 
     // Verify that filter_test_replace filter replaced the content.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertNoText($body_raw, 'Node body not found.');
     $this->assertText('Filter: Testing filter', 'Testing filter output found.');
 
@@ -92,7 +92,7 @@ function testDisableFilterModule() {
     $this->drupalPost('admin/config/content/formats/manage/' . $format_id . '/disable', array(), t('Disable'));
 
     // Verify that the content is empty, because the text format does not exist.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertNoText($body_raw, 'Node body not found.');
   }
 
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 18dd4e9..2d9042d 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -325,7 +325,7 @@ function forum_node_presave(EntityInterface $node) {
       $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();
+        $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->id()))->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('target_id' => $old_tid);
@@ -342,7 +342,7 @@ function forum_node_update(EntityInterface $node) {
   if (_forum_node_check_node_type($node)) {
     // If this is not a new revision and does exist, update the forum record,
     // otherwise insert a new one.
-    if ($node->getRevisionId() == $node->original->getRevisionId() && db_query('SELECT tid FROM {forum} WHERE nid=:nid', array(':nid' => $node->nid))->fetchField()) {
+    if ($node->getRevisionId() == $node->original->getRevisionId() && db_query('SELECT tid FROM {forum} WHERE nid=:nid', array(':nid' => $node->id()))->fetchField()) {
       if (!empty($node->forum_tid)) {
         db_update('forum')
           ->fields(array('tid' => $node->forum_tid))
@@ -352,7 +352,7 @@ function forum_node_update(EntityInterface $node) {
       // The node is removed from the forum.
       else {
         db_delete('forum')
-          ->condition('nid', $node->nid)
+          ->condition('nid', $node->id())
           ->execute();
       }
     }
@@ -362,7 +362,7 @@ function forum_node_update(EntityInterface $node) {
           ->fields(array(
             'tid' => $node->forum_tid,
             'vid' => $node->vid,
-            'nid' => $node->nid,
+            'nid' => $node->id(),
           ))
           ->execute();
       }
@@ -371,12 +371,12 @@ function forum_node_update(EntityInterface $node) {
     // revision.
     if (!empty($node->shadow)) {
       db_delete('forum')
-        ->condition('nid', $node->nid)
+        ->condition('nid', $node->id())
         ->condition('vid', $node->vid)
         ->execute();
       db_insert('forum')
         ->fields(array(
-          'nid' => $node->nid,
+          'nid' => $node->id(),
           'vid' => $node->vid,
           'tid' => $node->forum_tid,
         ))
@@ -395,7 +395,7 @@ function forum_node_insert(EntityInterface $node) {
         ->fields(array(
           'tid' => $node->forum_tid,
           'vid' => $node->vid,
-          'nid' => $node->nid,
+          'nid' => $node->id(),
         ))
         ->execute();
     }
@@ -408,10 +408,10 @@ function forum_node_insert(EntityInterface $node) {
 function forum_node_predelete(EntityInterface $node) {
   if (_forum_node_check_node_type($node)) {
     db_delete('forum')
-      ->condition('nid', $node->nid)
+      ->condition('nid', $node->id())
       ->execute();
     db_delete('forum_index')
-      ->condition('nid', $node->nid)
+      ->condition('nid', $node->id())
       ->execute();
   }
 }
@@ -540,7 +540,7 @@ function forum_field_storage_pre_update(EntityInterface $entity, &$skip_fields)
       // sure we only wipe values once.
       if (!isset($first_call[$entity->nid])) {
         $first_call[$entity->nid] = FALSE;
-        db_delete('forum_index')->condition('nid', $entity->nid)->execute();
+        db_delete('forum_index')->condition('nid', $entity->id())->execute();
       }
       $query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp'));
       foreach ($entity->taxonomy_forums as $language) {
@@ -559,12 +559,12 @@ function forum_field_storage_pre_update(EntityInterface $entity, &$skip_fields)
       $query->execute();
       // The logic for determining last_comment_count is fairly complex, so
       // call _forum_update_forum_index() too.
-      _forum_update_forum_index($entity->nid);
+      _forum_update_forum_index($entity->id());
     }
 
     // When a forum node is unpublished, remove it from the forum_index table.
     else {
-      db_delete('forum_index')->condition('nid', $entity->nid)->execute();
+      db_delete('forum_index')->condition('nid', $entity->id())->execute();
     }
 
   }
@@ -919,8 +919,8 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
         $topic->new = 0;
       }
       else {
-        $history = _forum_user_last_visit($topic->nid);
-        $topic->new_replies = comment_num_new($topic->nid, $history);
+        $history = _forum_user_last_visit($topic->id());
+        $topic->new_replies = comment_num_new($topic->id(), $history);
         $topic->new = $topic->new_replies || ($topic->last_comment_timestamp > $history);
       }
     }
@@ -944,7 +944,7 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
       $last_reply->uid = $topic->last_comment_uid;
       $topic->last_reply = $last_reply;
     }
-    $topics[$topic->nid] = $topic;
+    $topics[$topic->id()] = $topic;
   }
 
   return $topics;
@@ -1129,7 +1129,7 @@ function template_preprocess_forum_topic_list(&$variables) {
       }
       else {
         $variables['topics'][$id]->moved = FALSE;
-        $variables['topics'][$id]->title = l($topic->title, "node/$topic->nid");
+        $variables['topics'][$id]->title = l($topic->title, 'node/' . $topic->id());
         $variables['topics'][$id]->message = '';
       }
       $variables['topics'][$id]->created = theme('forum_submitted', array('topic' => $topic));
@@ -1139,7 +1139,7 @@ function template_preprocess_forum_topic_list(&$variables) {
       $variables['topics'][$id]->new_url = '';
       if ($topic->new_replies) {
         $variables['topics'][$id]->new_text = format_plural($topic->new_replies, '1 new post<span class="visually-hidden"> in topic %title</span>', '@count new posts<span class="visually-hidden"> in topic %title</span>', array('%title' => $variables['topics'][$id]->title));
-        $variables['topics'][$id]->new_url = url("node/$topic->nid", array('query' => comment_new_page_count($topic->comment_count, $topic->new_replies, $topic), 'fragment' => 'new'));
+        $variables['topics'][$id]->new_url = url('node/' . $topic->id(), array('query' => comment_new_page_count($topic->comment_count, $topic->new_replies, $topic), 'fragment' => 'new'));
       }
 
     }
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
index b6349ab..affa43e 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
@@ -105,7 +105,7 @@ public function testActiveForumTopicsBlock() {
       $node = $this->drupalGetNodeByTitle($topics[$index]);
       $date->modify('+1 minute');
       $comment = entity_create('comment', array(
-        'nid' => $node->nid,
+        'nid' => $node->id(),
         'node_type' => 'node_type_' . $node->bundle(),
         'subject' => $this->randomString(20),
         'comment_body' => $this->randomString(256),
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php
index e497f9b..d772adb 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php
@@ -67,8 +67,8 @@ function testForumIndexStatus() {
     $this->assertText($title, 'Published forum topic appears on index.');
 
     // Unpublish the node.
-    $this->drupalPost("node/{$node->nid}/edit", array(), t('Save and unpublish'));
-    $this->drupalGet("node/{$node->nid}");
+    $this->drupalPost('node/' . $node->id() . '/edit', array(), t('Save and unpublish'));
+    $this->drupalGet('node/' . $node->id());
     $this->assertText(t('Access denied'), 'Unpublished node is no longer accessible.');
 
     // Verify that the node no longer appears on the index.
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index 149441f..250b3bf 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -213,13 +213,13 @@ function testForum() {
     $node = $this->createForumTopic($this->forum, FALSE);
     $edit = array();
     $edit['comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]'] = $this->randomName();
-    $this->drupalPost("node/$node->nid", $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id(), $edit, t('Save'));
     $this->assertResponse(200);
 
     // Test editing a forum topic that has a comment.
     $this->drupalLogin($this->edit_any_topics_user);
     $this->drupalGet('forum/' . $this->forum['tid']);
-    $this->drupalPost("node/$node->nid/edit", array(), t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', array(), t('Save'));
     $this->assertResponse(200);
 
     // Test the root forum page title change.
@@ -479,7 +479,7 @@ function testForumWithNewPost() {
     $edit = array();
     $edit['subject'] = $this->randomName();
     $edit['comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]'] = $this->randomName();
-    $this->drupalPost("node/$node->nid", $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id(), $edit, t('Save'));
     $this->assertResponse(200);
 
     // Login as the first user.
@@ -532,7 +532,7 @@ function createForumTopic($forum, $container = FALSE) {
     $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);
+    $this->drupalGet('node/' . $node->id());
     $this->assertRaw($title, 'Subject was found');
     $this->assertRaw($body, 'Body was found');
 
@@ -570,7 +570,7 @@ private function verifyForums($node_user, EntityInterface $node, $admin, $respon
     $this->verifyForumView($this->root_forum);
 
     // View forum node.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertResponse(200);
     $this->assertTitle($node->label() . ' | Drupal', 'Forum node was displayed');
     $breadcrumb = array(
@@ -582,7 +582,7 @@ private function verifyForums($node_user, EntityInterface $node, $admin, $respon
     $this->assertRaw(theme('breadcrumb', array('breadcrumb' => $breadcrumb)), 'Breadcrumbs were displayed');
 
     // View forum edit node.
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertTitle('Edit Forum topic ' . $node->label() . ' | Drupal', 'Forum edit node was displayed');
@@ -592,23 +592,23 @@ private function verifyForums($node_user, EntityInterface $node, $admin, $respon
       // Edit forum node (including moving it to another forum).
       $edit = array();
       $langcode = Language::LANGCODE_NOT_SPECIFIED;
-      $edit["title"] = 'node/' . $node->nid;
+      $edit["title"] = 'node/' . $node->id();
       $edit["body[$langcode][0][value]"] = $this->randomName(256);
       // Assume the topic is initially associated with $forum.
       $edit["taxonomy_forums[$langcode]"] = $this->root_forum['tid'];
       $edit['shadow'] = TRUE;
-      $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+      $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
       $this->assertRaw(t('Forum topic %title has been updated.', array('%title' => $edit["title"])), 'Forum node was edited');
 
       // Verify topic was moved to a different forum.
       $forum_tid = db_query("SELECT tid FROM {forum} WHERE nid = :nid AND vid = :vid", array(
-        ':nid' => $node->nid,
+        ':nid' => $node->id(),
         ':vid' => $node->vid,
       ))->fetchField();
       $this->assertTrue($forum_tid == $this->root_forum['tid'], 'The forum topic is linked to a different forum');
 
       // Delete forum node.
-      $this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
+      $this->drupalPost('node/' . $node->id() . '/delete', array(), t('Delete'));
       $this->assertResponse($response);
       $this->assertRaw(t('Forum topic %title has been deleted.', array('%title' => $edit['title'])), 'Forum node was deleted');
     }
@@ -649,7 +649,7 @@ private function generateForumTopics($forum) {
     $this->nids = array();
     for ($i = 0; $i < 5; $i++) {
       $node = $this->createForumTopic($this->forum, FALSE);
-      $this->nids[] = $node->nid;
+      $this->nids[] = $node->id();
     }
   }
 }
diff --git a/core/modules/history/history.module b/core/modules/history/history.module
index 2a182c0..38dd8ab 100644
--- a/core/modules/history/history.module
+++ b/core/modules/history/history.module
@@ -81,7 +81,7 @@ function history_cron() {
  */
 function history_node_delete(EntityInterface $node) {
   db_delete('history')
-    ->condition('nid', $node->nid)
+    ->condition('nid', $node->id())
     ->execute();
 }
 
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php
index 164cbad..af1a4d6 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php
@@ -157,8 +157,8 @@ function testDefaultImages() {
     );
 
     // Reload the nodes and confirm the field instance defaults are used.
-    $article_built = node_view($article = node_load($article->nid, TRUE));
-    $page_built = node_view($page = node_load($page->nid, TRUE));
+    $article_built = node_view($article = node_load($article->id(), TRUE));
+    $page_built = node_view($page = node_load($page->id(), TRUE));
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]['fid'],
       $default_images['instance']->id(),
@@ -193,8 +193,8 @@ function testDefaultImages() {
     );
 
     // Reload the nodes.
-    $article_built = node_view($article = node_load($article->nid,  TRUE));
-    $page_built = node_view($page = node_load($page->nid, TRUE));
+    $article_built = node_view($article = node_load($article->id(),  TRUE));
+    $page_built = node_view($page = node_load($page->id(), TRUE));
 
     // Confirm the article uses the new default.
     $this->assertEqual(
@@ -228,8 +228,8 @@ function testDefaultImages() {
     );
 
     // Reload the nodes.
-    $article_built = node_view($article = node_load($article->nid, TRUE));
-    $page_built = node_view($page = node_load($page->nid, TRUE));
+    $article_built = node_view($article = node_load($article->id(), TRUE));
+    $page_built = node_view($page = node_load($page->id(), TRUE));
     // Confirm the article uses the new field (not instance) default.
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]['fid'],
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
index e7775ad..8ec6727 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
@@ -218,7 +218,7 @@ function testImageFieldDefaultImage() {
     // Create a new node, with no images and verify that no images are
     // displayed.
     $node = $this->drupalCreateNode(array('type' => 'article'));
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     // Verify that no image is displayed on the page by checking for the class
     // that would be used on the image field.
     $this->assertNoPattern('<div class="(.*?)field-name-' . strtr($field_name, '_', '-') . '(.*?)">', 'No image displayed when no image is attached and no default image specified.');
@@ -235,7 +235,7 @@ function testImageFieldDefaultImage() {
     $image = file_load($field['settings']['default_image']);
     $this->assertTrue($image->isPermanent(), 'The default image status is permanent.');
     $default_output = theme('image', array('uri' => $image->getFileUri()));
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertRaw($default_output, 'Default image displayed when no user supplied image is present.');
 
     // Create a node with an image attached and ensure that the default image
@@ -281,7 +281,7 @@ function testImageFieldDefaultImage() {
     // image is displayed.
     $node = $this->drupalCreateNode(array('type' => 'article'));
     $default_output = theme('image', array('uri' => $image->getFileUri()));
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertRaw($default_output, 'Default private image displayed when no user supplied image is present.');
   }
 }
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
index b53ba51..0c6f84a 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
@@ -123,7 +123,7 @@ function testContentTypeLanguageConfiguration() {
     );
     $node = $this->drupalCreateNode($edit);
     // Edit the content and ensure correct language is selected.
-    $path = 'node/' . $node->nid . '/edit';
+    $path = 'node/' . $node->id() . '/edit';
     $this->drupalGet($path);
     $this->assertRaw('<option value="' . $langcode . '" selected="selected">' .  $name . '</option>', t('Correct language selected.'));
     // Ensure we can change the node language.
@@ -186,26 +186,26 @@ function testContentTypeDirLang() {
 
 
     // Check if English node does not have lang tag.
-    $this->drupalGet('node/' . $nodes['en']->nid);
-    $pattern = '|id="node-' . $nodes['en']->nid . '"[^<>]*lang="en"|';
+    $this->drupalGet('node/' . $nodes['en']->id());
+    $pattern = '|id="node-' . $nodes['en']->id() . '"[^<>]*lang="en"|';
     $this->assertNoPattern($pattern, 'The lang tag has not been assigned to the English node.');
 
     // Check if English node does not have dir tag.
-    $pattern = '|id="node-' . $nodes['en']->nid . '"[^<>]*dir="ltr"|';
+    $pattern = '|id="node-' . $nodes['en']->id() . '"[^<>]*dir="ltr"|';
     $this->assertNoPattern($pattern, 'The dir tag has not been assigned to the English node.');
 
     // Check if Arabic node has lang="ar" & dir="rtl" tags.
-    $this->drupalGet('node/' . $nodes['ar']->nid);
-    $pattern = '|id="node-' . $nodes['ar']->nid . '"[^<>]*lang="ar" dir="rtl"|';
+    $this->drupalGet('node/' . $nodes['ar']->id());
+    $pattern = '|id="node-' . $nodes['ar']->id() . '"[^<>]*lang="ar" dir="rtl"|';
     $this->assertPattern($pattern, 'The lang and dir tags have been assigned correctly to the Arabic node.');
 
     // Check if Spanish node has lang="es" tag.
-    $this->drupalGet('node/' . $nodes['es']->nid);
-    $pattern = '|id="node-' . $nodes['es']->nid . '"[^<>]*lang="es"|';
+    $this->drupalGet('node/' . $nodes['es']->id());
+    $pattern = '|id="node-' . $nodes['es']->id() . '"[^<>]*lang="es"|';
     $this->assertPattern($pattern, 'The lang tag has been assigned correctly to the Spanish node.');
 
     // Check if Spanish node does not have dir="ltr" tag.
-    $pattern = '|id="node-' . $nodes['es']->nid . '"[^<>]*lang="es" dir="ltr"|';
+    $pattern = '|id="node-' . $nodes['es']->id() . '"[^<>]*lang="es" dir="ltr"|';
     $this->assertNoPattern($pattern, 'The dir tag has not been assigned to the Spanish node.');
   }
 
@@ -232,8 +232,8 @@ function testNodeAdminLanguageFilter() {
 
     // Verify filtering by language.
     $this->drupalGet('admin/content', array('query' => array('langcode' => 'zh-hant')));
-    $this->assertLinkByHref('node/' . $node_zh_hant->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $node_en->nid . '/edit');
+    $this->assertLinkByHref('node/' . $node_zh_hant->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $node_en->id() . '/edit');
   }
 
 }
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
index 77b27c8..847047f 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
@@ -78,7 +78,7 @@ function testPathLanguageConfiguration() {
     $path = 'admin/config/search/path/add';
     $english_path = $this->randomName(8);
     $edit = array(
-      'source'   => 'node/' . $node->nid,
+      'source'   => 'node/' . $node->id(),
       'alias'    => $english_path,
       'langcode' => 'en',
     );
@@ -87,7 +87,7 @@ function testPathLanguageConfiguration() {
     // Create a path alias in new custom language.
     $custom_language_path = $this->randomName(8);
     $edit = array(
-      'source'   => 'node/' . $node->nid,
+      'source'   => 'node/' . $node->id(),
       'alias'    => $custom_language_path,
       'langcode' => $langcode,
     );
@@ -106,15 +106,15 @@ function testPathLanguageConfiguration() {
 
     // Check priority of language for alias by source path.
     $edit = array(
-      'source'   => 'node/' . $node->nid,
+      'source'   => 'node/' . $node->id(),
       'alias'    => $custom_path,
       'langcode' => Language::LANGCODE_NOT_SPECIFIED,
     );
     $this->container->get('path.crud')->save($edit['source'], $edit['alias'], $edit['langcode']);
-    $lookup_path = $this->container->get('path.alias_manager')->getPathAlias('node/' . $node->nid, 'en');
+    $lookup_path = $this->container->get('path.alias_manager')->getPathAlias('node/' . $node->id(), 'en');
     $this->assertEqual($english_path, $lookup_path, t('English language alias has priority.'));
     // Same check for language 'xx'.
-    $lookup_path = $this->container->get('path.alias_manager')->getPathAlias('node/' . $node->nid, $prefix);
+    $lookup_path = $this->container->get('path.alias_manager')->getPathAlias('node/' . $node->id(), $prefix);
     $this->assertEqual($custom_language_path, $lookup_path, t('Custom language alias has priority.'));
     $this->container->get('path.crud')->delete($edit);
 
@@ -124,7 +124,7 @@ function testPathLanguageConfiguration() {
 
     // Assign a custom path alias to the first node with the English language.
     $edit = array(
-      'source'   => 'node/' . $first_node->nid,
+      'source'   => 'node/' . $first_node->id(),
       'alias'    => $custom_path,
       'langcode' => 'en',
     );
@@ -132,7 +132,7 @@ function testPathLanguageConfiguration() {
 
     // Assign a custom path alias to second node with Language::LANGCODE_NOT_SPECIFIED.
     $edit = array(
-      'source'   => 'node/' . $second_node->nid,
+      'source'   => 'node/' . $second_node->id(),
       'alias'    => $custom_path,
       'langcode' => Language::LANGCODE_NOT_SPECIFIED,
     );
diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php
index 4a9c187..29d0223 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php
@@ -77,7 +77,7 @@ function testMenuNodeFormWidget() {
     $edit = array(
       'menu[enabled]' => 1,
     );
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     // Assert that there is no link for the node.
     $this->drupalGet('test-page');
     $this->assertNoLink($node_title);
@@ -88,26 +88,26 @@ function testMenuNodeFormWidget() {
       'menu[link_title]' => $node_title,
       'menu[weight]' => 17,
     );
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     // Assert that the link exists.
     $this->drupalGet('test-page');
     $this->assertLink($node_title);
 
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertOptionSelected('edit-menu-weight', 17, 'Menu weight correct in edit form');
 
     // Edit the node and remove the menu link.
     $edit = array(
       'menu[enabled]' => FALSE,
     );
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     // Assert that there is no link for the node.
     $this->drupalGet('test-page');
     $this->assertNoLink($node_title);
 
     // Add a menu link to the Administration menu.
     $item = entity_create('menu_link', array(
-      'link_path' => 'node/' . $node->nid,
+      'link_path' => 'node/' . $node->id(),
       'link_title' => $this->randomName(16),
       'menu_name' => 'admin',
     ));
@@ -115,10 +115,10 @@ function testMenuNodeFormWidget() {
 
     // Assert that disabled Administration menu is not shown on the
     // node/$nid/edit page.
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertText('Provide a menu link', 'Link in not allowed menu not shown in node edit form');
     // Assert that the link is still in the Administration menu after save.
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     $link = menu_link_load($item['mlid']);
     $this->assertTrue($link, 'Link in not allowed menu still exists after saving node');
 
@@ -129,13 +129,13 @@ function testMenuNodeFormWidget() {
     $child_node = $this->drupalCreateNode(array('type' => 'article'));
     // Assign a menu link to the second node, being a child of the first one.
     $child_item = entity_create('menu_link', array(
-      'link_path' => 'node/'. $child_node->nid,
+      'link_path' => 'node/'. $child_node->id(),
       'link_title' => $this->randomName(16),
       'plid' => $item['mlid'],
     ));
     $child_item->save();
     // Edit the first node.
-    $this->drupalGet('node/'. $node->nid .'/edit');
+    $this->drupalGet('node/'. $node->id() .'/edit');
     // Assert that it is not possible to set the parent of the first node to itself or the second node.
     $this->assertNoOption('edit-menu-parent', 'tools:'. $item['mlid']);
     $this->assertNoOption('edit-menu-parent', 'tools:'. $child_item['mlid']);
diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
index 44ea1e0..b444f79 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
@@ -208,9 +208,9 @@ function doMenuTests($menu_name) {
     $node5 = $this->drupalCreateNode(array('type' => 'article'));
 
     // Add menu links.
-    $item1 = $this->addMenuLink(0, 'node/' . $node1->nid, $menu_name);
-    $item2 = $this->addMenuLink($item1['mlid'], 'node/' . $node2->nid, $menu_name, FALSE);
-    $item3 = $this->addMenuLink($item2['mlid'], 'node/' . $node3->nid, $menu_name);
+    $item1 = $this->addMenuLink(0, 'node/' . $node1->id(), $menu_name);
+    $item2 = $this->addMenuLink($item1['mlid'], 'node/' . $node2->id(), $menu_name, FALSE);
+    $item3 = $this->addMenuLink($item2['mlid'], 'node/' . $node3->id(), $menu_name);
     $this->assertMenuLink($item1['mlid'], array(
       'depth' => 1,
       'has_children' => 1,
@@ -245,8 +245,8 @@ function doMenuTests($menu_name) {
     $this->verifyMenuLink($item3, $node3, $item2, $node2);
 
     // Add more menu links.
-    $item4 = $this->addMenuLink(0, 'node/' . $node4->nid, $menu_name);
-    $item5 = $this->addMenuLink($item4['mlid'], 'node/' . $node5->nid, $menu_name);
+    $item4 = $this->addMenuLink(0, 'node/' . $node4->id(), $menu_name);
+    $item5 = $this->addMenuLink($item4['mlid'], 'node/' . $node5->id(), $menu_name);
     $this->assertMenuLink($item4['mlid'], array(
       'depth' => 1,
       'has_children' => 1,
@@ -326,7 +326,7 @@ function doMenuTests($menu_name) {
     // item's weight doesn't get changed because of the old hardcoded delta=50
     $items = array();
     for ($i = -50; $i <= 51; $i++) {
-      $items[$i] = $this->addMenuLink(0, 'node/' . $node1->nid, $menu_name, TRUE, strval($i));
+      $items[$i] = $this->addMenuLink(0, 'node/' . $node1->id(), $menu_name, TRUE, strval($i));
     }
     $this->assertMenuLink($items[51]['mlid'], array('weight' => '51'));
 
@@ -430,7 +430,7 @@ public function testMenuBundles() {
 
     // Test if moving a menu link between menus changes the bundle.
     $node = $this->drupalCreateNode(array('type' => 'article'));
-    $item = $this->addMenuLink(0, 'node/' . $node->nid, 'tools');
+    $item = $this->addMenuLink(0, 'node/' . $node->id(), 'tools');
     $this->moveMenuLink($item, 0, $menu->id());
     $this->assertEqual($item->bundle(), 'tools', 'Menu link bundle matches the menu');
 
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index af081e5..df5f602 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -459,7 +459,7 @@ function menu_node_save(EntityInterface $node) {
     }
     elseif (trim($link['link_title'])) {
       $link['link_title'] = trim($link['link_title']);
-      $link['link_path'] = "node/$node->nid";
+      $link['link_path'] = 'node/' . $node->id();
       if (trim($link['description'])) {
         $link['options']['attributes']['title'] = trim($link['description']);
       }
@@ -481,7 +481,7 @@ function menu_node_save(EntityInterface $node) {
 function menu_node_predelete(EntityInterface $node) {
   // Delete all menu module links that point to this node.
   $query = Drupal::entityQuery('menu_link')
-    ->condition('link_path', 'node/' . $node->nid)
+    ->condition('link_path', 'node/' . $node->id())
     ->condition('module', 'menu');
   $result = $query->execute();
 
@@ -498,13 +498,13 @@ function menu_node_prepare_form(NodeInterface $node, $form_display, $operation,
     // Prepare the node for the edit form so that $node->menu always exists.
     $menu_name = strtok(variable_get('menu_parent_' . $node->type, 'main:0'), ':');
     $menu_link = FALSE;
-    if (isset($node->nid)) {
+    if ($node->id()) {
       $mlid = FALSE;
       // Give priority to the default menu
       $type_menus = variable_get('menu_options_' . $node->type, array('main' => 'main'));
       if (in_array($menu_name, $type_menus)) {
         $query = Drupal::entityQuery('menu_link')
-          ->condition('link_path', 'node/' . $node->nid)
+          ->condition('link_path', 'node/' . $node->id())
           ->condition('menu_name', $menu_name)
           ->condition('module', 'menu')
           ->sort('mlid', 'ASC')
@@ -516,7 +516,7 @@ function menu_node_prepare_form(NodeInterface $node, $form_display, $operation,
       // Check all allowed menus if a link does not exist in the default menu.
       if (!$mlid && !empty($type_menus)) {
         $query = Drupal::entityQuery('menu_link')
-          ->condition('link_path', 'node/' . $node->nid)
+          ->condition('link_path', 'node/' . $node->id())
           ->condition('menu_name', array_values($type_menus), 'IN')
           ->condition('module', 'menu')
           ->sort('mlid', 'ASC')
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 814d937..db6480e 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -39,7 +39,7 @@ protected function prepareEntity() {
     );
 
     // If this is a new node, fill in the default values.
-    if (!isset($node->nid) || isset($node->is_new)) {
+    if ($node->isNew()) {
       foreach (array('status', 'promote', 'sticky') as $key) {
         // Multistep node forms might have filled in something already.
         if (!isset($node->$key)) {
@@ -327,7 +327,7 @@ protected function actions(array $form, array &$form_state) {
   public function validate(array $form, array &$form_state) {
     $node = $this->buildEntity($form, $form_state);
 
-    if (isset($node->nid) && (node_last_changed($node->nid, $this->getFormLangcode($form_state)) > $node->changed)) {
+    if ($node->id() && (node_last_changed($node->id(), $this->getFormLangcode($form_state)) > $node->changed)) {
       form_set_error('changed', t('The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved.'));
     }
 
@@ -434,9 +434,9 @@ public function unpublish(array $form, array &$form_state) {
    */
   public function save(array $form, array &$form_state) {
     $node = $this->entity;
-    $insert = empty($node->nid);
+    $insert = $node->isNew();
     $node->save();
-    $node_link = l(t('view'), 'node/' . $node->nid);
+    $node_link = l(t('view'), 'node/' . $node->id());
     $watchdog_args = array('@type' => $node->type, '%title' => $node->label());
     $t_args = array('@type' => node_get_type_label($node), '%title' => $node->label());
 
@@ -449,10 +449,10 @@ public function save(array $form, array &$form_state) {
       drupal_set_message(t('@type %title has been updated.', $t_args));
     }
 
-    if ($node->nid) {
-      $form_state['values']['nid'] = $node->nid;
-      $form_state['nid'] = $node->nid;
-      $form_state['redirect'] = node_access('view', $node) ? 'node/' . $node->nid : '<front>';
+    if ($node->id()) {
+      $form_state['values']['nid'] = $node->id();
+      $form_state['nid'] = $node->id();
+      $form_state['redirect'] = node_access('view', $node) ? 'node/' . $node->id() : '<front>';
     }
     else {
       // In the unlikely case something went wrong on save, the node will be
@@ -476,7 +476,7 @@ public function delete(array $form, array &$form_state) {
       $query->remove('destination');
     }
     $node = $this->entity;
-    $form_state['redirect'] = array('node/' . $node->nid . '/delete', array('query' => $destination));
+    $form_state['redirect'] = array('node/' . $node->id() . '/delete', array('query' => $destination));
   }
 
 }
diff --git a/core/modules/node/lib/Drupal/node/NodeRenderController.php b/core/modules/node/lib/Drupal/node/NodeRenderController.php
index a58a96f..e7fb844 100644
--- a/core/modules/node/lib/Drupal/node/NodeRenderController.php
+++ b/core/modules/node/lib/Drupal/node/NodeRenderController.php
@@ -82,8 +82,8 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang
    */
   protected function alterBuild(array &$build, EntityInterface $entity, EntityDisplay $display, $view_mode, $langcode = NULL) {
     parent::alterBuild($build, $entity, $display, $view_mode, $langcode);
-    if (!empty($entity->nid)) {
-      $build['#contextual_links']['node'] = array('node', array($entity->nid));
+    if ($entity->id()) {
+      $build['#contextual_links']['node'] = array('node', array($entity->id()));
     }
   }
 
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/argument_default/Node.php b/core/modules/node/lib/Drupal/node/Plugin/views/argument_default/Node.php
index f35eb9e..6886332 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/argument_default/Node.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/argument_default/Node.php
@@ -28,7 +28,7 @@ public function getArgument() {
     foreach (range(1, 3) as $i) {
       $node = menu_get_object('node', $i);
       if (!empty($node)) {
-        return $node->nid;
+        return $node->id();
       }
     }
 
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/argument_validator/Node.php b/core/modules/node/lib/Drupal/node/Plugin/views/argument_validator/Node.php
index 0234629..36f3ab0 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/argument_validator/Node.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/argument_validator/Node.php
@@ -132,7 +132,7 @@ public function validateArgument($argument) {
           }
 
           $titles[] = check_plain($node->label());
-          unset($test[$node->nid]);
+          unset($test[$node->id()]);
         }
 
         $this->argument->validated_title = implode($nids->operator == 'or' ? ' + ' : ', ', $titles);
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php
index 8327bcf..dedf3b1 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php
@@ -54,7 +54,7 @@ function render($values) {
   function render_link($node, $values) {
     if (node_access('view', $node)) {
       $this->options['alter']['make_link'] = TRUE;
-      $this->options['alter']['path'] = "node/$node->nid";
+      $this->options['alter']['path'] = 'node/' . $node->id();
       $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
       return $text;
     }
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php
index 51cc3fe..57000a0 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php
@@ -29,7 +29,7 @@ function render_link($node, $values) {
     }
 
     $this->options['alter']['make_link'] = TRUE;
-    $this->options['alter']['path'] = "node/$node->nid/delete";
+    $this->options['alter']['path'] = 'node/' . $node->id() . '/delete';
     $this->options['alter']['query'] = drupal_get_destination();
 
     $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php
index 2ffb49c..1d68115 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php
@@ -35,7 +35,7 @@ function render_link($data, $values) {
     }
 
     $this->options['alter']['make_link'] = TRUE;
-    $this->options['alter']['path'] = 'node/' . $node->nid . "/revisions/$vid/delete";
+    $this->options['alter']['path'] = 'node/' . $node->id() . "/revisions/$vid/delete";
     $this->options['alter']['query'] = drupal_get_destination();
 
     return !empty($this->options['text']) ? $this->options['text'] : t('Delete');
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php
index 8f9671c..19f93ad 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php
@@ -35,7 +35,7 @@ function render_link($data, $values) {
     }
 
     $this->options['alter']['make_link'] = TRUE;
-    $this->options['alter']['path'] = 'node/' . $node->nid . "/revisions/$vid/revert";
+    $this->options['alter']['path'] = 'node/' . $node->id() . "/revisions/$vid/revert";
     $this->options['alter']['query'] = drupal_get_destination();
 
     return !empty($this->options['text']) ? $this->options['text'] : t('Revert');
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
index 49cc52a..a15a021 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
@@ -125,7 +125,7 @@ function render($row) {
       ),
       array(
         'key' => 'guid',
-        'value' => $node->nid . ' at ' . $base_url,
+        'value' => $node->id() . ' at ' . $base_url,
         'attributes' => array('isPermaLink' => 'false'),
       ),
     );
@@ -167,7 +167,7 @@ function render($row) {
     $item->title = $node->label();
     $item->link = $node->link;
     $item->elements = $node->rss_elements;
-    $item->nid = $node->nid;
+    $item->nid = $node->id();
     $theme_function = array(
       '#theme' => $this->themeFunctions(),
       '#view' => $this->view,
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php
index e1a33aa..8b4bf7a 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php
@@ -90,12 +90,12 @@ function testNodeAccessAdministerField() {
 
     // Log in as the administrator and confirm that the field value is present.
     $this->drupalLogin($this->admin_user);
-    $this->drupalGet("node/{$node->nid}");
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($value, 'The saved field value is visible to an administrator.');
 
     // Log in as the content admin and try to view the node.
     $this->drupalLogin($this->content_admin_user);
-    $this->drupalGet("node/{$node->nid}");
+    $this->drupalGet('node/' . $node->id());
     $this->assertText('Access denied', 'Access is denied for the content admin.');
 
     // Modify the field default as the content admin.
@@ -112,7 +112,7 @@ function testNodeAccessAdministerField() {
     $this->drupalLogin($this->admin_user);
 
     // Confirm that the existing node still has the correct field value.
-    $this->drupalGet("node/{$node->nid}");
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($value, 'The original field value is visible to an administrator.');
 
     // Confirm that the new default value appears when creating a new node.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareCombinationTest.php
index 4a6429b..eef96b1 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareCombinationTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareCombinationTest.php
@@ -259,10 +259,10 @@ function testNodeAccessLanguageAwareCombination() {
     // Four nodes should be returned with public Hungarian translations or the
     // no language public node.
     $this->assertEqual(count($nids), 4, 'db_select() returns 4 nodes when no langcode is specified.');
-    $this->assertTrue(array_key_exists($this->nodes['public_both_public']->nid, $nids), 'Returned node ID is full public node.');
-    $this->assertTrue(array_key_exists($this->nodes['public_ca_private']->nid, $nids), 'Returned node ID is Hungarian public only node.');
-    $this->assertTrue(array_key_exists($this->nodes['private_both_public']->nid, $nids), 'Returned node ID is both public non-language-aware private only node.');
-    $this->assertTrue(array_key_exists($this->nodes['public_no_language_public']->nid, $nids), 'Returned node ID is no language public node.');
+    $this->assertTrue(array_key_exists($this->nodes['public_both_public']->id(), $nids), 'Returned node ID is full public node.');
+    $this->assertTrue(array_key_exists($this->nodes['public_ca_private']->id(), $nids), 'Returned node ID is Hungarian public only node.');
+    $this->assertTrue(array_key_exists($this->nodes['private_both_public']->id(), $nids), 'Returned node ID is both public non-language-aware private only node.');
+    $this->assertTrue(array_key_exists($this->nodes['public_no_language_public']->id(), $nids), 'Returned node ID is no language public node.');
 
     // Query with Hungarian (hu) specified.
     $select = db_select('node', 'n')
@@ -274,9 +274,9 @@ function testNodeAccessLanguageAwareCombination() {
 
     // Three nodes should be returned (with public Hungarian translations).
     $this->assertEqual(count($nids), 3, 'db_select() returns 3 nodes.');
-    $this->assertTrue(array_key_exists($this->nodes['public_both_public']->nid, $nids), 'Returned node ID is both public node.');
-    $this->assertTrue(array_key_exists($this->nodes['public_ca_private']->nid, $nids), 'Returned node ID is Hungarian public only node.');
-    $this->assertTrue(array_key_exists($this->nodes['private_both_public']->nid, $nids), 'Returned node ID is both public non-language-aware private only node.');
+    $this->assertTrue(array_key_exists($this->nodes['public_both_public']->id(), $nids), 'Returned node ID is both public node.');
+    $this->assertTrue(array_key_exists($this->nodes['public_ca_private']->id(), $nids), 'Returned node ID is Hungarian public only node.');
+    $this->assertTrue(array_key_exists($this->nodes['private_both_public']->id(), $nids), 'Returned node ID is both public non-language-aware private only node.');
 
     // Query with Catalan (ca) specified.
     $select = db_select('node', 'n')
@@ -288,9 +288,9 @@ function testNodeAccessLanguageAwareCombination() {
 
     // Three nodes should be returned (with public Catalan translations).
     $this->assertEqual(count($nids), 3, 'db_select() returns 3 nodes.');
-    $this->assertTrue(array_key_exists($this->nodes['public_both_public']->nid, $nids), 'Returned node ID is both public node.');
-    $this->assertTrue(array_key_exists($this->nodes['public_hu_private']->nid, $nids), 'Returned node ID is Catalan public only node.');
-    $this->assertTrue(array_key_exists($this->nodes['private_both_public']->nid, $nids), 'Returned node ID is both public non-language-aware private only node.');
+    $this->assertTrue(array_key_exists($this->nodes['public_both_public']->id(), $nids), 'Returned node ID is both public node.');
+    $this->assertTrue(array_key_exists($this->nodes['public_hu_private']->id(), $nids), 'Returned node ID is Catalan public only node.');
+    $this->assertTrue(array_key_exists($this->nodes['private_both_public']->id(), $nids), 'Returned node ID is both public non-language-aware private only node.');
 
     // Query with German (de) specified.
     $select = db_select('node', 'n')
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareTest.php
index 0fdd4a9..9344ec5 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageAwareTest.php
@@ -200,9 +200,9 @@ function testNodeAccessLanguageAware() {
     // - Node with only the Catalan translation marked as private.
     // - No language node marked as public.
     $this->assertEqual(count($nids), 3, 'db_select() returns 3 nodes when no langcode is specified.');
-    $this->assertTrue(array_key_exists($this->nodes['both_public']->nid, $nids), 'The node with both translations public is returned.');
-    $this->assertTrue(array_key_exists($this->nodes['ca_private']->nid, $nids), 'The node with only the Catalan translation private is returned.');
-    $this->assertTrue(array_key_exists($this->nodes['no_language_public']->nid, $nids), 'The node with no language is returned.');
+    $this->assertTrue(array_key_exists($this->nodes['both_public']->id(), $nids), 'The node with both translations public is returned.');
+    $this->assertTrue(array_key_exists($this->nodes['ca_private']->id(), $nids), 'The node with only the Catalan translation private is returned.');
+    $this->assertTrue(array_key_exists($this->nodes['no_language_public']->id(), $nids), 'The node with no language is returned.');
 
     // Query with Hungarian (hu) specified.
     $select = db_select('node', 'n')
@@ -215,8 +215,8 @@ function testNodeAccessLanguageAware() {
     // Two nodes should be returned: the node with both translations public, and
     // the node with only the Catalan translation marked as private.
     $this->assertEqual(count($nids), 2, 'db_select() returns 2 nodes when the hu langcode is specified.');
-    $this->assertTrue(array_key_exists($this->nodes['both_public']->nid, $nids), 'The node with both translations public is returned.');
-    $this->assertTrue(array_key_exists($this->nodes['ca_private']->nid, $nids), 'The node with only the Catalan translation private is returned.');
+    $this->assertTrue(array_key_exists($this->nodes['both_public']->id(), $nids), 'The node with both translations public is returned.');
+    $this->assertTrue(array_key_exists($this->nodes['ca_private']->id(), $nids), 'The node with only the Catalan translation private is returned.');
 
     // Query with Catalan (ca) specified.
     $select = db_select('node', 'n')
@@ -229,8 +229,8 @@ function testNodeAccessLanguageAware() {
     // Two nodes should be returned: the node with both translations public, and
     // the node with only the Hungarian translation marked as private.
     $this->assertEqual(count($nids), 2, 'db_select() returns 2 nodes when the hu langcode is specified.');
-    $this->assertTrue(array_key_exists($this->nodes['both_public']->nid, $nids), 'The node with both translations public is returned.');
-    $this->assertTrue(array_key_exists($this->nodes['hu_private']->nid, $nids), 'The node with only the Hungarian translation private is returned.');
+    $this->assertTrue(array_key_exists($this->nodes['both_public']->id(), $nids), 'The node with both translations public is returned.');
+    $this->assertTrue(array_key_exists($this->nodes['hu_private']->id(), $nids), 'The node with only the Hungarian translation private is returned.');
 
     // Query with German (de) specified.
     $select = db_select('node', 'n')
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php
index 2a55f16..54ba085 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php
@@ -202,8 +202,8 @@ function testNodeAccessQueryTag() {
     // The public node and no language node should be returned. Because no
     // langcode is given it will use the fallback node.
     $this->assertEqual(count($nids), 2, 'db_select() returns 2 node');
-    $this->assertTrue(array_key_exists($node_public->nid, $nids), 'Returned node ID is public node.');
-    $this->assertTrue(array_key_exists($node_no_language->nid, $nids), 'Returned node ID is no language node.');
+    $this->assertTrue(array_key_exists($node_public->id(), $nids), 'Returned node ID is public node.');
+    $this->assertTrue(array_key_exists($node_no_language->id(), $nids), 'Returned node ID is no language node.');
 
     // Query the nodes table as the web user with the node access tag and
     // langcode de.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
index 6063677..7b2cfe3 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
@@ -47,7 +47,7 @@ public function testCommentPager() {
     // Create 60 comments.
     for ($i = 0; $i < 60; $i++) {
       $comment = entity_create('comment', array(
-        'nid' => $node->nid,
+        'nid' => $node->id(),
         'node_type' => 'node_type_' . $node->bundle(),
         'subject' => $this->randomName(),
         'comment_body' => array(
@@ -61,7 +61,7 @@ public function testCommentPager() {
 
     // View the node page. With the default 50 comments per page there should
     // be two pages (0, 1) but no third (2) page.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($node->label());
     $this->assertText(t('Comments'));
     $this->assertRaw('page=1');
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
index e2b4c07..0cd54af 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
@@ -33,41 +33,41 @@ public static function getInfo() {
   function testNodeAccessRecords() {
     // Create an article node.
     $node1 = $this->drupalCreateNode(array('type' => 'article'));
-    $this->assertTrue(node_load($node1->nid), 'Article node created.');
+    $this->assertTrue(node_load($node1->id()), 'Article node created.');
 
     // Check to see if grants added by node_test_node_access_records made it in.
-    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node1->nid))->fetchAll();
+    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node1->id()))->fetchAll();
     $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
     $this->assertEqual($records[0]->realm, 'test_article_realm', 'Grant with article_realm acquired for node without alteration.');
     $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.');
 
     // Create an unpromoted "Basic page" node.
     $node2 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 0));
-    $this->assertTrue(node_load($node2->nid), 'Unpromoted basic page node created.');
+    $this->assertTrue(node_load($node2->id()), 'Unpromoted basic page node created.');
 
     // Check to see if grants added by node_test_node_access_records made it in.
-    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node2->nid))->fetchAll();
+    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node2->id()))->fetchAll();
     $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
     $this->assertEqual($records[0]->realm, 'test_page_realm', 'Grant with page_realm acquired for node without alteration.');
     $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.');
 
     // Create an unpromoted, unpublished "Basic page" node.
     $node3 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 0, 'status' => 0));
-    $this->assertTrue(node_load($node3->nid), 'Unpromoted, unpublished basic page node created.');
+    $this->assertTrue(node_load($node3->id()), 'Unpromoted, unpublished basic page node created.');
 
     // Check to see if grants added by node_test_node_access_records made it in.
-    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node3->nid))->fetchAll();
+    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node3->id()))->fetchAll();
     $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
     $this->assertEqual($records[0]->realm, 'test_page_realm', 'Grant with page_realm acquired for node without alteration.');
     $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.');
 
     // Create a promoted "Basic page" node.
     $node4 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1));
-    $this->assertTrue(node_load($node4->nid), 'Promoted basic page node created.');
+    $this->assertTrue(node_load($node4->id()), 'Promoted basic page node created.');
 
     // Check to see if grant added by node_test_node_access_records was altered
     // by node_test_node_access_records_alter.
-    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node4->nid))->fetchAll();
+    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node4->id()))->fetchAll();
     $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
     $this->assertEqual($records[0]->realm, 'test_alter_realm', 'Altered grant with alter_realm acquired for node.');
     $this->assertEqual($records[0]->gid, 2, 'Altered grant with gid = 2 acquired for node.');
@@ -86,7 +86,7 @@ function testNodeAccessRecords() {
     // Check that core does not grant access to an unpublished node when an
     // empty $grants array is returned.
     $node6 = $this->drupalCreateNode(array('status' => 0, 'disable_node_access' => TRUE));
-    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node6->nid))->fetchAll();
+    $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node6->id()))->fetchAll();
     $this->assertEqual(count($records), 0, 'Returned no records for unpublished node.');
   }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php
index 73d8a3b..1af4979 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php
@@ -103,61 +103,61 @@ function testContentAdminPages() {
     $this->drupalGet('admin/content');
     $this->assertResponse(200);
     foreach ($nodes as $node) {
-      $this->assertLinkByHref('node/' . $node->nid);
-      $this->assertLinkByHref('node/' . $node->nid . '/edit');
-      $this->assertLinkByHref('node/' . $node->nid . '/delete');
+      $this->assertLinkByHref('node/' . $node->id());
+      $this->assertLinkByHref('node/' . $node->id() . '/edit');
+      $this->assertLinkByHref('node/' . $node->id() . '/delete');
     }
 
     // Verify filtering by publishing status.
     $this->drupalGet('admin/content', array('query' => array('status' => TRUE)));
 
-    $this->assertLinkByHref('node/' . $nodes['published_page']->nid . '/edit');
-    $this->assertLinkByHref('node/' . $nodes['published_article']->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/edit');
+    $this->assertLinkByHref('node/' . $nodes['published_page']->id() . '/edit');
+    $this->assertLinkByHref('node/' . $nodes['published_article']->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->id() . '/edit');
 
     // Verify filtering by status and content type.
     $this->drupalGet('admin/content', array('query' => array('status' => TRUE, 'type' => 'page')));
 
-    $this->assertLinkByHref('node/' . $nodes['published_page']->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $nodes['published_article']->nid . '/edit');
+    $this->assertLinkByHref('node/' . $nodes['published_page']->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $nodes['published_article']->id() . '/edit');
 
     // Verify no operation links are displayed for regular users.
     $this->drupalLogout();
     $this->drupalLogin($this->base_user_1);
     $this->drupalGet('admin/content');
     $this->assertResponse(200);
-    $this->assertLinkByHref('node/' . $nodes['published_page']->nid);
-    $this->assertLinkByHref('node/' . $nodes['published_article']->nid);
-    $this->assertNoLinkByHref('node/' . $nodes['published_page']->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $nodes['published_page']->nid . '/delete');
-    $this->assertNoLinkByHref('node/' . $nodes['published_article']->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $nodes['published_article']->nid . '/delete');
+    $this->assertLinkByHref('node/' . $nodes['published_page']->id());
+    $this->assertLinkByHref('node/' . $nodes['published_article']->id());
+    $this->assertNoLinkByHref('node/' . $nodes['published_page']->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $nodes['published_page']->id() . '/delete');
+    $this->assertNoLinkByHref('node/' . $nodes['published_article']->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $nodes['published_article']->id() . '/delete');
 
     // Verify no unpublished content is displayed without permission.
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid);
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/delete');
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->id());
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->id() . '/delete');
 
     // Verify no tableselect.
-    $this->assertNoFieldByName('nodes[' . $nodes['published_page']->nid . ']', '', 'No tableselect found.');
+    $this->assertNoFieldByName('nodes[' . $nodes['published_page']->id() . ']', '', 'No tableselect found.');
 
     // Verify unpublished content is displayed with permission.
     $this->drupalLogout();
     $this->drupalLogin($this->base_user_2);
     $this->drupalGet('admin/content');
     $this->assertResponse(200);
-    $this->assertLinkByHref('node/' . $nodes['unpublished_page_2']->nid);
+    $this->assertLinkByHref('node/' . $nodes['unpublished_page_2']->id());
     // Verify no operation links are displayed.
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_2']->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_2']->nid . '/delete');
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_2']->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_2']->id() . '/delete');
 
     // Verify user cannot see unpublished content of other users.
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid);
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/edit');
-    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/delete');
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->id());
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->id() . '/edit');
+    $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->id() . '/delete');
 
     // Verify no tableselect.
-    $this->assertNoFieldByName('nodes[' . $nodes['unpublished_page_2']->nid . ']', '', 'No tableselect found.');
+    $this->assertNoFieldByName('nodes[' . $nodes['unpublished_page_2']->id() . ']', '', 'No tableselect found.');
 
     // Verify node access can be bypassed.
     $this->drupalLogout();
@@ -165,9 +165,9 @@ function testContentAdminPages() {
     $this->drupalGet('admin/content');
     $this->assertResponse(200);
     foreach ($nodes as $node) {
-      $this->assertLinkByHref('node/' . $node->nid);
-      $this->assertLinkByHref('node/' . $node->nid . '/edit');
-      $this->assertLinkByHref('node/' . $node->nid . '/delete');
+      $this->assertLinkByHref('node/' . $node->id());
+      $this->assertLinkByHref('node/' . $node->id() . '/edit');
+      $this->assertLinkByHref('node/' . $node->id() . '/delete');
     }
   }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
index b308072..14045d5 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
@@ -78,13 +78,13 @@ public function testRecentNodeBlock() {
       ->fields(array(
         'changed' => $node1->changed + 100,
       ))
-      ->condition('nid', $node2->nid)
+      ->condition('nid', $node2->id())
       ->execute();
     db_update('node_field_data')
       ->fields(array(
         'changed' => $node1->changed + 200,
       ))
-      ->condition('nid', $node3->nid)
+      ->condition('nid', $node3->id())
       ->execute();
 
     // Test that a user without the 'access content' permission cannot
@@ -144,9 +144,9 @@ public function testRecentNodeBlock() {
     $this->assertNoText($label, 'Block was not displayed on the front page.');
     $this->drupalGet('node/add/article');
     $this->assertText($label, 'Block was displayed on the node/add/article page.');
-    $this->drupalGet('node/' . $node1->nid);
+    $this->drupalGet('node/' . $node1->id());
     $this->assertText($label, 'Block was displayed on the node/N when node is of type article.');
-    $this->drupalGet('node/' . $node5->nid);
+    $this->drupalGet('node/' . $node5->id());
     $this->assertNoText($label, 'Block was not displayed on nodes of type page.');
   }
 
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php
index eef7948..6494b40 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php
@@ -46,7 +46,7 @@ function testNodeViewModeChange() {
 
     // Set the flag to alter the view mode and view the node.
     \Drupal::state()->set('node_test_change_view_mode', 'teaser');
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
 
     // Check that teaser mode is viewed.
     $this->assertText('Extra data that should appear only in the teaser for the node.', 'Teaser text present');
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php b/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php
index cbf3a29..6df2698 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php
@@ -131,9 +131,9 @@ function testMultilingualDisplaySettings() {
     $this->assertTrue($node, 'Node found in database.');
 
     // Check if node body is showed.
-    $this->drupalGet("node/$node->nid");
+    $this->drupalGet('node/' . $node->id());
     $body = $this->xpath('//article[@id=:id]//div[@class=:class]/descendant::p', array(
-      ':id' => 'node-' . $node->nid,
+      ':id' => 'node-' . $node->id(),
       ':class' => 'content',
     ));
     $this->assertEqual(current($body), $node->body['en'][0]['value'], 'Node body found.');
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
index a592c88..b52d825 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
@@ -55,7 +55,7 @@ function testNodeFormButtons() {
     $this->assertEqual(1, $node_1->status, 'Node is published');
 
     // Verify the buttons on a node edit form.
-    $this->drupalGet('node/' . $node_1->nid . '/edit');
+    $this->drupalGet('node/' . $node_1->id() . '/edit');
     $this->assertButtons(array(t('Save and keep published'), t('Save and unpublish')));
 
     // Save the node and verify it's still published after clicking
@@ -66,12 +66,12 @@ function testNodeFormButtons() {
 
     // Save the node and verify it's unpublished after clicking
     // 'Save and unpublish'.
-    $this->drupalPost('node/' . $node_1->nid . '/edit', $edit, t('Save and unpublish'));
+    $this->drupalPost('node/' . $node_1->id() . '/edit', $edit, t('Save and unpublish'));
     $node_1 = node_load(1, TRUE);
     $this->assertEqual(0, $node_1->status, 'Node is unpublished');
 
     // Verify the buttons on an unpublished node edit screen.
-    $this->drupalGet('node/' . $node_1->nid . '/edit');
+    $this->drupalGet('node/' . $node_1->id() . '/edit');
     $this->assertButtons(array(t('Save and keep unpublished'), t('Save and publish')));
 
     // Create a node as a normal user.
@@ -92,7 +92,7 @@ function testNodeFormButtons() {
     // was created by the normal user.
     $this->drupalLogout();
     $this->drupalLogin($this->admin_user);
-    $this->drupalPost('node/' . $node_2->nid . '/edit', array(), t('Save and unpublish'));
+    $this->drupalPost('node/' . $node_2->id() . '/edit', array(), t('Save and unpublish'));
     $node_2 = node_load(2, TRUE);
     $this->assertEqual(0, $node_2->status, 'Node is unpublished');
 
@@ -100,7 +100,7 @@ function testNodeFormButtons() {
     // it's still unpublished.
     $this->drupalLogout();
     $this->drupalLogin($this->web_user);
-    $this->drupalPost('node/' . $node_2->nid . '/edit', array(), t('Save'));
+    $this->drupalPost('node/' . $node_2->id() . '/edit', array(), t('Save'));
     $node_2 = node_load(2, TRUE);
     $this->assertEqual(0, $node_2->status, 'Node is still unpublished');
     $this->drupalLogout();
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php
index 51dad74..da2df6a 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php
@@ -42,7 +42,7 @@ function testHookNodeLoad() {
     // reflect the expected values.
     $nodes = entity_load_multiple_by_properties('node', array('status' => NODE_PUBLISHED));
     $loaded_node = end($nodes);
-    $this->assertEqual($loaded_node->node_test_loaded_nids, array($node1->nid, $node2->nid), 'hook_node_load() received the correct list of node IDs the first time it was called.');
+    $this->assertEqual($loaded_node->node_test_loaded_nids, array($node1->id(), $node2->id()), 'hook_node_load() received the correct list of node IDs the first time it was called.');
     $this->assertEqual($loaded_node->node_test_loaded_types, array('article'), 'hook_node_load() received the correct list of node types the first time it was called.');
 
     // Now, as part of the same page request, load a set of nodes that contain
@@ -50,7 +50,7 @@ function testHookNodeLoad() {
     // node_test_node_load() are correctly updated.
     $nodes = entity_load_multiple_by_properties('node', array('status' => NODE_NOT_PUBLISHED));
     $loaded_node = end($nodes);
-    $this->assertEqual($loaded_node->node_test_loaded_nids, array($node3->nid, $node4->nid), 'hook_node_load() received the correct list of node IDs the second time it was called.');
+    $this->assertEqual($loaded_node->node_test_loaded_nids, array($node3->id(), $node4->id()), 'hook_node_load() received the correct list of node IDs the second time it was called.');
     $this->assertEqual($loaded_node->node_test_loaded_types, array('article', 'page'), 'hook_node_load() received the correct list of node types the second time it was called.');
   }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php
index ad37c69..c858376 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php
@@ -51,8 +51,8 @@ function testNodeMultipleLoad() {
 
     // Load nodes with only a condition. Nodes 3 and 4 will be loaded.
     $nodes = entity_load_multiple_by_properties('node', array('promote' => 0));
-    $this->assertEqual($node3->label(), $nodes[$node3->nid]->label(), 'Node was loaded.');
-    $this->assertEqual($node4->label(), $nodes[$node4->nid]->label(), 'Node was loaded.');
+    $this->assertEqual($node3->label(), $nodes[$node3->id()]->label(), 'Node was loaded.');
+    $this->assertEqual($node4->label(), $nodes[$node4->id()]->label(), 'Node was loaded.');
     $count = count($nodes);
     $this->assertTrue($count == 2, format_string('@count nodes loaded.', array('@count' => $count)));
 
@@ -60,9 +60,9 @@ function testNodeMultipleLoad() {
     $nodes = node_load_multiple(array(1, 2, 4));
     $count = count($nodes);
     $this->assertTrue(count($nodes) == 3, format_string('@count nodes loaded', array('@count' => $count)));
-    $this->assertTrue(isset($nodes[$node1->nid]), 'Node is correctly keyed in the array');
-    $this->assertTrue(isset($nodes[$node2->nid]), 'Node is correctly keyed in the array');
-    $this->assertTrue(isset($nodes[$node4->nid]), 'Node is correctly keyed in the array');
+    $this->assertTrue(isset($nodes[$node1->id()]), 'Node is correctly keyed in the array');
+    $this->assertTrue(isset($nodes[$node2->id()]), 'Node is correctly keyed in the array');
+    $this->assertTrue(isset($nodes[$node4->id()]), 'Node is correctly keyed in the array');
     foreach ($nodes as $node) {
       $this->assertTrue(is_object($node), 'Node is an object');
     }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php
index 34b35ae..5357899 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php
@@ -51,18 +51,18 @@ function testNodeRSSContent() {
     $this->drupalGet('rss.xml');
 
     // Check that content added in 'rss' view mode appear in RSS feed.
-    $rss_only_content = t('Extra data that should appear only in the RSS feed for node !nid.', array('!nid' => $node->nid));
+    $rss_only_content = t('Extra data that should appear only in the RSS feed for node !nid.', array('!nid' => $node->id()));
     $this->assertText($rss_only_content, 'Node content designated for RSS appear in RSS feed.');
 
     // Check that content added in view modes other than 'rss' doesn't
     // appear in RSS feed.
-    $non_rss_content = t('Extra data that should appear everywhere except the RSS feed for node !nid.', array('!nid' => $node->nid));
+    $non_rss_content = t('Extra data that should appear everywhere except the RSS feed for node !nid.', array('!nid' => $node->id()));
     $this->assertNoText($non_rss_content, 'Node content not designed for RSS does not appear in RSS feed.');
 
     // Check that extra RSS elements and namespaces are added to RSS feed.
     $test_element = array(
       'key' => 'testElement',
-      'value' => t('Value of testElement RSS element for node !nid.', array('!nid' => $node->nid)),
+      'value' => t('Value of testElement RSS element for node !nid.', array('!nid' => $node->id())),
     );
     $test_ns = 'xmlns:drupaltest="http://example.com/test-namespace"';
     $this->assertRaw(format_xml_elements(array($test_element)), 'Extra RSS elements appear in RSS feed.');
@@ -70,7 +70,7 @@ function testNodeRSSContent() {
 
     // Check that content added in 'rss' view mode doesn't appear when
     // viewing node.
-    $this->drupalGet("node/$node->nid");
+    $this->drupalGet('node/' . $node->id());
     $this->assertNoText($rss_only_content, 'Node content designed for RSS does not appear when viewing node.');
   }
 
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionPermissionsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionPermissionsTest.php
index e0db862..3bcf362 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionPermissionsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionPermissionsTest.php
@@ -98,7 +98,7 @@ function testNodeRevisionAccessAnyType() {
 
     foreach ($permutations as $case) {
       // Skip this test if there are no revisions for the node.
-      if (!($revision->isDefaultRevision() && (db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid', array(':nid' => $revision->nid))->fetchField() == 1 || $case['op'] == 'update' || $case['op'] == 'delete'))) {
+      if (!($revision->isDefaultRevision() && (db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid', array(':nid' => $revision->id()))->fetchField() == 1 || $case['op'] == 'update' || $case['op'] == 'delete'))) {
         if (!empty($case['account']->is_admin) || user_access($this->map[$case['op']], $case['account'])) {
           $this->assertTrue(_node_revision_access($revision, $case['op'], $case['account']), "{$this->map[$case['op']]} granted.");
         }
@@ -144,7 +144,7 @@ function testNodeRevisionAccessPerType() {
     $permutations = $this->generatePermutations($parameters);
     foreach ($permutations as $case) {
       // Skip this test if there are no revisions for the node.
-      if (!($revision->isDefaultRevision() && (db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid', array(':nid' => $revision->nid))->fetchField() == 1 || $case['op'] == 'update' || $case['op'] == 'delete'))) {
+      if (!($revision->isDefaultRevision() && (db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid', array(':nid' => $revision->id()))->fetchField() == 1 || $case['op'] == 'update' || $case['op'] == 'delete'))) {
         if (!empty($case['account']->is_admin) || user_access($this->type_map[$case['op']], $case['account'])) {
           $this->assertTrue(_node_revision_access($revision, $case['op'], $case['account']), "{$this->type_map[$case['op']]} granted.");
         }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsAllTestCase.php b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsAllTestCase.php
index f2209d7..3906c94 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsAllTestCase.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsAllTestCase.php
@@ -66,7 +66,7 @@ function setUp() {
       $node->setNewRevision();
       $node->save();
 
-      $node = node_load($node->nid, TRUE); // Make sure we get revision information.
+      $node = node_load($node->id(), TRUE); // Make sure we get revision information.
       $nodes[] = clone $node;
     }
 
@@ -118,7 +118,7 @@ function testRevisions() {
         '%revision-date' => format_date($nodes[1]->revision_timestamp)
       )),
       'Revision reverted.');
-    $reverted_node = node_load($node->nid, TRUE);
+    $reverted_node = node_load($node->id(), TRUE);
     $this->assertTrue(($nodes[1]->body[Language::LANGCODE_NOT_SPECIFIED][0]['value'] == $reverted_node->body[Language::LANGCODE_NOT_SPECIFIED][0]['value']), 'Node reverted correctly.');
 
     // Confirm that this is not the current version.
@@ -135,7 +135,7 @@ function testRevisions() {
       )),
       'Revision deleted.');
     $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid and vid = :vid',
-      array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0,
+      array(':nid' => $node->id(), ':vid' => $nodes[1]->vid))->fetchField() == 0,
       'Revision not found.');
 
     // Set the revision timestamp to an older date to make sure that the
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php
index dd2df8d..62ebcb1 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php
@@ -66,7 +66,7 @@ function setUp() {
       $node->setNewRevision();
       $node->save();
 
-      $node = node_load($node->nid); // Make sure we get revision information.
+      $node = node_load($node->id()); // Make sure we get revision information.
       $nodes[] = clone $node;
     }
 
@@ -102,7 +102,7 @@ function testRevisions() {
     $this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.',
                         array('@type' => 'Basic page', '%title' => $nodes[1]->label(),
                               '%revision-date' => format_date($nodes[1]->revision_timestamp))), 'Revision reverted.');
-    $reverted_node = node_load($node->nid, TRUE);
+    $reverted_node = node_load($node->id(), TRUE);
     $this->assertTrue(($nodes[1]->body[Language::LANGCODE_NOT_SPECIFIED][0]['value'] == $reverted_node->body[Language::LANGCODE_NOT_SPECIFIED][0]['value']), 'Node reverted correctly.');
 
     // Confirm that this is not the default version.
@@ -114,7 +114,7 @@ function testRevisions() {
     $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.',
                         array('%revision-date' => format_date($nodes[1]->revision_timestamp),
                               '@type' => 'Basic page', '%title' => $nodes[1]->label())), 'Revision deleted.');
-    $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0, 'Revision not found.');
+    $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->id(), ':vid' => $nodes[1]->vid))->fetchField() == 0, 'Revision not found.');
 
     // Set the revision timestamp to an older date to make sure that the
     // confirmation message correctly displays the stored revision date.
@@ -142,7 +142,7 @@ function testRevisions() {
     $new_node_revision->isDefaultRevision = FALSE;
     $new_node_revision->save();
 
-    $this->drupalGet("node/$node->nid");
+    $this->drupalGet('node/' . $node->id());
     $this->assertNoText($new_body, 'Revision body text is not present on default version of node.');
 
     // Verify that the new body text is present on the revision.
@@ -153,7 +153,7 @@ function testRevisions() {
     // revision vid.
     $default_revision = db_select('node', 'n')
       ->fields('n', array('vid'))
-      ->condition('nid', $node->nid)
+      ->condition('nid', $node->id())
       ->execute()
       ->fetchCol();
     $default_revision_vid = $default_revision[0];
@@ -180,9 +180,9 @@ function testNodeRevisionWithoutLogMessage() {
     $node->setNewRevision(FALSE);
 
     $node->save();
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($new_title, 'New node title appears on the page.');
-    $node_revision = node_load($node->nid, TRUE);
+    $node_revision = node_load($node->id(), TRUE);
     $this->assertEqual($node_revision->log, $log, 'After an existing node revision is re-saved without a log message, the original log message is preserved.');
 
     // Create another node with an initial log message.
@@ -198,9 +198,9 @@ function testNodeRevisionWithoutLogMessage() {
     $node->log = NULL;
 
     $node->save();
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($new_title, 'New node title appears on the page.');
-    $node_revision = node_load($node->nid, TRUE);
+    $node_revision = node_load($node->id(), TRUE);
     $this->assertTrue(empty($node_revision->log), 'After a new node revision is saved with an empty log message, the log message for the node is empty.');
   }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php
index 0a1c210..c33aa05 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php
@@ -155,7 +155,7 @@ function testDeterminingChanges() {
     $this->assertEqual($node->label(), 'updated_presave_update', 'Changes have been determined.');
 
     // Test the static node load cache to be cleared.
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
     $this->assertEqual($node->label(), 'updated_presave', 'Static cache has been cleared.');
   }
 
@@ -172,6 +172,6 @@ function testNodeSaveOnInsert() {
     // node_test_node_insert() tiggers a save on insert if the title equals
     // 'new'.
     $node = $this->drupalCreateNode(array('title' => 'new'));
-    $this->assertEqual($node->title, 'Node ' . $node->nid, 'Node saved on node insert.');
+    $this->assertEqual($node->title, 'Node ' . $node->id(), 'Node saved on node insert.');
   }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php
index e03e4b0..c23332e 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php
@@ -49,17 +49,17 @@ function testNodeTitle() {
     $node = $this->drupalCreateNode($settings);
 
     // Test <title> tag.
-    $this->drupalGet("node/$node->nid");
+    $this->drupalGet('node/' . $node->id());
     $xpath = '//title';
     $this->assertEqual(current($this->xpath($xpath)), $node->label() .' | Drupal', 'Page title is equal to node title.', 'Node');
 
     // Test breadcrumb in comment preview.
-    $this->drupalGet("comment/reply/$node->nid");
+    $this->drupalGet('comment/reply/' . $node->id());
     $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
     $this->assertEqual(current($this->xpath($xpath)), $node->label(), 'Node breadcrumb is equal to node title.', 'Node');
 
     // Test node title in comment preview.
-    $this->assertEqual(current($this->xpath('//article[@id=:id]/h2/a', array(':id' => 'node-' . $node->nid))), $node->label(), 'Node preview title is equal to node title.', 'Node');
+    $this->assertEqual(current($this->xpath('//article[@id=:id]/h2/a', array(':id' => 'node-' . $node->id()))), $node->label(), 'Node preview title is equal to node title.', 'Node');
 
     // Test node title is clickable on teaser list (/node).
     $this->drupalGet('node');
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTitleXSSTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTitleXSSTest.php
index 8810f79..c173adc 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTitleXSSTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTitleXSSTest.php
@@ -37,12 +37,12 @@ function testNodeTitleXSS() {
     $settings = array('title' => $title);
     $node = $this->drupalCreateNode($settings);
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     // assertTitle() decodes HTML-entities inside the <title> element.
     $this->assertTitle($edit["title"] . ' | Drupal', 'Title is diplayed when viewing a node.');
     $this->assertNoRaw($xss, 'Harmful tags are escaped when viewing a node.');
 
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertNoRaw($xss, 'Harmful tags are escaped when editing a node.');
   }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
index 8bb425d..6416a77 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
@@ -43,12 +43,12 @@ function testNodeTokenReplacement() {
     $node = $this->drupalCreateNode($settings);
 
     // Load node so that the body and summary fields are structured properly.
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
     $instance = field_info_instance('node', 'body', $node->type);
 
     // Generate and test sanitized tokens.
     $tests = array();
-    $tests['[node:nid]'] = $node->nid;
+    $tests['[node:nid]'] = $node->id();
     $tests['[node:vid]'] = $node->vid;
     $tests['[node:tnid]'] = $node->tnid;
     $tests['[node:type]'] = 'article';
@@ -57,8 +57,8 @@ function testNodeTokenReplacement() {
     $tests['[node:body]'] = text_sanitize($instance['settings']['text_processing'], $node->langcode, $node->body[$node->langcode][0], 'value');
     $tests['[node:summary]'] = text_sanitize($instance['settings']['text_processing'], $node->langcode, $node->body[$node->langcode][0], 'summary');
     $tests['[node:langcode]'] = check_plain($node->langcode);
-    $tests['[node:url]'] = url('node/' . $node->nid, $url_options);
-    $tests['[node:edit-url]'] = url('node/' . $node->nid . '/edit', $url_options);
+    $tests['[node:url]'] = url('node/' . $node->id(), $url_options);
+    $tests['[node:edit-url]'] = url('node/' . $node->id() . '/edit', $url_options);
     $tests['[node:author]'] = check_plain(user_format_name($account));
     $tests['[node:author:uid]'] = $node->uid;
     $tests['[node:author:name]'] = check_plain(user_format_name($account));
@@ -91,7 +91,7 @@ function testNodeTokenReplacement() {
 
     // Load node (without summary) so that the body and summary fields are
     // structured properly.
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
     $instance = field_info_instance('node', 'body', $node->type);
 
     // Generate and test sanitized token - use full body as expected value.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
index 473947b..481c802 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
@@ -151,8 +151,8 @@ function testTranslateLinkContentAdminPage() {
     // Verify translation links.
     $this->drupalGet('admin/content');
     $this->assertResponse(200);
-    $this->assertLinkByHref('node/' . $article->nid . '/translations');
-    $this->assertNoLinkByHref('node/' . $page->nid . '/translations');
+    $this->assertLinkByHref('node/' . $article->id() . '/translations');
+    $this->assertNoLinkByHref('node/' . $page->id() . '/translations');
   }
 
   /**
@@ -165,14 +165,14 @@ function testFieldTranslationForm() {
     $article = $this->drupalCreateNode(array('type' => 'article', 'langcode' => 'en'));
 
     // Visit translation page.
-    $this->drupalGet('node/' . $article->nid . '/translations');
+    $this->drupalGet('node/' . $article->id() . '/translations');
     $this->assertRaw('Not translated');
 
     // Delete the only translatable field.
     field_info_field('field_test_et_ui_test')->delete();
 
     // Visit translation page.
-    $this->drupalGet('node/' . $article->nid . '/translations');
+    $this->drupalGet('node/' . $article->id() . '/translations');
     $this->assertRaw('No translatable fields');
   }
 
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php
index 1a0b7ed..b54aef0 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php
@@ -113,7 +113,7 @@ function testLanguageFieldVisibility() {
     $this->assertTrue($node, 'Node found in database.');
 
     // Loads node page and check if Language field is hidden by default.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $language_field = $this->xpath('//div[@id=:id]/div', array(
       ':id' => 'field-language-display',
     ));
@@ -128,7 +128,7 @@ function testLanguageFieldVisibility() {
     $this->assertOptionSelected('edit-fields-language-type', 'visible', 'Language field has been set to visible.');
 
     // Loads node page and check if Language field is shown.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $language_field = $this->xpath('//div[@id=:id]/div', array(
       ':id' => 'field-language-display',
     ));
diff --git a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
index 2407dfb..4523083 100644
--- a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
@@ -120,26 +120,26 @@ function testPageAuthoredBy() {
     $edit = array(
       'name' => 'invalid-name',
     );
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
     $this->assertText('The username invalid-name does not exist.');
 
     // Change the authored by field to an empty string, which should assign
     // authorship to the anonymous user (uid 0).
     $edit['name'] = '';
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
-    $node = node_load($node->nid, TRUE);
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
+    $node = node_load($node->id(), TRUE);
     $this->assertIdentical($node->uid, '0', 'Node authored by anonymous user.');
 
     // Change the authored by field to another user's name (that is not
     // logged in).
     $edit['name'] = $this->web_user->name;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
     $node = node_load($node->nid, TRUE);
     $this->assertIdentical($node->uid, $this->web_user->id(), 'Node authored by normal user.');
 
     // Check that normal users cannot change the authored by information.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertNoFieldByName('name');
   }
 }
diff --git a/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php b/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php
index b485545..0538e00 100644
--- a/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php
@@ -138,11 +138,11 @@ function testPagePreview() {
     $node = $this->drupalGetNodeByTitle($edit[$title_key]);
 
     // Check the term was displayed on the saved node.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($edit[$term_key], 'Term displayed.');
 
     // Check the term appears again on the edit form.
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertFieldByName($term_key, $edit[$term_key], 'Term field displayed.');
 
     // Check with two new terms on the edit form, additionally to the existing
@@ -151,7 +151,7 @@ function testPagePreview() {
     $newterm1 = $this->randomName(8);
     $newterm2 = $this->randomName(8);
     $edit[$term_key] = $this->term->label() . ', ' . $newterm1 . ', ' . $newterm2;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Preview'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Preview'));
     $this->assertRaw('>' . $newterm1 . '<', 'First new term displayed.');
     $this->assertRaw('>' . $newterm2 . '<', 'Second new term displayed.');
     // The first term should be displayed as link, the others not.
@@ -166,7 +166,7 @@ function testPagePreview() {
     $edit = array();
     $newterm3 = $this->randomName(8);
     $edit[$term_key] = $newterm1 . ', ' . $newterm3 . ', ' . $newterm2;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Preview'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Preview'));
     $this->assertRaw('>' . $newterm1 . '<', 'First existing term displayed.');
     $this->assertRaw('>' . $newterm2 . '<', 'Second existing term displayed.');
     $this->assertRaw('>' . $newterm3 . '<', 'Third new term displayed.');
diff --git a/core/modules/node/lib/Drupal/node/Tests/PageViewTest.php b/core/modules/node/lib/Drupal/node/Tests/PageViewTest.php
index deab20a..deaab8c 100644
--- a/core/modules/node/lib/Drupal/node/Tests/PageViewTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/PageViewTest.php
@@ -25,7 +25,7 @@ public static function getInfo() {
   function testPageView() {
     // Create a node to view.
     $node = $this->drupalCreateNode();
-    $this->assertTrue(node_load($node->nid), 'Node created.');
+    $this->assertTrue(node_load($node->id()), 'Node created.');
 
     // Try to edit with anonymous user.
     $html = $this->drupalGet("node/$node->nid/edit");
diff --git a/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php b/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php
index e627c6e..21b1fe6 100644
--- a/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php
@@ -29,7 +29,7 @@ function testSummaryLength() {
       'promote' => 1,
     );
     $node = $this->drupalCreateNode($settings);
-    $this->assertTrue(node_load($node->nid), 'Node created.');
+    $this->assertTrue(node_load($node->id()), 'Node created.');
 
     // Create user with permission to view the node.
     $web_user = $this->drupalCreateUser(array('access content', 'administer content types'));
diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php
index 9ffc781..edb40d0 100644
--- a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php
+++ b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php
@@ -59,7 +59,7 @@ public function testNodeRevisionRelationship() {
 
     // Here should be two rows.
     $view_nid = views_get_view('test_node_revision_nid');
-    $this->executeView($view_nid, array($node->nid));
+    $this->executeView($view_nid, array($node->id()));
     $resultset_nid = array(
       array(
         'vid' => '1',
@@ -76,7 +76,7 @@ public function testNodeRevisionRelationship() {
 
     // There should be only one row with active revision 2.
     $view_vid = views_get_view('test_node_revision_vid');
-    $this->executeView($view_vid, array($node->nid));
+    $this->executeView($view_vid, array($node->id()));
     $resultset_vid = array(
       array(
         'vid' => '2',
diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc
index 3a30faf..ded7789 100644
--- a/core/modules/node/node.admin.inc
+++ b/core/modules/node/node.admin.inc
@@ -118,7 +118,7 @@ function _node_mass_update_batch_process(array $nodes, array $updates, $load, ar
     $node = _node_mass_update_helper($node, $updates);
 
     // Store result for post-processing in the finished callback.
-    $context['results'][] = l($node->label(), 'node/' . $node->nid);
+    $context['results'][] = l($node->label(), 'node/' . $node->id());
 
     // Update our progress information.
     $context['sandbox']['progress']++;
@@ -239,30 +239,30 @@ function node_admin_nodes() {
     $l_options = $node->langcode != Language::LANGCODE_NOT_SPECIFIED && isset($languages[$node->langcode]) ? array('language' => $languages[$node->langcode]) : array();
     $mark = array(
       '#theme' => 'mark',
-      '#status' => node_mark($node->nid, $node->changed),
+      '#status' => node_mark($node->id(), $node->changed),
     );
-    $form['nodes'][$node->nid]['title'] = array(
+    $form['nodes'][$node->id()]['title'] = array(
       '#type' => 'link',
       '#title' => $node->label(),
-      '#href' => 'node/' . $node->nid,
+      '#href' => 'node/' . $node->id(),
       '#options' => $l_options,
       '#suffix' => ' ' . drupal_render($mark),
     );
-    $form['nodes'][$node->nid]['type'] = array(
+    $form['nodes'][$node->id()]['type'] = array(
       '#markup' => check_plain(node_get_type_label($node)),
     );
-    $form['nodes'][$node->nid]['author'] = array(
+    $form['nodes'][$node->id()]['author'] = array(
       '#theme' => 'username',
       '#account' => user_load($node->uid),
     );
-    $form['nodes'][$node->nid]['status'] = array(
+    $form['nodes'][$node->id()]['status'] = array(
       '#markup' => $node->status ? t('published') : t('not published'),
     );
-    $form['nodes'][$node->nid]['changed'] = array(
+    $form['nodes'][$node->id()]['changed'] = array(
       '#markup' => format_date($node->changed, 'short'),
     );
     if ($multilingual) {
-      $form['nodes'][$node->nid]['language_name'] = array(
+      $form['nodes'][$node->id()]['language_name'] = array(
         '#markup' => language_name($node->langcode),
       );
     }
@@ -272,28 +272,28 @@ function node_admin_nodes() {
     if (node_access('update', $node)) {
       $operations['edit'] = array(
         'title' => t('Edit'),
-        'href' => 'node/' . $node->nid . '/edit',
+        'href' => 'node/' . $node->id() . '/edit',
         'query' => $destination,
       );
     }
     if (node_access('delete', $node)) {
       $operations['delete'] = array(
         'title' => t('Delete'),
-        'href' => 'node/' . $node->nid . '/delete',
+        'href' => 'node/' . $node->id() . '/delete',
         'query' => $destination,
       );
     }
     if ($node->isTranslatable()) {
       $operations['translate'] = array(
         'title' => t('Translate'),
-        'href' => 'node/' . $node->nid . '/translations',
+        'href' => 'node/' . $node->id() . '/translations',
         'query' => $destination,
       );
     }
-    $form['nodes'][$node->nid]['operations'] = array();
+    $form['nodes'][$node->id()]['operations'] = array();
     if (count($operations) > 1) {
       // Render an unordered list of operations links.
-      $form['nodes'][$node->nid]['operations'] = array(
+      $form['nodes'][$node->id()]['operations'] = array(
         '#type' => 'operations',
         '#subtype' => 'node',
         '#links' => $operations,
@@ -302,7 +302,7 @@ function node_admin_nodes() {
     elseif (!empty($operations)) {
       // Render the first and only operation as a link.
       $link = reset($operations);
-      $form['nodes'][$node->nid]['operations'] = array(
+      $form['nodes'][$node->id()]['operations'] = array(
         '#type' => 'link',
         '#title' => $link['title'],
         '#href' => $link['href'],
diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php
index a3e0138..5e57dda 100644
--- a/core/modules/node/node.api.php
+++ b/core/modules/node/node.api.php
@@ -403,7 +403,7 @@ function hook_node_grants_alter(&$grants, $account, $op) {
  */
 function hook_node_predelete(\Drupal\Core\Entity\EntityInterface $node) {
   db_delete('mytable')
-    ->condition('nid', $node->nid)
+    ->condition('nid', $node->id())
     ->execute();
 }
 
@@ -465,7 +465,7 @@ function hook_node_revision_delete(\Drupal\Core\Entity\EntityInterface $node) {
 function hook_node_insert(\Drupal\Core\Entity\EntityInterface $node) {
   db_insert('mytable')
     ->fields(array(
-      'nid' => $node->nid,
+      'nid' => $node->id(),
       'extra' => $node->extra,
     ))
     ->execute();
@@ -639,7 +639,7 @@ function hook_node_prepare_form(\Drupal\node\NodeInterface $node, $form_display,
  * @ingroup node_api_hooks
  */
 function hook_node_search_result(\Drupal\Core\Entity\EntityInterface $node, $langcode) {
-  $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
+  $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->id()))->fetchField();
   return array('comment' => format_plural($comments, '1 comment', '@count comments'));
 }
 
@@ -655,7 +655,7 @@ function hook_node_search_result(\Drupal\Core\Entity\EntityInterface $node, $lan
  * @ingroup node_api_hooks
  */
 function hook_node_presave(\Drupal\Core\Entity\EntityInterface $node) {
-  if ($node->nid && $node->moderate) {
+  if ($node->id() && $node->moderate) {
     // Reset votes when node is updated:
     $node->score = 0;
     $node->users = '';
@@ -686,7 +686,7 @@ function hook_node_presave(\Drupal\Core\Entity\EntityInterface $node) {
 function hook_node_update(\Drupal\Core\Entity\EntityInterface $node) {
   db_update('mytable')
     ->fields(array('extra' => $node->extra))
-    ->condition('nid', $node->nid)
+    ->condition('nid', $node->id())
     ->execute();
 }
 
@@ -708,7 +708,7 @@ function hook_node_update(\Drupal\Core\Entity\EntityInterface $node) {
  */
 function hook_node_update_index(\Drupal\Core\Entity\EntityInterface $node, $langcode) {
   $text = '';
-  $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(':nid' => $node->nid, ':status' => COMMENT_PUBLISHED));
+  $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(':nid' => $node->id(), ':status' => COMMENT_PUBLISHED));
   foreach ($comments as $comment) {
     $text .= '<h2>' . check_plain($comment->subject->value) . '</h2>' . $comment->comment_body->processed;
   }
diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc
index 7dff75d..de16e50 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -217,7 +217,7 @@ function node_revision_overview($node) {
         '#theme' => 'username',
         '#account' => user_load($revision->uid),
       );
-      $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->revision_timestamp, 'short'), "node/$node->nid"), '!username' => drupal_render($username)))
+      $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->revision_timestamp, 'short'), 'node/' . $node->id()), '!username' => drupal_render($username)))
                                . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''),
                      'class' => array('revision-current'));
       $row[] = array('data' => drupal_placeholder(t('current revision')), 'class' => array('revision-current'));
diff --git a/core/modules/node/node.tokens.inc b/core/modules/node/node.tokens.inc
index 241b83b..77dc994 100644
--- a/core/modules/node/node.tokens.inc
+++ b/core/modules/node/node.tokens.inc
@@ -111,7 +111,7 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
       switch ($name) {
         // Simple key values on the node.
         case 'nid':
-          $replacements[$original] = $node->nid;
+          $replacements[$original] = $node->id();
           break;
 
         case 'vid':
@@ -175,11 +175,11 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'url':
-          $replacements[$original] = url('node/' . $node->nid, $url_options);
+          $replacements[$original] = url('node/' . $node->id(), $url_options);
           break;
 
         case 'edit-url':
-          $replacements[$original] = url('node/' . $node->nid . '/edit', $url_options);
+          $replacements[$original] = url('node/' . $node->id() . '/edit', $url_options);
           break;
 
         // Default values for the chained tokens handled below.
diff --git a/core/modules/node/tests/modules/node_access_test/node_access_test.module b/core/modules/node/tests/modules/node_access_test/node_access_test.module
index 6a9492c..d4bfc29 100644
--- a/core/modules/node/tests/modules/node_access_test/node_access_test.module
+++ b/core/modules/node/tests/modules/node_access_test/node_access_test.module
@@ -107,7 +107,7 @@ function node_access_test_node_load($nodes, $types) {
  */
 
 function node_access_test_node_predelete(EntityInterface $node) {
-  db_delete('node_access_test')->condition('nid', $node->nid)->execute();
+  db_delete('node_access_test')->condition('nid', $node->id())->execute();
 }
 
 /**
@@ -130,7 +130,7 @@ function node_access_test_node_update(EntityInterface $node) {
 function _node_access_test_node_write(EntityInterface $node) {
   if (isset($node->private)) {
     db_merge('node_access_test')
-      ->key(array('nid' => $node->nid))
+      ->key(array('nid' => $node->id()))
       ->fields(array('private' => (int) $node->private))
       ->execute();
   }
diff --git a/core/modules/node/tests/modules/node_test/node_test.module b/core/modules/node/tests/modules/node_test/node_test.module
index 12e0eed..a11a616 100644
--- a/core/modules/node/tests/modules/node_test/node_test.module
+++ b/core/modules/node/tests/modules/node_test/node_test.module
@@ -35,13 +35,13 @@ function node_test_node_view(EntityInterface $node, EntityDisplay $display, $vie
     // Add RSS elements and namespaces when building the RSS feed.
     $node->rss_elements[] = array(
       'key' => 'testElement',
-      'value' => t('Value of testElement RSS element for node !nid.', array('!nid' => $node->nid)),
+      'value' => t('Value of testElement RSS element for node !nid.', array('!nid' => $node->id())),
     );
     $node->rss_namespaces['xmlns:drupaltest'] = 'http://example.com/test-namespace';
 
     // Add content that should be displayed only in the RSS feed.
     $node->content['extra_feed_content'] = array(
-      '#markup' => '<p>' . t('Extra data that should appear only in the RSS feed for node !nid.', array('!nid' => $node->nid)) . '</p>',
+      '#markup' => '<p>' . t('Extra data that should appear only in the RSS feed for node !nid.', array('!nid' => $node->id())) . '</p>',
       '#weight' => 10,
     );
   }
@@ -49,7 +49,7 @@ function node_test_node_view(EntityInterface $node, EntityDisplay $display, $vie
   if ($view_mode != 'rss') {
     // Add content that should NOT be displayed in the RSS feed.
     $node->content['extra_non_feed_content'] = array(
-      '#markup' => '<p>' . t('Extra data that should appear everywhere except the RSS feed for node !nid.', array('!nid' => $node->nid)) . '</p>',
+      '#markup' => '<p>' . t('Extra data that should appear everywhere except the RSS feed for node !nid.', array('!nid' => $node->id())) . '</p>',
     );
   }
 }
@@ -176,7 +176,7 @@ function node_test_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\Entity
 function node_test_node_insert(EntityInterface $node) {
   // Set the node title to the node ID and save.
   if ($node->title == 'new') {
-    $node->title = 'Node '. $node->nid;
+    $node->title = 'Node '. $node->id();
     $node->save();
   }
 }
diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php
index d34f178..2b45acd 100644
--- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php
+++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php
@@ -322,7 +322,7 @@ function testNodeDisplay() {
     $edit = array(
       $this->field_name . '[und]' => '1',
     );
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
 
     // Check the node page and see if the values are correct.
     $file_formatters = array('list_default', 'list_key');
@@ -331,7 +331,7 @@ function testNodeDisplay() {
         "fields[$this->field_name][type]" => $formatter,
       );
       $this->drupalPost('admin/structure/types/manage/' . $this->type_name . '/display', $edit, t('Save'));
-      $this->drupalGet('node/' . $node->nid);
+      $this->drupalGet('node/' . $node->id());
 
       if ($formatter == 'list_default') {
         $output = $on;
diff --git a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php
index 5626d3a..87ca4be 100644
--- a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php
+++ b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php
@@ -44,7 +44,7 @@ function testPathCache() {
 
     // Create alias.
     $edit = array();
-    $edit['source'] = 'node/' . $node1->nid;
+    $edit['source'] = 'node/' . $node1->id();
     $edit['alias'] = $this->randomName(8);
     $this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
 
@@ -75,7 +75,7 @@ function testAdminAlias() {
 
     // Create alias.
     $edit = array();
-    $edit['source'] = 'node/' . $node1->nid;
+    $edit['source'] = 'node/' . $node1->id();
     $edit['alias'] = $this->randomName(8);
     $this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
 
@@ -108,7 +108,7 @@ function testAdminAlias() {
     $node2 = $this->drupalCreateNode();
 
     // Set alias to second test node.
-    $edit['source'] = 'node/' . $node2->nid;
+    $edit['source'] = 'node/' . $node2->id();
     // leave $edit['alias'] the same
     $this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
 
@@ -126,7 +126,7 @@ function testAdminAlias() {
 
     // Create a really long alias.
     $edit = array();
-    $edit['source'] = 'node/' . $node1->nid;
+    $edit['source'] = 'node/' . $node1->id();
     $alias = $this->randomName(128);
     $edit['alias'] = $alias;
     // The alias is shortened to 50 characters counting the elipsis.
@@ -147,7 +147,7 @@ function testNodeAlias() {
     // Create alias.
     $edit = array();
     $edit['path[alias]'] = $this->randomName(8);
-    $this->drupalPost('node/' . $node1->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node1->id() . '/edit', $edit, t('Save'));
 
     // Confirm that the alias works.
     $this->drupalGet($edit['path[alias]']);
@@ -159,7 +159,7 @@ function testNodeAlias() {
     $edit['path[alias]'] = "- ._~!$'\"()*@[]?&+%#,;=:" . // "Special" ASCII characters.
       "%23%25%26%2B%2F%3F" . // Characters that look like a percent-escaped string.
       "éøïвβ中國書۞"; // Characters from various non-ASCII alphabets.
-    $this->drupalPost('node/' . $node1->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node1->id() . '/edit', $edit, t('Save'));
 
     // Confirm that the alias works.
     $this->drupalGet($edit['path[alias]']);
@@ -176,13 +176,13 @@ function testNodeAlias() {
 
     // Set alias to second test node.
     // Leave $edit['path[alias]'] the same.
-    $this->drupalPost('node/' . $node2->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node2->id() . '/edit', $edit, t('Save'));
 
     // Confirm that the alias didn't make a duplicate.
     $this->assertText(t('The alias is already in use.'), 'Attempt to moved alias was rejected.');
 
     // Delete alias.
-    $this->drupalPost('node/' . $node1->nid . '/edit', array('path[alias]' => ''), t('Save'));
+    $this->drupalPost('node/' . $node1->id() . '/edit', array('path[alias]' => ''), t('Save'));
 
     // Confirm that the alias no longer works.
     $this->drupalGet($edit['path[alias]']);
@@ -211,11 +211,11 @@ function testDuplicateNodeAlias() {
     $node_one = $this->drupalCreateNode();
     $edit = array();
     $edit['path[alias]'] = $this->randomName();
-    $this->drupalPost('node/' . $node_one->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node_one->id() . '/edit', $edit, t('Save'));
 
     // Now create another node and try to set the same alias.
     $node_two = $this->drupalCreateNode();
-    $this->drupalPost('node/' . $node_two->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node_two->id() . '/edit', $edit, t('Save'));
     $this->assertText(t('The alias is already in use.'));
     $this->assertFieldByXPath("//input[@name='path[alias]' and contains(@class, 'error')]", $edit['path[alias]'], 'Textfield exists and has the error class.');
   }
diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php
index 4e37019..122747d 100644
--- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php
+++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php
@@ -66,14 +66,14 @@ function testAliasTranslation() {
     $edit = array();
     $edit['langcode'] = 'en';
     $edit['path[alias]'] = $english_alias;
-    $this->drupalPost('node/' . $english_node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $english_node->id() . '/edit', $edit, t('Save'));
 
     // Confirm that the alias works.
     $this->drupalGet($english_alias);
     $this->assertText($english_node->label(), 'Alias works.');
 
     // Translate the node into French.
-    $this->drupalGet('node/' . $english_node->nid . '/translate');
+    $this->drupalGet('node/' . $english_node->id() . '/translate');
     $this->clickLink(t('Add translation'));
     $edit = array();
     $langcode = Language::LANGCODE_NOT_SPECIFIED;
@@ -99,7 +99,7 @@ function testAliasTranslation() {
     drupal_static_reset('language_list');
     $this->rebuildContainer();
     $languages = language_list();
-    $url = $this->container->get('url_generator')->generateFromPath('node/' . $french_node->nid, array('language' => $languages[$french_node->langcode]));
+    $url = $this->container->get('url_generator')->generateFromPath('node/' . $french_node->id(), array('language' => $languages[$french_node->langcode]));
 
     $this->assertTrue(strpos($url, $edit['path[alias]']), 'URL contains the path alias.');
 
@@ -151,16 +151,16 @@ function testAliasTranslation() {
     // it has the appropriate contents at this point.
     $this->container->get('path.alias_manager')->cacheClear();
     $french_node_path = $this->container->get('path.alias_manager')->getSystemPath($french_alias, $french_node->langcode);
-    $this->assertEqual($french_node_path, 'node/' . $french_node->nid, 'Normal path works.');
+    $this->assertEqual($french_node_path, 'node/' . $french_node->id(), 'Normal path works.');
     // Second call should return the same path.
     $french_node_path = $this->container->get('path.alias_manager')->getSystemPath($french_alias, $french_node->langcode);
-    $this->assertEqual($french_node_path, 'node/' . $french_node->nid, 'Normal path is the same.');
+    $this->assertEqual($french_node_path, 'node/' . $french_node->id(), 'Normal path is the same.');
 
     // Confirm that the alias works.
-    $french_node_alias = $this->container->get('path.alias_manager')->getPathAlias('node/' . $french_node->nid, $french_node->langcode);
+    $french_node_alias = $this->container->get('path.alias_manager')->getPathAlias('node/' . $french_node->id(), $french_node->langcode);
     $this->assertEqual($french_node_alias, $french_alias, 'Alias works.');
     // Second call should return the same alias.
-    $french_node_alias = $this->container->get('path.alias_manager')->getPathAlias('node/' . $french_node->nid, $french_node->langcode);
+    $french_node_alias = $this->container->get('path.alias_manager')->getPathAlias('node/' . $french_node->id(), $french_node->langcode);
     $this->assertEqual($french_node_alias, $french_alias, 'Alias is the same.');
   }
 }
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 4cb0ddd..0966334 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -99,8 +99,8 @@ function path_menu() {
 function path_form_node_form_alter(&$form, $form_state) {
   $node = $form_state['controller']->getEntity();
   $path = array();
-  if (!empty($node->nid)) {
-    $conditions = array('source' => 'node/' . $node->nid);
+  if (!$node->isNew()) {
+    $conditions = array('source' => 'node/' . $node->id());
     if ($node->langcode != Language::LANGCODE_NOT_SPECIFIED) {
       $conditions['langcode'] = $node->langcode;
     }
@@ -111,7 +111,7 @@ function path_form_node_form_alter(&$form, $form_state) {
   }
   $path += array(
     'pid' => NULL,
-    'source' => isset($node->nid) ? 'node/' . $node->nid : NULL,
+    'source' => $node->id() ? 'node/' . $node->id() : NULL,
     'alias' => '',
     'langcode' => isset($node->langcode) ? $node->langcode : Language::LANGCODE_NOT_SPECIFIED,
   );
@@ -190,7 +190,7 @@ function path_node_insert(EntityInterface $node) {
     // Only save a non-empty alias.
     if (!empty($alias)) {
       // Ensure fields for programmatic executions.
-      $source = 'node/' . $node->nid;
+      $source = 'node/' . $node->id();
       $langcode = isset($node->langcode) ? $node->langcode : Language::LANGCODE_NOT_SPECIFIED;
       Drupal::service('path.crud')->save($source, $alias, $langcode);
     }
@@ -211,7 +211,7 @@ function path_node_update(EntityInterface $node) {
     // Only save a non-empty alias.
     if (!empty($path['alias'])) {
       // Ensure fields for programmatic executions.
-      $source = 'node/' . $node->nid;
+      $source = 'node/' . $node->id();
       $langcode = isset($node->langcode) ? $node->langcode : Language::LANGCODE_NOT_SPECIFIED;
       Drupal::service('path.crud')->save($source, $alias, $langcode, $path['pid']);
     }
@@ -223,7 +223,7 @@ function path_node_update(EntityInterface $node) {
  */
 function path_node_predelete(EntityInterface $node) {
   // Delete all aliases associated with this node.
-  Drupal::service('path.crud')->delete(array('source' => 'node/' . $node->nid));
+  Drupal::service('path.crud')->delete(array('source' => 'node/' . $node->id()));
 }
 
 /**
diff --git a/core/modules/php/lib/Drupal/php/Tests/PhpAccessTest.php b/core/modules/php/lib/Drupal/php/Tests/PhpAccessTest.php
index f85c9f1..10d2b75 100644
--- a/core/modules/php/lib/Drupal/php/Tests/PhpAccessTest.php
+++ b/core/modules/php/lib/Drupal/php/Tests/PhpAccessTest.php
@@ -29,11 +29,11 @@ function testNoPrivileges() {
     $node = $this->createNodeWithCode();
 
     // Make sure that the PHP code shows up as text.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText('print', 'PHP code was not evaluated.');
 
     // Make sure that user doesn't have access to filter.
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->drupalGet('node/' . $node->id() . '/edit');
     $this->assertNoRaw('<option value="' . $this->php_code_format->format . '">', 'PHP code format not available.');
   }
 }
diff --git a/core/modules/php/lib/Drupal/php/Tests/PhpFilterTest.php b/core/modules/php/lib/Drupal/php/Tests/PhpFilterTest.php
index f954bdd..9a7212a 100644
--- a/core/modules/php/lib/Drupal/php/Tests/PhpFilterTest.php
+++ b/core/modules/php/lib/Drupal/php/Tests/PhpFilterTest.php
@@ -34,14 +34,14 @@ function testPhpFilter() {
     $node = $this->createNodeWithCode();
 
     // Make sure that the PHP code shows up as text.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText('php print');
 
     // Change filter to PHP filter and see that PHP code is evaluated.
     $edit = array();
     $langcode = Language::LANGCODE_NOT_SPECIFIED;
     $edit["body[$langcode][0][format]"] = $this->php_code_format->format;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node->label())), 'PHP code filter turned on.');
 
     // Make sure that the PHP code shows up as text.
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
index 345ae8c..aa45ca9 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
@@ -47,7 +47,7 @@ public function setUp() {
 
     // Prepares commonly used URIs.
     $this->base_uri = url('<front>', array('absolute' => TRUE));
-    $this->node_uri = url('node/' . $this->node->nid, array('absolute' => TRUE));
+    $this->node_uri = url('node/' . $this->node->id(), array('absolute' => TRUE));
 
     // Set relation between node and comment.
     $article_mapping = rdf_get_mapping('node', 'article');
@@ -109,8 +109,8 @@ public function setUp() {
    */
   public function testNumberOfCommentsRdfaMarkup() {
     // Posts 2 comments on behalf of registered user.
-    $this->saveComment($this->node->nid, $this->web_user->id());
-    $this->saveComment($this->node->nid, $this->web_user->id());
+    $this->saveComment($this->node->id(), $this->web_user->id());
+    $this->saveComment($this->node->id(), $this->web_user->id());
 
     // Tests number of comments in teaser view.
     $this->drupalLogin($this->web_user);
@@ -126,13 +126,13 @@ public function testNumberOfCommentsRdfaMarkup() {
     );
     $this->assertTrue($graph->hasProperty($this->node_uri, 'http://rdfs.org/sioc/ns#num_replies', $expected_value), 'Number of comments found in RDF output of teaser view (sioc:num_replies).');
     // Makes sure we don't generate the wrong statement for number of comments.
-    $node_comments_uri = url('node/' . $this->node->nid, array('fragment' => 'comments', 'absolute' => TRUE));
+    $node_comments_uri = url('node/' . $this->node->id(), array('fragment' => 'comments', 'absolute' => TRUE));
     $this->assertFalse($graph->hasProperty($node_comments_uri, 'http://rdfs.org/sioc/ns#num_replies', $expected_value), 'Number of comments found in RDF output of teaser view mode (sioc:num_replies).');
 
     // Tests number of comments in full node view, expected value is the same.
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
-    $parser->parse($graph, $this->drupalGet('node/' . $this->node->nid), 'rdfa', $this->base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri);
     $this->assertTrue($graph->hasProperty($this->node_uri, 'http://rdfs.org/sioc/ns#num_replies', $expected_value), 'Number of comments found in RDF output of full node view mode (sioc:num_replies).');
   }
 
@@ -144,20 +144,20 @@ public function testNumberOfCommentsRdfaMarkup() {
    */
   public function testCommentRdfaMarkup() {
     // Posts comment #1 on behalf of registered user.
-    $comment1 = $this->saveComment($this->node->nid, $this->web_user->id());
+    $comment1 = $this->saveComment($this->node->id(), $this->web_user->id());
 
     // Tests comment #1 with access to the user profile.
     $this->drupalLogin($this->web_user);
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
-    $parser->parse($graph, $this->drupalGet('node/' . $this->node->nid), 'rdfa', $this->base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri);
     $this->_testBasicCommentRdfaMarkup($graph, $comment1);
 
     // Tests comment #1 with no access to the user profile (as anonymous user).
     $this->drupalLogout();
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
-    $parser->parse($graph, $this->drupalGet('node/' . $this->node->nid), 'rdfa', $this->base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri);
     $this->_testBasicCommentRdfaMarkup($graph, $comment1);
 
     // Posts comment #2 as anonymous user.
@@ -165,19 +165,19 @@ public function testCommentRdfaMarkup() {
     $anonymous_user['name'] = $this->randomName();
     $anonymous_user['mail'] = 'tester@simpletest.org';
     $anonymous_user['homepage'] = 'http://example.org/';
-    $comment2 = $this->saveComment($this->node->nid, NULL, $anonymous_user);
+    $comment2 = $this->saveComment($this->node->id(), NULL, $anonymous_user);
 
     // Tests comment #2 as anonymous user.
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
-    $parser->parse($graph, $this->drupalGet('node/' . $this->node->nid), 'rdfa', $this->base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri);
     $this->_testBasicCommentRdfaMarkup($graph, $comment2, $anonymous_user);
 
     // Tests comment #2 as logged in user.
     $this->drupalLogin($this->web_user);
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
-    $parser->parse($graph, $this->drupalGet('node/' . $this->node->nid), 'rdfa', $this->base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri);
     $this->_testBasicCommentRdfaMarkup($graph, $comment2, $anonymous_user);
   }
 
@@ -187,17 +187,17 @@ public function testCommentRdfaMarkup() {
   public function testCommentReplyOfRdfaMarkup() {
     // Posts comment #1 on behalf of registered user.
     $this->drupalLogin($this->web_user);
-    $comment_1 = $this->saveComment($this->node->nid, $this->web_user->id());
+    $comment_1 = $this->saveComment($this->node->id(), $this->web_user->id());
 
     $comment_1_uri = url('comment/' . $comment_1->id(), array('absolute' => TRUE));
 
     // Posts a reply to the first comment.
-    $comment_2 = $this->saveComment($this->node->nid, $this->web_user->id(), NULL, $comment_1->id());
+    $comment_2 = $this->saveComment($this->node->id(), $this->web_user->id(), NULL, $comment_1->id());
     $comment_2_uri = url('comment/' . $comment_2->id(), array('absolute' => TRUE));
 
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
-    $parser->parse($graph, $this->drupalGet('node/' . $this->node->nid), 'rdfa', $this->base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $this->node->id()), 'rdfa', $this->base_uri);
 
     // Tests the reply_of relationship of a first level comment.
     $expected_value = array(
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php
index bf18a63..1377b04 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/NodeAttributesTest.php
@@ -53,13 +53,13 @@ public function setUp() {
   function testNodeAttributes() {
     $node = $this->drupalCreateNode(array('type' => 'article'));
 
-    $node_uri = url('node/' . $node->nid, array('absolute' => TRUE));
+    $node_uri = url('node/' . $node->id(), array('absolute' => TRUE));
     $base_uri = url('<front>', array('absolute' => TRUE));
 
     // Parses front page where the node is displayed in its teaser form.
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
-    $parser->parse($graph, $this->drupalGet('node/' . $node->nid), 'rdfa', $base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $node->id()), 'rdfa', $base_uri);
 
     // Inspects RDF graph output.
     // Node type.
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php
index 78c91ca..70bdda0 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TaxonomyTermFieldAttributesTest.php
@@ -106,7 +106,7 @@ function testNodeTeaser() {
     $parser->parse($graph, $html, 'rdfa', $base_uri);
 
     // Node relations to taxonomy terms.
-    $node_uri = url('node/' . $node->nid, array('absolute' => TRUE));
+    $node_uri = url('node/' . $node->id(), array('absolute' => TRUE));
     $expected_value = array(
       'type' => 'uri',
       'value' => $taxonomy_term_1_uri,
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php
index d2d1cdd..51ca922 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php
@@ -118,7 +118,7 @@ function testAttributesInTracker() {
    * The node just created.
    */
   function _testBasicTrackerRdfaMarkup(EntityInterface $node) {
-    $node_uri = url('node/' . $node->nid, array('absolute' => TRUE));
+    $node_uri = url('node/' . $node->id(), array('absolute' => TRUE));
     $user_uri = url('user/' . $node->uid, array('absolute' => TRUE));
 
     $user = ($node->uid == 0) ? 'Anonymous user' : 'Registered user';
@@ -170,7 +170,7 @@ function _testBasicTrackerRdfaMarkup(EntityInterface $node) {
       'subject' => $this->randomName(),
       'comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]' => $this->randomName(),
     );
-    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save'));
+    $this->drupalPost('comment/reply/' . $node->id(), $comment, t('Save'));
 
     // Parses tracker page where the nodes are displayed in a table.
     $parser = new \EasyRdf_Parser_Rdfa();
@@ -187,7 +187,7 @@ function _testBasicTrackerRdfaMarkup(EntityInterface $node) {
     // Last updated due to new comment.
     // last_activity_date needs to be queried from the database directly because
     // it cannot be accessed via node_load().
-    $expected_last_activity_date = db_query('SELECT t.changed FROM {tracker_node} t WHERE t.nid = (:nid)', array(':nid' => $node->nid))->fetchField();
+    $expected_last_activity_date = db_query('SELECT t.changed FROM {tracker_node} t WHERE t.nid = (:nid)', array(':nid' => $node->id()))->fetchField();
     $expected_value = array(
       'type' => 'literal',
       'value' => date('c', $expected_last_activity_date),
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php
index c5ba5f8..0c77003 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php
@@ -87,7 +87,7 @@ function testUserAttributesInMarkup() {
     $parser = new \EasyRdf_Parser_Rdfa();
     $graph = new \EasyRdf_Graph();
     $base_uri = url('<front>', array('absolute' => TRUE));
-    $parser->parse($graph, $this->drupalGet('node/' . $node->nid), 'rdfa', $base_uri);
+    $parser->parse($graph, $this->drupalGet('node/' . $node->id()), 'rdfa', $base_uri);
 
     // Ensures the default bundle mapping for user is used on the Authored By
     // information on the node.
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
index f64a044..35bf2b4 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
@@ -80,7 +80,7 @@ function testSearchResultsComment() {
     $edit_comment['comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]'] = '<h1>' . $comment_body . '</h1>';
     $full_html_format_id = 'full_html';
     $edit_comment['comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][format]'] = $full_html_format_id;
-    $this->drupalPost('comment/reply/' . $node->nid, $edit_comment, t('Save'));
+    $this->drupalPost('comment/reply/' . $node->id(), $edit_comment, t('Save'));
 
     // Invoke search index update.
     $this->drupalLogout();
@@ -91,7 +91,7 @@ function testSearchResultsComment() {
       'search_block_form' => "'" . $edit_comment['subject'] . "'",
     );
     $this->drupalPost('', $edit, t('Search'));
-    $node2 = node_load($node->nid, TRUE);
+    $node2 = node_load($node->id(), TRUE);
     $this->assertText($node2->label(), 'Node found in search results.');
     $this->assertText($edit_comment['subject'], 'Comment subject found in search results.');
 
@@ -137,7 +137,7 @@ function testSearchResultsCommentAccess() {
     $edit_comment = array();
     $edit_comment['subject'] = $this->comment_subject;
     $edit_comment['comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]'] = '<h1>' . $comment_body . '</h1>';
-    $this->drupalPost('comment/reply/' . $this->node->nid, $edit_comment, t('Save'));
+    $this->drupalPost('comment/reply/' . $this->node->id(), $edit_comment, t('Save'));
 
     $this->drupalLogout();
     $this->setRolePermissions(DRUPAL_ANONYMOUS_RID);
@@ -193,7 +193,7 @@ function setRolePermissions($rid, $access_comments = FALSE, $search_content = TR
    */
   function assertCommentAccess($assume_access, $message) {
     // Invoke search index update.
-    search_touch_node($this->node->nid);
+    search_touch_node($this->node->id());
     $this->cronRun();
 
     // Search for the comment subject.
@@ -230,7 +230,7 @@ function testAddNewComment() {
     $node = $this->drupalCreateNode($settings);
     // Verify that if you view the node on its own page, 'add new comment'
     // is there.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText(t('Add new comment'), 'Add new comment appears on node page');
 
     // Run cron to index this page.
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
index 8d91a82..45067e4 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
@@ -46,8 +46,8 @@ function setUp() {
     // also needs the word "pizza" so we can use it as the search keyword.
     $langcode = Language::LANGCODE_NOT_SPECIFIED;
     $body_key = "body[$langcode][0][value]";
-    $edit[$body_key] = l($node->label(), 'node/' . $node->nid) . ' pizza sandwich';
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
+    $edit[$body_key] = l($node->label(), 'node/' . $node->id()) . ' pizza sandwich';
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
 
     node_update_index();
     search_update_totals();
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php
index 266c47d..d9ab415 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php
@@ -123,9 +123,7 @@ function testSearchingMultilingualFieldValues() {
       $body_language_variant = end($node->body);
       $search_result = node_search_execute($body_language_variant[0]['value']);
       // See whether we get the same node as a result.
-      $sts = $this->assertTrue(!empty($search_result[0]['node']->nid)
-        && $search_result[0]['node']->nid == $node->nid,
-        'The search has resulted the correct node.');
+      $this->assertEqual($search_result[0]['node']->id(), $node->id(), 'The search has resulted the correct node.');
     }
   }
 }
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
index e85dcd6..30e8e3d 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
@@ -73,7 +73,7 @@ function testRankings() {
     $edit = array();
     $edit['subject'] = 'my comment title';
     $edit['comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]'] = 'some random comment';
-    $this->drupalGet('comment/reply/' . $nodes['comments'][1]->nid);
+    $this->drupalGet('comment/reply/' . $nodes['comments'][1]->id());
     $this->drupalPost(NULL, $edit, t('Preview'));
     $this->drupalPost(NULL, $edit, t('Save'));
 
@@ -185,7 +185,7 @@ function testHTMLRankings() {
       $set = array_slice($set, -2, 1);
 
       // Assert the results.
-      $this->assertEqual($set[0]['node']->nid, $node->nid, 'Search tag ranking for "&lt;' . $tag . '&gt;" order.');
+      $this->assertEqual($set[0]['node']->nid, $node->id(), 'Search tag ranking for "&lt;' . $tag . '&gt;" order.');
 
       // Delete node so it doesn't show up in subsequent search results.
       $node->delete();
@@ -228,6 +228,6 @@ function testDoubleRankings() {
 
     // Do the search and assert the results.
     $set = node_search_execute('rocks');
-    $this->assertEqual($set[0]['node']->nid, $node->nid, 'Search double ranking order.');
+    $this->assertEqual($set[0]['node']->nid, $node->id(), 'Search double ranking order.');
   }
 }
diff --git a/core/modules/search/search.api.php b/core/modules/search/search.api.php
index 028b803..03b45aa 100644
--- a/core/modules/search/search.api.php
+++ b/core/modules/search/search.api.php
@@ -343,7 +343,7 @@ function hook_update_index() {
   $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit);
 
   foreach ($result as $node) {
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
 
     // Save the changed time of the most recent indexed node, for the search
     // results half-life calculation.
@@ -362,7 +362,7 @@ function hook_update_index() {
     }
 
     // Update index
-    search_index($node->nid, 'node', $text);
+    search_index($node->id(), 'node', $text);
   }
 }
 
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index fce4630..ba5434f 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -789,7 +789,7 @@ function search_touch_node($nid) {
  */
 function search_node_update_index(EntityInterface $node) {
   // Transplant links to a node into the target node.
-  $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = :nid", array(':nid' => $node->nid), array('target' => 'slave'));
+  $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = :nid", array(':nid' => $node->id()), array('target' => 'slave'));
   $output = array();
   foreach ($result as $link) {
     $output[] = $link->caption;
@@ -805,7 +805,7 @@ function search_node_update_index(EntityInterface $node) {
 function search_node_update(EntityInterface $node) {
   // Reindex the node when it is updated. The node is automatically indexed
   // when it is added, simply by being added to the node table.
-  search_touch_node($node->nid);
+  search_touch_node($node->id());
 }
 
 /**
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
index 6bc3a2c..fade12a 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
@@ -28,7 +28,7 @@ function testShortcutLinkAdd() {
 
     // Create an alias for the node so we can test aliases.
     $path = array(
-      'source' => 'node/' . $this->node->nid,
+      'source' => 'node/' . $this->node->id(),
       'alias' => $this->randomName(8),
     );
     $this->container->get('path.crud')->save($path['source'], $path['alias']);
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
index 949206f..0e2ddbb 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
@@ -80,7 +80,7 @@ function testStatisticsSettings() {
     $this->assertTrue($config->get('count_content_views'), 'Count content view log is enabled.');
 
     // Hit the node.
-    $this->drupalGet('node/' . $this->test_node->nid);
+    $this->drupalGet('node/' . $this->test_node->id());
     // Manually calling statistics.php, simulating ajax behavior.
     $nid = $this->test_node->nid;
     $post = http_build_query(array('nid' => $nid));
@@ -91,11 +91,11 @@ function testStatisticsSettings() {
 
     // Hit the node again (the counter is incremented after the hit, so
     // "1 view" will actually be shown when the node is hit the second time).
-    $this->drupalGet('node/' . $this->test_node->nid);
+    $this->drupalGet('node/' . $this->test_node->id());
     $this->client->post($stats_path, $headers, $post)->send();
     $this->assertText('1 view', 'Node is viewed once.');
 
-    $this->drupalGet('node/' . $this->test_node->nid);
+    $this->drupalGet('node/' . $this->test_node->id());
     $this->client->post($stats_path, $headers, $post)->send();
     $this->assertText('2 views', 'Node is viewed 2 times.');
   }
@@ -106,7 +106,7 @@ function testStatisticsSettings() {
   function testDeleteNode() {
     config('statistics.settings')->set('count_content_views', 1)->save();
 
-    $this->drupalGet('node/' . $this->test_node->nid);
+    $this->drupalGet('node/' . $this->test_node->id());
     // Manually calling statistics.php, simulating ajax behavior.
     $nid = $this->test_node->nid;
     $post = http_build_query(array('nid' => $nid));
@@ -117,16 +117,16 @@ function testDeleteNode() {
 
     $result = db_select('node_counter', 'n')
       ->fields('n', array('nid'))
-      ->condition('n.nid', $this->test_node->nid)
+      ->condition('n.nid', $this->test_node->id())
       ->execute()
       ->fetchAssoc();
-    $this->assertEqual($result['nid'], $this->test_node->nid, 'Verifying that the node counter is incremented.');
+    $this->assertEqual($result['nid'], $this->test_node->id(), 'Verifying that the node counter is incremented.');
 
     $this->test_node->delete();
 
     $result = db_select('node_counter', 'n')
       ->fields('n', array('nid'))
-      ->condition('n.nid', $this->test_node->nid)
+      ->condition('n.nid', $this->test_node->id())
       ->execute()
       ->fetchAssoc();
     $this->assertFalse($result, 'Verifying that the node counter is deleted.');
@@ -141,7 +141,7 @@ function testExpiredLogs() {
       ->save();
     \Drupal::state()->set('statistics.day_timestamp', 8640000);
 
-    $this->drupalGet('node/' . $this->test_node->nid);
+    $this->drupalGet('node/' . $this->test_node->id());
     // Manually calling statistics.php, simulating ajax behavior.
     $nid = $this->test_node->nid;
     $post = http_build_query(array('nid' => $nid));
@@ -149,7 +149,7 @@ function testExpiredLogs() {
     global $base_url;
     $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
     $this->client->post($stats_path, $headers, $post)->send();
-    $this->drupalGet('node/' . $this->test_node->nid);
+    $this->drupalGet('node/' . $this->test_node->id());
     $this->client->post($stats_path, $headers, $post)->send();
     $this->assertText('1 view', 'Node is viewed once.');
 
@@ -161,11 +161,11 @@ function testExpiredLogs() {
     $this->cronRun();
 
     $this->drupalGet('admin/reports/pages');
-    $this->assertNoText('node/' . $this->test_node->nid, 'No hit URL found.');
+    $this->assertNoText('node/' . $this->test_node->id(), 'No hit URL found.');
 
     $result = db_select('node_counter', 'nc')
       ->fields('nc', array('daycount'))
-      ->condition('nid', $this->test_node->nid, '=')
+      ->condition('nid', $this->test_node->id(), '=')
       ->execute()
       ->fetchField();
     $this->assertFalse($result, 'Daycounter is zero.');
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
index 76551c7..24788ae 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
@@ -91,7 +91,7 @@ function testLogging() {
     $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
     $this->client->post($stats_path, $headers, $post)->send();
     $this->assertIdentical($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Testing an uncached page.');
-    $node_counter = statistics_get($this->node->nid);
+    $node_counter = statistics_get($this->node->id());
     $this->assertIdentical($node_counter['totalcount'], '1');
 
     // Verify logging of a cached page.
@@ -99,7 +99,7 @@ function testLogging() {
     // Manually calling statistics.php, simulating ajax behavior.
     $this->client->post($stats_path, $headers, $post)->send();
     $this->assertIdentical($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Testing a cached page.');
-    $node_counter = statistics_get($this->node->nid);
+    $node_counter = statistics_get($this->node->id());
     $this->assertIdentical($node_counter['totalcount'], '2');
 
     // Test logging from authenticated users
@@ -107,7 +107,7 @@ function testLogging() {
     $this->drupalGet($path);
     // Manually calling statistics.php, simulating ajax behavior.
     $this->client->post($stats_path, $headers, $post)->send();
-    $node_counter = statistics_get($this->node->nid);
+    $node_counter = statistics_get($this->node->id());
     $this->assertIdentical($node_counter['totalcount'], '3');
 
   }
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php
index 9a6b22f..833d63f 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php
@@ -29,7 +29,7 @@ function testPopularContentBlock() {
 
     // Visit a node to have something show up in the block.
     $node = $this->drupalCreateNode(array('type' => 'page', 'uid' => $this->blocking_user->id()));
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     // Manually calling statistics.php, simulating ajax behavior.
     $nid = $node->nid;
     $post = http_build_query(array('nid' => $nid));
@@ -55,7 +55,7 @@ function testPopularContentBlock() {
     $this->assertText('All time', 'Found the all time popular content.');
     $this->assertText('Last viewed', 'Found the last viewed popular content.');
 
-    $this->assertRaw(l($node->label(), 'node/' . $node->nid), 'Found link to visited node.');
+    $this->assertRaw(l($node->label(), 'node/' . $node->id()), 'Found link to visited node.');
   }
 
 }
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
index 56246cd..34c1699 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
@@ -33,7 +33,7 @@ function testStatisticsTokenReplacement() {
     $node = $this->drupalCreateNode(array('type' => 'page', 'uid' => $user->id()));
 
     // Hit the node.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     // Manually calling statistics.php, simulating ajax behavior.
     $nid = $node->nid;
     $post = http_build_query(array('nid' => $nid));
@@ -43,7 +43,7 @@ function testStatisticsTokenReplacement() {
     $client = \Drupal::httpClient();
     $client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
     $client->post($stats_path, $headers, $post)->send();
-    $statistics = statistics_get($node->nid);
+    $statistics = statistics_get($node->id());
 
     // Generate and test tokens.
     $tests = array();
diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index 0c4580c..c40fc6a 100644
--- a/core/modules/statistics/statistics.module
+++ b/core/modules/statistics/statistics.module
@@ -48,9 +48,9 @@ function statistics_permission() {
  * Implements hook_node_view().
  */
 function statistics_node_view(EntityInterface $node, EntityDisplay $display, $view_mode) {
-  if (!empty($node->nid) && $view_mode == 'full' && node_is_page($node) && empty($node->in_preview)) {
+  if (!$node->isNew() && $view_mode == 'full' && node_is_page($node) && empty($node->in_preview)) {
     $node->content['#attached']['library'][] = array('statistics', 'drupal.statistics');
-    $settings = array('data' => array('nid' => $node->nid), 'url' => url(drupal_get_path('module', 'statistics') . '/statistics.php'));
+    $settings = array('data' => array('nid' => $node->id()), 'url' => url(drupal_get_path('module', 'statistics') . '/statistics.php'));
     $node->content['#attached']['js'][] = array(
       'data' => array('statistics' => $settings),
       'type' => 'setting',
@@ -59,7 +59,7 @@ function statistics_node_view(EntityInterface $node, EntityDisplay $display, $vi
 
   if ($view_mode != 'rss') {
     if (user_access('view post access counter')) {
-      $statistics = statistics_get($node->nid);
+      $statistics = statistics_get($node->id());
       if ($statistics) {
         $links['statistics_counter']['title'] = format_plural($statistics['totalcount'], '1 view', '@count views');
         $node->content['links']['statistics'] = array(
@@ -203,7 +203,7 @@ function _statistics_format_item($title, $path) {
 function statistics_node_predelete(EntityInterface $node) {
   // clean up statistics table when node is deleted
   db_delete('node_counter')
-    ->condition('nid', $node->nid)
+    ->condition('nid', $node->id())
     ->execute();
 }
 
diff --git a/core/modules/statistics/statistics.tokens.inc b/core/modules/statistics/statistics.tokens.inc
index 27f628e..7fd103b 100644
--- a/core/modules/statistics/statistics.tokens.inc
+++ b/core/modules/statistics/statistics.tokens.inc
@@ -42,21 +42,21 @@ function statistics_tokens($type, $tokens, array $data = array(), array $options
 
     foreach ($tokens as $name => $original) {
       if ($name == 'total-count') {
-        $statistics = statistics_get($node->nid);
+        $statistics = statistics_get($node->id());
         $replacements[$original] = $statistics['totalcount'];
       }
       elseif ($name == 'day-count') {
-        $statistics = statistics_get($node->nid);
+        $statistics = statistics_get($node->id());
         $replacements[$original] = $statistics['daycount'];
       }
       elseif ($name == 'last-view') {
-        $statistics = statistics_get($node->nid);
+        $statistics = statistics_get($node->id());
         $replacements[$original] = format_date($statistics['timestamp']);
       }
     }
 
     if ($created_tokens = $token_service->findWithPrefix($tokens, 'last-view')) {
-      $statistics = statistics_get($node->nid);
+      $statistics = statistics_get($node->id());
       $replacements += $token_service->generate('date', $created_tokens, array('date' => $statistics['timestamp']), $options);
     }
   }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityBCDecoratorTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityBCDecoratorTest.php
index 68b2525..f9746d2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityBCDecoratorTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityBCDecoratorTest.php
@@ -50,7 +50,7 @@ public function testBCDecorator() {
     ));
     $node->save();
     $comment = entity_create('comment', array(
-      'nid' => $node->nid,
+      'nid' => $node->id(),
       'subject' => 'old-value',
     ));
     $comment->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php
index 4d98908..383ff1f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php
@@ -305,7 +305,7 @@ public function testNodeHooks() {
     ));
 
     $_SESSION['entity_crud_hook_test'] = array();
-    $node = node_load($node->nid);
+    $node = node_load($node->id());
 
     $this->assertHookMessageOrder(array(
       'entity_crud_hook_test_entity_load called for type node',
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php
index ef6c81a..80e8a6b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php
@@ -72,7 +72,7 @@ function testEntityFormLanguage() {
     $this->assertTrue($node->langcode == $form_langcode, 'Form language is the same as the entity language.');
 
     // Edit the node and test the form language.
-    $this->drupalGet($this->langcodes[0] . '/node/' . $node->nid . '/edit');
+    $this->drupalGet($this->langcodes[0] . '/node/' . $node->id() . '/edit');
     $form_langcode = \Drupal::state()->get('entity_test.form_langcode') ?: FALSE;
     $this->assertTrue($node->langcode == $form_langcode, 'Form language is the same as the entity language.');
 
@@ -114,7 +114,7 @@ function testEntityFormLanguage() {
     $langcode2 = $this->langcodes[1];
     $node->getTranslation($langcode2)->body->value = $this->randomName(16);
     $node->save();
-    $this->drupalGet($langcode2 . '/node/' . $node->nid . '/edit');
+    $this->drupalGet($langcode2 . '/node/' . $node->id() . '/edit');
     $form_langcode = \Drupal::state()->get('entity_test.form_langcode') ?: FALSE;
     $this->assertTrue($langcode2 == $form_langcode, "Node edit form language is $langcode2.");
   }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index fdb3a70..c2f398c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -171,7 +171,7 @@ function testBreadCrumbs() {
 
     // Verify node breadcrumbs (without menu link).
     $node1 = $this->drupalCreateNode();
-    $nid1 = $node1->nid;
+    $nid1 = $node1->id();
     $trail = $home;
     $this->assertBreadcrumb("node/$nid1", $trail);
     // Also verify that the node does not appear elsewhere (e.g., menu trees).
@@ -215,7 +215,7 @@ function testBreadCrumbs() {
           'plid' => 0,
         )),
       ));
-      $nid2 = $node2->nid;
+      $nid2 = $node2->id();
 
       $trail = $home;
       $tree = array(
@@ -243,7 +243,7 @@ function testBreadCrumbs() {
           'plid' => $node2->menu['mlid'],
         )),
       ));
-      $nid3 = $node3->nid;
+      $nid3 = $node3->id();
 
       $this->assertBreadcrumb("node/$nid3", $trail, $node3->title, $tree, FALSE);
       // The node itself should not be contained in the breadcrumb on the
diff --git a/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php b/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php
index d56ee5f..82352da 100644
--- a/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/ParamConverter/UpcastingTest.php
@@ -71,7 +71,7 @@ public function testSameTypes() {
     // paramconverter_test/node/{node}/set/parent/{parent}
     // converters:
     //   parent: 'node'
-    $this->drupalGet("paramconverter_test/node/" . $node->nid . "/set/parent/" . $parent->nid);
+    $this->drupalGet("paramconverter_test/node/" . $node->id() . "/set/parent/" . $parent->id());
     $this->assertRaw("Setting '" . $parent->title . "' as parent of '" . $node->title . "'.");
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php
index 27e126a..962d21f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php
@@ -99,16 +99,16 @@ function testLocalizeDateFormats() {
     $node = $this->drupalCreateNode(array('type' => 'article'));
 
     // Configure format for the node posted date changes with the language.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $english_date = format_date($node->created, 'custom', 'j M Y');
     $this->assertText($english_date, 'English date format appears');
-    $this->drupalGet('fr/node/' . $node->nid);
+    $this->drupalGet('fr/node/' . $node->id());
     $french_date = format_date($node->created, 'custom', 'd.m.Y');
     $this->assertText($french_date, 'French date format appears');
 
     // Make sure we can reset dates back to default.
     $this->drupalPost('admin/config/regional/date-time/locale/en/reset', array(), t('Reset'));
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertNoText($english_date, 'English date format does not appear');
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
index b9752b4..742647c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
@@ -58,18 +58,18 @@ function testTimeZoneHandling() {
     $node2 = $this->drupalCreateNode(array('created' => strtotime($date2), 'type' => 'article'));
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->drupalGet('node/' . $node1->id());
     $this->assertText('2007-01-31 21:00:00 -1000', 'Date should be identical, with GMT offset of -10 hours.');
-    $this->drupalGet("node/$node2->nid");
+    $this->drupalGet('node/' . $node2->id());
     $this->assertText('2007-07-31 21:00:00 -1000', 'Date should be identical, with GMT offset of -10 hours.');
 
     // Set time zone to Los Angeles time.
     $config->set('default', 'America/Los_Angeles')->save();
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->drupalGet('node/' . $node1->id());
     $this->assertText('2007-01-31 23:00:00 -0800', 'Date should be two hours ahead, with GMT offset of -8 hours.');
-    $this->drupalGet("node/$node2->nid");
+    $this->drupalGet('node/' . $node2->id());
     $this->assertText('2007-08-01 00:00:00 -0700', 'Date should be three hours ahead, with GMT offset of -7 hours.');
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php
index 9d96be8..7881a83 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php
@@ -80,7 +80,7 @@ function testTitleTags() {
 
     $node = $this->drupalGetNodeByTitle($edit["title"]);
     $this->assertNotNull($node, 'Node created and found in database');
-    $this->drupalGet("node/" . $node->nid);
+    $this->drupalGet("node/" . $node->id());
     $this->assertText(check_plain($edit["title"]), 'Check to make sure tags in the node title are converted.');
   }
   /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
index d9e2adb..c059f44 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
@@ -183,13 +183,13 @@ function testAdministrationTheme() {
     $this->drupalGet('admin/config');
     $this->assertRaw('core/themes/seven', 'Administration theme used on an administration page.');
 
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->drupalGet('node/' . $this->node->id());
     $this->assertRaw('core/themes/stark', 'Site default theme used on node page.');
 
     $this->drupalGet('node/add');
     $this->assertRaw('core/themes/seven', 'Administration theme used on the add content page.');
 
-    $this->drupalGet('node/' . $this->node->nid . '/edit');
+    $this->drupalGet('node/' . $this->node->id() . '/edit');
     $this->assertRaw('core/themes/seven', 'Administration theme used on the edit content page.');
 
     // Disable the admin theme on the node admin pages.
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 ba4bca5..7a06c78 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
@@ -107,7 +107,7 @@ function setUp() {
 
     // Create a test comment on the test node.
     $this->comment = entity_create('comment', array(
-      'nid' => $this->node->nid,
+      'nid' => $this->node->id(),
       'node_type' => $this->node->type,
       'status' => COMMENT_PUBLISHED,
       'subject' => $this->xss_label,
@@ -124,7 +124,7 @@ function testThemedEntity() {
     $paths = array(
       'user',
       'node',
-      'node/' . $this->node->nid,
+      'node/' . $this->node->id(),
       'taxonomy/term/' . $this->term->id(),
     );
 
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index a8dcd13..d395462 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -1861,7 +1861,7 @@ function hook_mail($key, &$message, $params) {
     $node = $params['node'];
     $variables += array(
       '%uid' => $node->uid,
-      '%node_url' => url('node/' . $node->nid, array('absolute' => TRUE)),
+      '%node_url' => url('node/' . $node->id(), array('absolute' => TRUE)),
       '%node_type' => node_get_type_label($node),
       '%title' => $node->title,
       '%teaser' => $node->teaser,
@@ -3145,7 +3145,7 @@ function hook_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'edit-url':
-          $replacements[$original] = url('node/' . $node->nid . '/edit', $url_options);
+          $replacements[$original] = url('node/' . $node->id() . '/edit', $url_options);
           break;
 
         // Default values for the chained tokens handled below.
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
index 8fa30c3..991f274 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
@@ -113,39 +113,39 @@ function testTaxonomyIndex() {
     // Check that the term is indexed, and only once.
     $node = $this->drupalGetNodeByTitle($edit["title"]);
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 1 is indexed once.');
 
     // Update the article to change one term.
     $edit["{$this->field_name_1}[$langcode][]"] = $term_2->id();
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
 
     // Check that both terms are indexed.
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 1 is indexed.');
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 2 is indexed.');
 
     // Update the article to change another term.
     $edit["{$this->field_name_2}[$langcode][]"] = $term_2->id();
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
 
     // Check that only one term is indexed.
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ))->fetchField();
     $this->assertEqual(0, $index_count, 'Term 1 is not indexed.');
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 2 is indexed once.');
@@ -159,12 +159,12 @@ function testTaxonomyIndex() {
 
     // Check that the index was not changed.
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ))->fetchField();
     $this->assertEqual(0, $index_count, 'Term 1 is not indexed.');
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 2 is indexed once.');
@@ -175,12 +175,12 @@ function testTaxonomyIndex() {
 
     // Check that both terms are indexed.
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 1 is indexed.');
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 2 is indexed.');
@@ -191,12 +191,12 @@ function testTaxonomyIndex() {
 
     // Check that only one term is indexed.
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ))->fetchField();
     $this->assertEqual(1, $index_count, 'Term 1 is indexed once.');
     $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
-      ':nid' => $node->nid,
+      ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ))->fetchField();
     $this->assertEqual(0, $index_count, 'Term 2 is not indexed.');
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
index 9dbf118..f6f4a7b 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
@@ -118,7 +118,7 @@ function testTaxonomyNode() {
 
     // Check that the term is displayed when the node is viewed.
     $node = $this->drupalGetNodeByTitle($edit["title"]);
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($term1->label(), 'Term is displayed when viewing the node.');
 
     $this->clickLink(t('Edit'));
@@ -128,13 +128,13 @@ function testTaxonomyNode() {
 
     // Edit the node with a different term.
     $edit[$this->instance['field_name'] . '[' . $langcode . '][]'] = $term2->id();
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertText($term2->label(), 'Term is displayed when viewing the node.');
 
     // Preview the node.
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Preview'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Preview'));
     $this->assertNoUniqueText($term2->label(), 'Term is displayed when previewing the node.');
     $this->drupalPost(NULL, NULL, t('Preview'));
     $this->assertNoUniqueText($term2->label(), 'Term is displayed when previewing the node again.');
@@ -208,7 +208,7 @@ function testNodeTermCreationAndDeletion() {
 
     // Get the node.
     $node = $this->drupalGetNodeByTitle($edit["title"]);
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
 
     foreach ($term_names as $term_name) {
       $this->assertText($term_name, format_string('The term %name appears on the node page after two terms, %deleted1 and %deleted2, were deleted', array('%name' => $term_name, '%deleted1' => $term_objects['term1']->label(), '%deleted2' => $term_objects['term2']->label())));
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
index 622eae7..35f4555 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
@@ -81,7 +81,7 @@ function testTaxonomyTokenReplacement() {
     $edit = array();
     $node = $this->drupalCreateNode(array('type' => 'article'));
     $edit[$this->field_name . '[' . $this->langcode . '][]'] = $term2->id();
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
 
     // Generate and test sanitized tokens for term1.
     $tests = array();
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 402a8e6..c078d82 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -1162,7 +1162,7 @@ function taxonomy_build_node_index($node) {
       $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created'));
       foreach ($tid_all as $tid) {
         $query->values(array(
-          'nid' => $node->nid,
+          'nid' => $node->id(),
           'tid' => $tid,
           'sticky' => $sticky,
           'created' => $node->created,
@@ -1198,7 +1198,7 @@ function taxonomy_node_predelete(EntityInterface $node) {
  */
 function taxonomy_delete_node_index(EntityInterface $node) {
   if (config('taxonomy.settings')->get('maintain_index_table')) {
-    db_delete('taxonomy_index')->condition('nid', $node->nid)->execute();
+    db_delete('taxonomy_index')->condition('nid', $node->id())->execute();
   }
 }
 
diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
index baa48d0..d679e04 100644
--- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
+++ b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
@@ -144,7 +144,7 @@ function testTrackerNewNodes() {
     $this->drupalGet('tracker');
     $this->assertPattern('/' . $title . '.*new/', 'New nodes are flagged as such in the tracker listing.');
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->drupalGet('tracker');
     $this->assertNoPattern('/' . $title . '.*new/', 'Visited nodes are not flagged as new.');
 
@@ -152,7 +152,7 @@ function testTrackerNewNodes() {
     $this->drupalGet('tracker');
     $this->assertPattern('/' . $title . '.*new/', 'For another user, new nodes are flagged as such in the tracker listing.');
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->drupalGet('tracker');
     $this->assertNoPattern('/' . $title . '.*new/', 'For another user, visited nodes are not flagged as new.');
   }
@@ -174,12 +174,12 @@ function testTrackerNewComments() {
       'comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]' => $this->randomName(20),
     );
     // The new comment is automatically viewed by the current user.
-    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save'));
+    $this->drupalPost('comment/reply/' . $node->id(), $comment, t('Save'));
 
     $this->drupalLogin($this->other_user);
     $this->drupalGet('tracker');
     $this->assertText('1 new', 'New comments are counted on the tracker listing pages.');
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
 
     // Add another comment as other_user.
     $comment = array(
@@ -189,7 +189,7 @@ function testTrackerNewComments() {
     // If the comment is posted in the same second as the last one then Drupal
     // can't tell the difference, so we wait one second here.
     sleep(1);
-    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save'));
+    $this->drupalPost('comment/reply/' . $node->id(), $comment, t('Save'));
 
     $this->drupalLogin($this->user);
     $this->drupalGet('tracker');
@@ -273,7 +273,7 @@ function testTrackerAdminUnpublish() {
     // Unpublish the node and ensure that it's no longer displayed.
     $edit = array(
       'action' => 'node_unpublish_action',
-      'node_bulk_form[0]' => $node->nid,
+      'node_bulk_form[0]' => $node->id(),
     );
     $this->drupalPost('admin/content', $edit, t('Apply'));
 
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index edcd297..26af484 100644
--- a/core/modules/tracker/tracker.module
+++ b/core/modules/tracker/tracker.module
@@ -196,7 +196,7 @@ function _tracker_user_access($account) {
  * Adds new tracking information for this node since it's new.
  */
 function tracker_node_insert(EntityInterface $node, $arg = 0) {
-  _tracker_add($node->nid, $node->uid, $node->changed);
+  _tracker_add($node->id(), $node->uid, $node->changed);
 }
 
 /**
@@ -205,7 +205,7 @@ function tracker_node_insert(EntityInterface $node, $arg = 0) {
  * Adds tracking information for this node since it's been updated.
  */
 function tracker_node_update(EntityInterface $node, $arg = 0) {
-  _tracker_add($node->nid, $node->uid, $node->changed);
+  _tracker_add($node->id(), $node->uid, $node->changed);
 }
 
 /**
@@ -215,10 +215,10 @@ function tracker_node_update(EntityInterface $node, $arg = 0) {
  */
 function tracker_node_predelete(EntityInterface $node, $arg = 0) {
   db_delete('tracker_node')
-    ->condition('nid', $node->nid)
+    ->condition('nid', $node->id())
     ->execute();
   db_delete('tracker_user')
-    ->condition('nid', $node->nid)
+    ->condition('nid', $node->id())
     ->execute();
 }
 
diff --git a/core/modules/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc
index eabd7f4..cf2f51a 100644
--- a/core/modules/tracker/tracker.pages.inc
+++ b/core/modules/tracker/tracker.pages.inc
@@ -68,21 +68,21 @@ function tracker_page($account = NULL, $set_title = FALSE) {
       if ($node->comment_count) {
         $comments = $node->comment_count;
 
-        if ($new = comment_num_new($node->nid)) {
+        if ($new = comment_num_new($node->id())) {
           $comments .= '<br />';
-          $comments .= l(format_plural($new, '1 new', '@count new'), 'node/' . $node->nid, array('fragment' => 'new'));
+          $comments .= l(format_plural($new, '1 new', '@count new'), 'node/' . $node->id(), array('fragment' => 'new'));
         }
       }
 
       $mark_build = array(
         '#theme' => 'mark',
-        '#status' => node_mark($node->nid, $node->changed),
+        '#status' => node_mark($node->id(), $node->changed),
       );
 
       $row = array(
         'type' => check_plain(node_get_type_label($node)),
         // Do not use $node->label(), because $node comes from the database.
-        'title' => array('data' => l($node->title, 'node/' . $node->nid) . ' ' . drupal_render($mark_build)),
+        'title' => array('data' => l($node->title, 'node/' . $node->id()) . ' ' . drupal_render($mark_build)),
         'author' => array('data' => array('#theme' => 'username', '#account' => user_load($node->uid))),
         'replies' => array('class' => array('replies'), 'data' => $comments),
         'last updated' => array('data' => t('!time ago', array('!time' => format_interval(REQUEST_TIME - $node->last_activity)))),
@@ -125,7 +125,7 @@ function tracker_page($account = NULL, $set_title = FALSE) {
         // node the RDFa annotations above apply to. We move the content of
         // $row to a 'data' sub array so we can specify attributes for the row.
         $row = array('data' => $row);
-        $row['about'] = url('node/' . $node->nid);
+        $row['about'] = url('node/' . $node->id());
       }
       $rows[] = $row;
     }
diff --git a/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php b/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php
index dff34a0..761197a 100644
--- a/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php
+++ b/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Language\Language;
+use Drupal\node\NodeInterface;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -76,15 +77,15 @@ function testContentTranslation() {
     // Unpublish the original node to check that this has no impact on the
     // translation overview page, publish it again afterwards.
     $this->drupalLogin($this->admin_user);
-    $this->drupalPost('node/' . $node->nid . '/edit', array(), t('Save and unpublish'));
-    $this->drupalGet('node/' . $node->nid . '/translate');
-    $this->drupalPost('node/' . $node->nid . '/edit', array(), t('Save and publish'));
+    $this->drupalPost('node/' . $node->id() . '/edit', array(), t('Save and unpublish'));
+    $this->drupalGet('node/' . $node->id() . '/translate');
+    $this->drupalPost('node/' . $node->id() . '/edit', array(), t('Save and publish'));
     $this->drupalLogin($this->translator);
 
     // Check that the "add translation" link uses a localized path.
     $languages = language_list();
     $prefixes = language_negotiation_url_prefixes();
-    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->drupalGet('node/' . $node->id() . '/translate');
     $this->assertLinkByHref($prefixes['es'] . '/node/add/' . $node->type, 0, format_string('The "add translation" link for %language points to the localized path of the target language.', array('%language' => $languages['es']->name)));
 
     // Submit translation in Spanish.
@@ -94,13 +95,13 @@ function testContentTranslation() {
 
     // Check that the "edit translation" and "view node" links use localized
     // paths.
-    $this->drupalGet('node/' . $node->nid . '/translate');
-    $this->assertLinkByHref($prefixes['es'] . '/node/' . $node_translation->nid . '/edit', 0, format_string('The "edit" link for the translation in %language points to the localized path of the translation language.', array('%language' => $languages['es']->name)));
-    $this->assertLinkByHref($prefixes['es'] . '/node/' . $node_translation->nid, 0, format_string('The "view" link for the translation in %language points to the localized path of the translation language.', array('%language' => $languages['es']->name)));
+    $this->drupalGet('node/' . $node->id() . '/translate');
+    $this->assertLinkByHref($prefixes['es'] . '/node/' . $node_translation->id() . '/edit', 0, format_string('The "edit" link for the translation in %language points to the localized path of the translation language.', array('%language' => $languages['es']->name)));
+    $this->assertLinkByHref($prefixes['es'] . '/node/' . $node_translation->id(), 0, format_string('The "view" link for the translation in %language points to the localized path of the translation language.', array('%language' => $languages['es']->name)));
 
     // Attempt to submit a duplicate translation by visiting the node/add page
     // with identical query string.
-    $this->drupalGet('node/add/page', array('query' => array('translation' => $node->nid, 'target' => 'es')));
+    $this->drupalGet('node/add/page', array('query' => array('translation' => $node->id(), 'target' => 'es')));
     $this->assertRaw(t('A translation of %title in %language already exists', array('%title' => $node_title, '%language' => $languages['es']->name)), 'Message regarding attempted duplicate translation is displayed.');
 
     // Attempt a resubmission of the form - this emulates using the back button
@@ -109,7 +110,7 @@ function testContentTranslation() {
     $langcode = Language::LANGCODE_NOT_SPECIFIED;
     $edit["title"] = $this->randomName();
     $edit["body[$langcode][0][value]"] = $this->randomName();
-    $this->drupalPost('node/add/page', $edit, t('Save'), array('query' => array('translation' => $node->nid, 'language' => 'es')));
+    $this->drupalPost('node/add/page', $edit, t('Save'), array('query' => array('translation' => $node->id(), 'language' => 'es')));
     $duplicate = $this->drupalGetNodeByTitle($edit["title"]);
     $this->assertEqual($duplicate->tnid, 0, 'The node does not have a tnid.');
 
@@ -119,18 +120,18 @@ function testContentTranslation() {
     $edit = array();
     $edit["body[$langcode][0][value]"] = $node_body;
     $edit['translation[retranslate]'] = TRUE;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_title)), 'Original node updated.');
 
     // Check to make sure that interface shows translation as outdated.
-    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->drupalGet('node/' . $node->id() . '/translate');
     $this->assertRaw('<span class="marker">' . t('outdated') . '</span>', 'Translation marked as outdated.');
 
     // Update translation and mark as updated.
     $edit = array();
     $edit["body[$langcode][0][value]"] = $this->randomName();
     $edit['translation[status]'] = FALSE;
-    $this->drupalPost('node/' . $node_translation->nid . '/edit', $edit, t('Save'));
+    $this->drupalPost('node/' . $node_translation->id() . '/edit', $edit, t('Save'));
     $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_translation_title)), 'Translated node updated.');
 
     // Confirm that language neutral is an option for translators when there are
@@ -145,7 +146,7 @@ function testContentTranslation() {
     $this->drupalLogin($this->admin_user);
     $this->drupalPost('admin/config/regional/language/delete/es', array(), t('Delete'));
     $this->drupalLogin($this->translator);
-    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->drupalGet('node/' . $node->id() . '/translate');
     $this->assertRaw(t('Translations of %title', array('%title' => $node->label())), 'Translation overview page available with only one language enabled.');
   }
 
@@ -217,9 +218,12 @@ function testLanguageSwitcherBlockIntegration() {
     // Create a language neutral node and check that the language switcher is
     // left untouched.
     $node2 = $this->createPage($this->randomName(), $this->randomName(), Language::LANGCODE_NOT_SPECIFIED);
-    $node2_en = (object) array('nid' => $node2->nid, 'langcode' => 'en');
-    $node2_es = (object) array('nid' => $node2->nid, 'langcode' => 'es');
-    $node2_it = (object) array('nid' => $node2->nid, 'langcode' => 'it');
+    $node2_en = clone $node2;
+    $node2_en->langcode = 'en';
+    $node2_es = clone $node2;
+    $node2_es->langcode = 'es';
+    $node2_it = clone $node2;
+    $node2_it->langcode = 'it';
     $this->assertLanguageSwitchLinks($node2_en, $node2_en, TRUE, $type);
     $this->assertLanguageSwitchLinks($node2_en, $node2_es, TRUE, $type);
     $this->assertLanguageSwitchLinks($node2_en, $node2_it, TRUE, $type);
@@ -240,8 +244,10 @@ function testLanguageSwitcherBlockIntegration() {
     // Check that new nodes with a language assigned do not trigger language
     // switcher alterations when translation support is disabled.
     $node = $this->createPage($this->randomName(), $this->randomName());
-    $node_es = (object) array('nid' => $node->nid, 'langcode' => 'es');
-    $node_it = (object) array('nid' => $node->nid, 'langcode' => 'it');
+    $node_es = clone $node;
+    $node_es->langcode = 'es';
+    $node_it = clone $node;
+    $node_it->langcode = 'it';
     $this->assertLanguageSwitchLinks($node, $node, TRUE, $type);
     $this->assertLanguageSwitchLinks($node, $node_es, TRUE, $type);
     $this->assertLanguageSwitchLinks($node, $node_it, TRUE, $type);
@@ -255,8 +261,8 @@ function testTranslateOwnContentRole() {
     // that has "translate own content" role.
     $this->drupalLogin($this->limited_translator);
     $node = $this->createPage($this->randomName(), $this->randomName(), 'en');
-    $this->assertLinkByHref('node/' . $node->nid . '/translate', 0, 'User with "translate own content" role can see translate link');
-    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->assertLinkByHref('node/' . $node->id() . '/translate', 0, 'User with "translate own content" role can see translate link');
+    $this->drupalGet('node/' . $node->id() . '/translate');
     $this->assertResponse(200, 'User with "translate own content" role can get translate page');
     $translation_es = $this->createTranslation($node, $this->randomName(), $this->randomName(), 'es');
 
@@ -265,14 +271,14 @@ function testTranslateOwnContentRole() {
     $node = $this->createPage($this->randomName(), $this->randomName(), 'en');
     // Change to limited_translator and check that translate links aren't shown.
     $this->drupalLogin($this->limited_translator);
-    $this->assertNoLinkByHref('node/' . $node->nid . '/translate', 'User with "translate own content" role can\'t see translate link');
+    $this->assertNoLinkByHref('node/' . $node->id() . '/translate', 'User with "translate own content" role can\'t see translate link');
     // Check if user with "translate own content" role can see translate page
     // from other user's node.
-    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->drupalGet('node/' . $node->id() . '/translate');
     $this->assertResponse(403, 'User with "translate own content" role can\'t get translate page');
 
     // Try to change to translate with "brute force".
-    $this->drupalGet('node/add/page', array('query' => array('translation' => $node->nid, 'target' => 'es')));
+    $this->drupalGet('node/add/page', array('query' => array('translation' => $node->id(), 'target' => 'es')));
     $this->assertResponse(403, 'User with "translate own content" role can\'t get create translate page');
   }
 
@@ -294,7 +300,7 @@ function resetCaches() {
    *   An empty node data structure.
    */
   function emptyNode($langcode) {
-    return (object) array('nid' => NULL, 'langcode' => $langcode);
+    return entity_create('node', array('nid' => NULL, 'langcode' => $langcode, 'type' => 'page'));
   }
 
   /**
@@ -375,7 +381,7 @@ function createPage($title, $body, $langcode = NULL) {
    *   Translation object.
    */
   function createTranslation(EntityInterface $node, $title, $body, $langcode) {
-    $this->drupalGet('node/add/page', array('query' => array('translation' => $node->nid, 'target' => $langcode)));
+    $this->drupalGet('node/add/page', array('query' => array('translation' => $node->id(), 'target' => $langcode)));
 
     $field_langcode = Language::LANGCODE_NOT_SPECIFIED;
     $body_key = "body[$field_langcode][0][value]";
@@ -390,7 +396,7 @@ function createTranslation(EntityInterface $node, $title, $body, $langcode) {
     // Check to make sure that translation was successful.
     $translation = $this->drupalGetNodeByTitle($title);
     $this->assertTrue($translation, 'Node found in database.');
-    $this->assertTrue($translation->tnid == $node->nid, 'Translation set id correctly stored.');
+    $this->assertTrue($translation->tnid == $node->id(), 'Translation set id correctly stored.');
 
     return $translation;
   }
@@ -434,7 +440,7 @@ function assertContentByXPath($xpath, array $arguments = array(), $value = NULL,
    * @return
    *   TRUE if the language switch links are found, FALSE if not.
    */
-  function assertLanguageSwitchLinks($node, $translation, $find = TRUE, $types = NULL) {
+  function assertLanguageSwitchLinks(NodeInterface $node, $translation, $find = TRUE, $types = NULL) {
     if (empty($types)) {
       $types = array('node', 'block-language');
     }
@@ -448,7 +454,7 @@ function assertLanguageSwitchLinks($node, $translation, $find = TRUE, $types = N
     $translation_language = $languages[$translation->langcode];
     $url = url("node/$translation->nid", array('language' => $translation_language));
 
-    $this->drupalGet("node/$node->nid", array('language' => $page_language));
+    $this->drupalGet('node/' . $node->id(), array('language' => $page_language));
 
     foreach ($types as $type) {
       $args = array('%translation_language' => $translation_language->name, '%page_language' => $page_language->name, '%type' => $type);
@@ -462,7 +468,7 @@ function assertLanguageSwitchLinks($node, $translation, $find = TRUE, $types = N
       // node uses the article tag.
       $tag = $type == 'node' ? 'article' : 'div';
 
-      if (!empty($translation->nid)) {
+      if ($translation->nid) {
         $xpath = '//' . $tag . '[contains(@class, :type)]//a[@href=:url]';
       }
       else {
diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module
index 993cf13..7a87aa4 100644
--- a/core/modules/translation/translation.module
+++ b/core/modules/translation/translation.module
@@ -205,13 +205,13 @@ function translation_form_node_form_alter(&$form, &$form_state) {
       $form['translation_source'] = array('#type' => 'value', '#value' => $node->translation_source);
       $form['langcode']['#disabled'] = TRUE;
     }
-    elseif (!empty($node->nid) && !empty($node->tnid)) {
+    elseif (!$node->isNew() && !empty($node->tnid)) {
       // Disable languages for existing translations, so it is not possible
       // to switch this node to some language which is already in the
       // translation set. Also remove the language neutral option.
       unset($form['langcode']['#options'][Language::LANGCODE_NOT_SPECIFIED]);
       foreach (translation_node_get_translations($node->tnid) as $langcode => $translation) {
-        if ($translation->nid != $node->nid) {
+        if ($translation->nid != $node->id()) {
           unset($form['langcode']['#options'][$langcode]);
         }
       }
@@ -225,7 +225,7 @@ function translation_form_node_form_alter(&$form, &$form_state) {
         '#tree' => TRUE,
         '#weight' => 30,
       );
-      if ($node->tnid == $node->nid) {
+      if ($node->tnid == $node->id()) {
         // This is the source node of the translation.
         $form['translation']['retranslate'] = array(
           '#type' => 'checkbox',
@@ -267,7 +267,7 @@ function translation_node_view(EntityInterface $node, EntityDisplay $display, $v
     // configurable language type in core, we use it as default. Contributed
     // modules can change this behavior by setting the system variable below.
     $type = config('translation.settings')->get('language_type');
-    $custom_links = language_negotiation_get_switch_links($type, "node/$node->nid");
+    $custom_links = language_negotiation_get_switch_links($type, 'node/' . $node->id());
     $links = array();
 
     foreach ($translations as $langcode => $translation) {
@@ -315,7 +315,7 @@ function translation_node_prepare_form(NodeInterface $node, $form_display, $oper
   // Only act if we are dealing with a content type supporting translations.
   if (translation_supported_type($node->type) &&
     // And it's a new node.
-    empty($node->nid) &&
+    $node->isNew() &&
     // And the request variables are set properly.
     !empty($translation) &&
     !empty($target) &&
@@ -359,13 +359,13 @@ function translation_node_insert(EntityInterface $node) {
       }
       else {
         // Create new translation set, using nid from the source node.
-        $tnid = $node->translation_source->nid;
+        $tnid = $node->translation_source->id();
         db_update('node')
           ->fields(array(
             'tnid' => $tnid,
             'translate' => 0,
           ))
-          ->condition('nid', $node->translation_source->nid)
+          ->condition('nid', $node->translation_source->id())
           ->execute();
       }
       db_update('node')
@@ -373,7 +373,7 @@ function translation_node_insert(EntityInterface $node) {
           'tnid' => $tnid,
           'translate' => 0,
         ))
-        ->condition('nid', $node->nid)
+        ->condition('nid', $node->id())
         ->execute();
       // Save tnid to avoid loss in case of resave.
       $node->tnid = $tnid;
@@ -394,13 +394,13 @@ function translation_node_update(EntityInterface $node) {
           'tnid' => $node->tnid,
           'translate' => $node->translation['status'],
         ))
-        ->condition('nid', $node->nid)
+        ->condition('nid', $node->id())
         ->execute();
       if (!empty($node->translation['retranslate'])) {
         // This is the source node, asking to mark all translations outdated.
         db_update('node')
           ->fields(array('translate' => 1))
-          ->condition('nid', $node->nid, '<>')
+          ->condition('nid', $node->id(), '<>')
           ->condition('tnid', $node->tnid)
           ->execute();
       }
@@ -416,10 +416,10 @@ function translation_node_update(EntityInterface $node) {
 function translation_node_validate(EntityInterface $node, $form, &$form_state) {
   // Only act on translatable nodes with a tnid or translation_source.
   $form_node = $form_state['controller']->getEntity();
-  if (translation_supported_type($node->type) && (!empty($node->tnid) || !empty($form_node->translation_source->nid))) {
-    $tnid = !empty($node->tnid) ? $node->tnid : $form_node->translation_source->nid;
+  if (translation_supported_type($node->type) && (!empty($node->tnid) || ($form_node->translation_source && $form_node->translation_source->id()))) {
+    $tnid = !empty($node->tnid) ? $node->tnid : $form_node->translation_source->id();
     $translations = translation_node_get_translations($tnid);
-    if (isset($translations[$node->langcode]) && $translations[$node->langcode]->nid != $node->nid) {
+    if (isset($translations[$node->language()->id]) && $translations[$node->language()->id]->nid != $node->id()) {
       form_set_error('langcode', t('There is already a translation in this language.'));
     }
   }
@@ -456,12 +456,12 @@ function translation_remove_from_set($node) {
     }
     else {
       $query
-        ->condition('nid', $node->nid)
+        ->condition('nid', $node->id())
         ->execute();
 
       // If the node being removed was the source of the translation set,
       // we pick a new source - preferably one that is up to date.
-      if ($node->tnid == $node->nid) {
+      if ($node->tnid == $node->id()) {
         $new_tnid = db_query('SELECT nid FROM {node} WHERE tnid = :tnid ORDER BY translate ASC, nid ASC', array(':tnid' => $node->tnid))->fetchField();
         db_update('node')
           ->fields(array('tnid' => $new_tnid))
@@ -533,7 +533,7 @@ function translation_path_get_translations($path) {
   // Check for a node related path, and for its translations.
   if ((preg_match("!^node/(\d+)(/.+|)$!", $path, $matches)) && ($node = node_load((int) $matches[1])) && !empty($node->tnid)) {
     foreach (translation_node_get_translations($node->tnid) as $language => $translation_node) {
-      $paths[$language] = 'node/' . $translation_node->nid . $matches[2];
+      $paths[$language] = 'node/' . $translation_node->id() . $matches[2];
     }
   }
   return $paths;
@@ -566,7 +566,9 @@ function translation_language_switch_links_alter(array &$links, $type, $path) {
     foreach ($links as $langcode => $link) {
       if (isset($translations[$langcode]) && $translations[$langcode]->status) {
         // Translation in a different node.
-        $links[$langcode]['href'] = 'node/' . $translations[$langcode]->nid . $matches[2];
+        // @todo: Unify translation objects.
+        $nid = $translations[$langcode] instanceof NodeInterface ? $translations[$langcode]->id() : $translations[$langcode]->nid;
+        $links[$langcode]['href'] = 'node/' . $nid  . $matches[2];
       }
       else {
         // No translation in this language, or no permission to view.
diff --git a/core/modules/translation/translation.pages.inc b/core/modules/translation/translation.pages.inc
index 7f85d3b..66da1e4 100644
--- a/core/modules/translation/translation.pages.inc
+++ b/core/modules/translation/translation.pages.inc
@@ -43,11 +43,11 @@ function translation_node_overview(EntityInterface $node) {
       // Existing translation in the translation set: display status.
       // We load the full node to check whether the user can edit it.
       $translation_node = node_load($translations[$langcode]->nid);
-      $path = 'node/' . $translation_node->nid;
+      $path = 'node/' . $translation_node->id();
       $links = language_negotiation_get_switch_links($type, $path);
       $title = empty($links->links[$langcode]['href']) ? l($translation_node->label(), $path) : l($translation_node->label(), $links->links[$langcode]['href'], $links->links[$langcode]);
       if (node_access('update', $translation_node)) {
-        $path = 'node/' . $translation_node->nid . '/edit';
+        $path = 'node/' . $translation_node->id() . '/edit';
         $links = language_negotiation_get_switch_links($type, $path);
         if (!empty($links->links[$langcode]['href'])) {
           $options['edit'] = array(
@@ -57,7 +57,7 @@ function translation_node_overview(EntityInterface $node) {
       }
       $status = $translation_node->status ? t('Published') : t('Not published');
       $status .= $translation_node->translate ? ' - <span class="marker">' . t('outdated') . '</span>' : '';
-      if ($translation_node->nid == $tnid) {
+      if ($translation_node->id() == $tnid) {
         $language_name = t('<strong>@language_name</strong> (source)', array('@language_name' => $language_name));
       }
     }
@@ -67,7 +67,7 @@ function translation_node_overview(EntityInterface $node) {
       if (node_access('create', $node)) {
         $path = 'node/add/' . $node->type;
         $links = language_negotiation_get_switch_links($type, $path);
-        $query = array('query' => array('translation' => $node->nid, 'target' => $langcode));
+        $query = array('query' => array('translation' => $node->id(), 'target' => $langcode));
         if (!empty($links->links[$langcode]['href'])) {
           $options['add'] = array(
             'title' => t('Add translation'),
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
index c45a21f..9abdab2 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
@@ -56,7 +56,7 @@ function testUserCancelWithoutPermission() {
     $this->assertTrue($account->status == 1, 'User account was not canceled.');
 
     // Confirm user's content has not been altered.
-    $test_node = node_load($node->nid, TRUE);
+    $test_node = node_load($node->id(), TRUE);
     $this->assertTrue(($test_node->uid == $account->id() && $test_node->status == 1), 'Node of the user has not been altered.');
   }
 
@@ -137,7 +137,7 @@ function testUserCancelInvalid() {
     $this->assertTrue($account->status, 'User account was not canceled.');
 
     // Confirm user's content has not been altered.
-    $test_node = node_load($node->nid, TRUE);
+    $test_node = node_load($node->id(), TRUE);
     $this->assertTrue(($test_node->uid == $account->id() && $test_node->status == 1), 'Node of the user has not been altered.');
   }
 
@@ -211,7 +211,7 @@ function testUserBlockUnpublish() {
     $this->assertTrue($account->status == 0, 'User has been blocked.');
 
     // Confirm user's content has been unpublished.
-    $test_node = node_load($node->nid, TRUE);
+    $test_node = node_load($node->id(), TRUE);
     $this->assertTrue($test_node->status == 0, 'Node of the user has been unpublished.');
     $test_node = node_revision_load($node->vid);
     $this->assertTrue($test_node->status == 0, 'Node revision of the user has been unpublished.');
@@ -260,11 +260,11 @@ function testUserAnonymize() {
     $this->assertFalse(user_load($account->id(), TRUE), 'User is not found in the database.');
 
     // Confirm that user's content has been attributed to anonymous user.
-    $test_node = node_load($node->nid, TRUE);
+    $test_node = node_load($node->id(), TRUE);
     $this->assertTrue(($test_node->uid == 0 && $test_node->status == 1), 'Node of the user has been attributed to anonymous user.');
     $test_node = node_revision_load($revision, TRUE);
     $this->assertTrue(($test_node->revision_uid == 0 && $test_node->status == 1), 'Node revision of the user has been attributed to anonymous user.');
-    $test_node = node_load($revision_node->nid, TRUE);
+    $test_node = node_load($revision_node->id(), TRUE);
     $this->assertTrue(($test_node->uid != 0 && $test_node->status == 1), "Current revision of the user's node was not attributed to anonymous user.");
 
     // Confirm that the confirmation message made it through to the end user.
@@ -294,7 +294,7 @@ function testUserDelete() {
     $edit['subject'] = $this->randomName(8);
     $edit['comment_body[' . $langcode . '][0][value]'] = $this->randomName(16);
 
-    $this->drupalPost('comment/reply/' . $node->nid, $edit, t('Preview'));
+    $this->drupalPost('comment/reply/' . $node->id(), $edit, t('Preview'));
     $this->drupalPost(NULL, array(), t('Save'));
     $this->assertText(t('Your comment has been posted.'));
     $comments = entity_load_multiple_by_properties('comment', array('subject' => $edit['subject']));
@@ -326,9 +326,9 @@ function testUserDelete() {
     $this->assertFalse(user_load($account->id(), TRUE), 'User is not found in the database.');
 
     // Confirm that user's content has been deleted.
-    $this->assertFalse(node_load($node->nid, TRUE), 'Node of the user has been deleted.');
+    $this->assertFalse(node_load($node->id(), TRUE), 'Node of the user has been deleted.');
     $this->assertFalse(node_revision_load($revision), 'Node revision of the user has been deleted.');
-    $this->assertTrue(node_load($revision_node->nid, TRUE), "Current revision of the user's node was not deleted.");
+    $this->assertTrue(node_load($revision_node->id(), TRUE), "Current revision of the user's node was not deleted.");
     $this->assertFalse(comment_load($comment->id(), TRUE), 'Comment of the user has been deleted.');
 
     // Confirm that the confirmation message made it through to the end user.
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
index f4a0662..f3f3e6e 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
@@ -101,7 +101,7 @@ function testPictureOnNodeComment() {
     $this->container->get('config.factory')->get('system.theme.global')->set('features.node_user_picture', TRUE)->save();
 
     // Verify that the image is displayed on the user account page.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertRaw(file_uri_target($file->getFileUri()), 'User picture found on node page.');
 
     // Enable user pictures on comments, instead of nodes.
@@ -113,7 +113,7 @@ function testPictureOnNodeComment() {
     $edit = array(
       'comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]' => $this->randomString(),
     );
-    $this->drupalPost('comment/reply/' . $node->nid, $edit, t('Save'));
+    $this->drupalPost('comment/reply/' . $node->id(), $edit, t('Save'));
     $this->assertRaw(file_uri_target($file->getFileUri()), 'User picture found on comment.');
 
     // Disable user pictures on comments and nodes.
@@ -122,7 +122,7 @@ function testPictureOnNodeComment() {
       ->set('features.comment_user_picture', FALSE)
       ->save();
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertNoRaw(file_uri_target($file->getFileUri()), 'User picture not found on node and comment.');
   }
 
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php
index a83a8ca..c859226 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php
@@ -105,7 +105,7 @@ function testUserSignature() {
     $edit = array();
     $edit['subject'] = $this->randomName(8);
     $edit['comment_body[' . $langcode . '][0][value]'] = $this->randomName(16);
-    $this->drupalPost('comment/reply/' . $node->nid, $edit, t('Preview'));
+    $this->drupalPost('comment/reply/' . $node->id(), $edit, t('Preview'));
     $this->drupalPost(NULL, array(), t('Save'));
 
     // Get the comment ID. (This technique is the same one used in the Comment
@@ -120,7 +120,7 @@ function testUserSignature() {
     $this->drupalPost('comment/' . $comment_id . '/edit', $edit, t('Save'));
 
     // Assert that the signature did not make it through unfiltered.
-    $this->drupalGet('node/' . $node->nid);
+    $this->drupalGet('node/' . $node->id());
     $this->assertNoRaw($signature_text, 'Unfiltered signature text not found.');
     $this->assertRaw(check_markup($signature_text, $this->filtered_html_format->format), 'Filtered signature text found.');
   }
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
index c4ff9ff..c639373 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
@@ -49,11 +49,11 @@ function testUserTimeZone() {
     $node3 = $this->drupalCreateNode(array('created' => strtotime($date3), 'type' => 'article'));
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->drupalGet('node/' . $node1->id());
     $this->assertText('2007-03-09 21:00 PST', 'Date should be PST.');
-    $this->drupalGet("node/$node2->nid");
+    $this->drupalGet('node/' . $node2->id());
     $this->assertText('2007-03-11 01:00 PST', 'Date should be PST.');
-    $this->drupalGet("node/$node3->nid");
+    $this->drupalGet('node/' . $node3->id());
     $this->assertText('2007-03-20 21:00 PDT', 'Date should be PDT.');
 
     // Change user time zone to Santiago time.
@@ -64,11 +64,11 @@ function testUserTimeZone() {
     $this->assertText(t('The changes have been saved.'), 'Time zone changed to Santiago time.');
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->drupalGet('node/' . $node1->id());
     $this->assertText('2007-03-10 02:00 CLST', 'Date should be Chile summer time; five hours ahead of PST.');
-    $this->drupalGet("node/$node2->nid");
+    $this->drupalGet('node/' . $node2->id());
     $this->assertText('2007-03-11 05:00 CLT', 'Date should be Chile time; four hours ahead of PST');
-    $this->drupalGet("node/$node3->nid");
+    $this->drupalGet('node/' . $node3->id());
     $this->assertText('2007-03-21 00:00 CLT', 'Date should be Chile time; three hours ahead of PDT.');
   }
 }
diff --git a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
index 730b123..ccab316 100644
--- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
@@ -97,11 +97,11 @@ protected function setUp() {
 
       $node = $this->drupalCreateNode($values);
 
-      search_index($node->nid, 'node', $node->body[Language::LANGCODE_NOT_SPECIFIED][0]['value'], Language::LANGCODE_NOT_SPECIFIED);
+      search_index($node->id(), 'node', $node->body[Language::LANGCODE_NOT_SPECIFIED][0]['value'], Language::LANGCODE_NOT_SPECIFIED);
 
       $comment = array(
         'uid' => $user->id(),
-        'nid' => $node->nid,
+        'nid' => $node->id(),
         'node_type' => 'node_type_' . $node->bundle(),
       );
       entity_create('comment', $comment)->save();
diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php
index 036896f..c7ff7fc 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php
@@ -70,7 +70,7 @@ protected function _testOffset() {
     $view->filter['created']->value['value'] = '+1 hour';
     $view->executeDisplay('default');
     $expected_result = array(
-      array('nid' => $this->nodes[3]->nid),
+      array('nid' => $this->nodes[3]->id()),
     );
     $this->assertIdenticalResultset($view, $expected_result, $this->map);
     $view->destroy();
@@ -83,7 +83,7 @@ protected function _testOffset() {
     $view->filter['created']->value['min'] = '+1 hour';
     $view->executeDisplay('default');
     $expected_result = array(
-      array('nid' => $this->nodes[3]->nid),
+      array('nid' => $this->nodes[3]->id()),
     );
     $this->assertIdenticalResultset($view, $expected_result, $this->map);
   }
@@ -101,7 +101,7 @@ protected function _testBetween() {
     $view->filter['created']->value['max'] = format_date(250000, 'custom', 'Y-m-d H:s');
     $view->executeDisplay('default');
     $expected_result = array(
-      array('nid' => $this->nodes[1]->nid),
+      array('nid' => $this->nodes[1]->id()),
     );
     $this->assertIdenticalResultset($view, $expected_result, $this->map);
     $view->destroy();
@@ -112,8 +112,8 @@ protected function _testBetween() {
     $view->filter['created']->value['max'] = format_date(250000, 'custom', 'Y-m-d H:s');
     $view->executeDisplay('default');
     $expected_result = array(
-      array('nid' => $this->nodes[0]->nid),
-      array('nid' => $this->nodes[1]->nid),
+      array('nid' => $this->nodes[0]->id()),
+      array('nid' => $this->nodes[1]->id()),
     );
     $this->assertIdenticalResultset($view, $expected_result, $this->map);
     $view->destroy();
@@ -125,9 +125,9 @@ protected function _testBetween() {
     $view->filter['created']->value['max'] = format_date(250000, 'custom', 'Y-m-d H:s');
     $view->executeDisplay('default');
     $expected_result = array(
-      array('nid' => $this->nodes[0]->nid),
-      array('nid' => $this->nodes[2]->nid),
-      array('nid' => $this->nodes[3]->nid),
+      array('nid' => $this->nodes[0]->id()),
+      array('nid' => $this->nodes[2]->id()),
+      array('nid' => $this->nodes[3]->id()),
     );
     $this->assertIdenticalResultset($view, $expected_result, $this->map);
     $view->destroy();
@@ -138,9 +138,9 @@ protected function _testBetween() {
     $view->filter['created']->value['max'] = format_date(150000, 'custom', 'Y-m-d H:s');
     $view->executeDisplay('default');
     $expected_result = array(
-      array('nid' => $this->nodes[1]->nid),
-      array('nid' => $this->nodes[2]->nid),
-      array('nid' => $this->nodes[3]->nid),
+      array('nid' => $this->nodes[1]->id()),
+      array('nid' => $this->nodes[2]->id()),
+      array('nid' => $this->nodes[3]->id()),
     );
     $this->assertIdenticalResultset($view, $expected_result, $this->map);
   }
diff --git a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php
index 122337b..0a8f18e 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php
@@ -78,9 +78,9 @@ function testViewsWizardAndListing() {
     $this->assertRaw('<rss version="2.0"');
     // The feed should have the same title and nodes as the page.
     $this->assertText($view2['page[title]']);
-    $this->assertRaw(url('node/' . $node1->nid, array('absolute' => TRUE)));
+    $this->assertRaw(url('node/' . $node1->id(), array('absolute' => TRUE)));
     $this->assertText($node1->label());
-    $this->assertRaw(url('node/' . $node2->nid, array('absolute' => TRUE)));
+    $this->assertRaw(url('node/' . $node2->id(), array('absolute' => TRUE)));
     $this->assertText($node2->label());
 
     // Go back to the views page and check if this view is there.
diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
index 9928ddd..883cc50 100644
--- a/core/themes/seven/seven.theme
+++ b/core/themes/seven/seven.theme
@@ -170,7 +170,7 @@ function seven_form_node_form_alter(&$form, &$form_state) {
       '#type' => 'item',
       '#wrapper_attributes' => array('class' => array('published')),
       '#markup' => !empty($node->status) ? t('Published') : t('Not published'),
-      '#access' => !empty($node->nid),
+      '#access' => !$node->isNew(),
     ),
     'changed' => array(
       '#type' => 'item',
