diff --git a/scripts/dump-database-d6.sh b/scripts/dump-database-d6.sh
index 41146b0..0cce580 100644
--- a/scripts/dump-database-d6.sh
+++ b/scripts/dump-database-d6.sh
@@ -2,13 +2,13 @@
 <?php
 
 /**
- * Dump a Drupal 6 database into a Drupal 7 PHP script to test the upgrade
+ * Dump a Drupal 7 database into a Drupal 8 PHP script to test the upgrade
  * process.
  *
- * Run this script at the root of an existing Drupal 6 installation.
+ * Run this script at the root of an existing Drupal 7 installation.
  *
- * The output of this script is a PHP script that can be ran inside Drupal 7
- * and recreates the Drupal 6 database as dumped. Transient data from cache
+ * The output of this script is a PHP script that can be ran inside Drupal 8
+ * and recreates the Drupal 7 database as dumped. Transient data from cache
  * session and watchdog tables are not recorded.
  */
 
@@ -24,6 +24,7 @@ $_SERVER['PHP_SELF']        = $_SERVER['REQUEST_URI'] = '/';
 $_SERVER['HTTP_USER_AGENT'] = 'console';
 
 // Bootstrap Drupal.
+define('DRUPAL_ROOT', getcwd());
 include_once './includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
@@ -36,10 +37,10 @@ $output = <<<ENDOFHEADER
 
 /**
  * @file
- * Filled installation of Drupal 6.17, for test purposes.
+ * Filled installation of Drupal 7.4, for test purposes.
  *
- * This file was generated by the dump-database-d6.sh tool, from an
- * installation of Drupal 6, filled with data using the generate-d6-content.sh
+ * This file was generated by the dump-database-d7.sh tool, from an
+ * installation of Drupal 7, filled with data using the generate-d7-content.sh
  * tool. It has the following modules installed:
 
 ENDOFHEADER;
@@ -73,12 +74,12 @@ foreach ($schema as $table => $data) {
   // Prepare the export of values.
   $result = db_query('SELECT * FROM {'. $table .'}');
   $insert = '';
-  while ($record = db_fetch_array($result)) {
+  foreach ($result as $record) {
     // users.uid is a serial and inserting 0 into a serial can break MySQL.
     // So record uid + 1 instead of uid for every uid and once all records
     // are in place, fix them up.
     if ($table == 'users') {
-      $record['uid']++;
+      $record->uid++;
     }
     $insert .= '->values('. drupal_var_export($record) .")\n";
   }
diff --git a/scripts/generate-d6-content.sh b/scripts/generate-d6-content.sh
index 5079c23..fef2820 100644
--- a/scripts/generate-d6-content.sh
+++ b/scripts/generate-d6-content.sh
@@ -2,11 +2,11 @@
 <?php
 
 /**
- * Generate content for a Drupal 6 database to test the upgrade process.
+ * Generate content for a Drupal 7 database to test the upgrade process.
  *
- * Run this script at the root of an existing Drupal 6 installation.
+ * Run this script at the root of an existing Drupal 7 installation.
  * Steps to use this generation script:
- * - Install drupal 6.
+ * - Install drupal 7.
  * - Run this script from your Drupal ROOT directory.
  * - Use the dump-database-d6.sh to generate the D7 file
  *   modules/simpletest/tests/upgrade/database.filled.php
@@ -25,6 +25,7 @@ $_SERVER['HTTP_USER_AGENT'] = 'console';
 $modules_to_enable          = array('path', 'poll');
 
 // Bootstrap Drupal.
+define('DRUPAL_ROOT', getcwd());
 include_once './includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
@@ -43,16 +44,18 @@ drupal_cron_run();
 
 // Create six users
 for ($i = 0; $i < 6; $i++) {
+	/* Ugly hack to avoid a constraint violation on the users table PRIMARY key (uid). For some reason uid wants to start at 0 if we don't specify one, so we'll start with some huge number and count backwards so as to not collide with anything */
+	$uid = 999999999 - $i;
   $name = "test user $i";
   $pass = md5("test PassW0rd $i !(.)");
   $mail = "test$i@example.com";
   $now = mktime(0, 0, 0, 1, $i + 1, 2010);
-  db_query("INSERT INTO {users} (name, pass, mail, status, created, access) VALUES ('%s', '%s', '%s', %d, %d, %d)", $name, $pass, $mail, 1, $now, $now);
+  db_query("INSERT INTO {users} (uid, name, pass, mail, status, created, access) VALUES (:uid, :name, :pass, :mail, :status, :created, :access)", array(':uid' => $uid, ':name' => $name, ':pass' => $pass, ':mail' => $mail, ':status' => 1, ':created' => $now, ':access' => $now));
 }
 
 
 // Create vocabularies and terms
-
+include_once('./modules/taxonomy/taxonomy.module');
 $terms = array();
 
 // All possible combinations of these vocabulary properties.
@@ -63,34 +66,35 @@ $required  = array(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1);
 $voc_id = 0;
 $term_id = 0;
 for ($i = 0; $i < 24; $i++) {
-  $vocabulary = array();
+  $vocabulary = new stdClass();
   ++$voc_id;
-  $vocabulary['name'] = "vocabulary $voc_id (i=$i)";
-  $vocabulary['description'] = "description of ". $vocabulary['name'];
-  $vocabulary['nodes'] = $i > 11 ? array('page' => TRUE) : array();
-  $vocabulary['multiple'] = $multiple[$i % 12];
-  $vocabulary['required'] = $required[$i % 12];
-  $vocabulary['relations'] = 1;
-  $vocabulary['hierarchy'] = $hierarchy[$i % 12];
-  $vocabulary['weight'] = $i;
-  taxonomy_save_vocabulary($vocabulary);
+  $vocabulary->name = "vocabulary $voc_id (i=$i)";
+	$vocabulary->machine_name = "vocab_" . $i;
+  $vocabulary->description = "description of ". $vocabulary->name;
+  $vocabulary->nodes = $i > 11 ? array('page' => TRUE) : array();
+  $vocabulary->multiple = $multiple[$i % 12];
+  $vocabulary->required = $required[$i % 12];
+  $vocabulary->relations = 1;
+  $vocabulary->hierarchy = $hierarchy[$i % 12];
+  $vocabulary->weight = $i;
+  taxonomy_vocabulary_save($vocabulary);
   $parents = array();
   // Vocabularies without hierarcy get one term, single parent vocabularies get
   // one parent and one child term. Multiple parent vocabularies get three
   // terms: t0, t1, t2 where t0 is a parent of both t1 and t2.
-  for ($j = 0; $j < $vocabulary['hierarchy'] + 1; $j++) {
-    $term = array();
-    $term['vid'] = $vocabulary['vid'];
+  for ($j = 0; $j < $vocabulary->hierarchy + 1; $j++) {
+    $term = new stdClass();
+    $term->vid = $vocabulary->vid;
     // For multiple parent vocabularies, omit the t0-t1 relation, otherwise
     // every parent in the vocabulary is a parent.
-    $term['parent'] = $vocabulary['hierarchy'] == 2 && i == 1 ? array() : $parents;
+    $term->parent = $vocabulary->hierarchy == 2 && i == 1 ? array() : $parents;
     ++$term_id;
-    $term['name'] = "term $term_id of vocabulary $voc_id (j=$j)";
-    $term['description'] = 'description of ' . $term['name'];
-    $term['weight'] = $i * 3 + $j;
-    taxonomy_save_term($term);
-    $terms[] = $term['tid'];
-    $parents[] = $term['tid'];
+    $term->name = "term $term_id of vocabulary $voc_id (j=$j)";
+    $term->description = 'description of ' . $term->name;
+    $term->weight = $i * 3 + $j;
+    taxonomy_term_save($term);
+    $terms[] = $term->tid;
+    $parents[] = $term->tid;
   }
 }
 
@@ -107,7 +111,7 @@ for ($i = 0; $i < 24; $i++) {
   ++$node_id;
   ++$revision_id;
   $node->title = "node title $node_id rev $revision_id (i=$i)";
-  $type = node_get_types('type', $node->type);
+  $type = node_type_get_type($node->type);
   if ($type->has_body) {
     $node->body = str_repeat("node body ($node->type) - $i", 100);
     $node->teaser = node_teaser($node->body);
@@ -132,7 +136,8 @@ for ($i = 0; $i < 24; $i++) {
     $node->taxonomy = $node_terms;
   }
   node_save($node);
-  path_set_alias("node/$node->nid", "content/$node->created");
+	$node_path = array('source' => "node/$node->nid", 'alias' => "content/$node->created");
+  path_save($node_path);
   if ($node->revision) {
     $user = user_load($uid + 3);
     ++$revision_id;
@@ -153,7 +158,7 @@ for ($i = 0; $i < 12; $i++) {
   $node->type = 'poll';
   $node->sticky = 0;
   $node->title = "poll title $i";
-  $type = node_get_types('type', $node->type);
+  $type = node_type_get_type($node->type);
   if ($type->has_body) {
     $node->body = str_repeat("node body ($node->type) - $i", 100);
     $node->teaser = node_teaser($node->body);
@@ -172,8 +177,10 @@ for ($i = 0; $i < 12; $i++) {
     $node->choice[] = array('chtext' => "Choice $c for poll $i");
   }
   node_save($node);
-  path_set_alias("node/$node->nid", "content/poll/$i");
-  path_set_alias("node/$node->nid/results", "content/poll/$i/results");
+	$poll_path = array('source' => "node/$node->nid", 'alias' => "content/poll/$i");
+  path_save($poll_path);
+	$results_path = array('source' => "node/$node->nid/results", 'alias' => "content/poll/$i/results");
+  path_save($results_path);
 
   // Add some votes
   for ($v = 0; $v < ($i % 4) + 5; $v++) {
@@ -181,7 +188,7 @@ for ($i = 0; $i < 12; $i++) {
     $form_state = array();
     $form_state['values']['choice'] = $c;
     $form_state['values']['op'] = t('Vote');
-    drupal_execute('poll_view_voting', $form_state, $node);
+    drupal_form_submit('poll_view_voting', $form_state, $node);
   }
 }
 
@@ -193,7 +200,7 @@ $node->type = 'broken';
 $node->sticky = 0;
 $node->title = "node title 24";
 $node->body = str_repeat("node body ($node->type) - 37", 100);
-$node->teaser = node_teaser($node->body);
+$node->teaser = "node body ($node->type)";
 $node->filter = variable_get('filter_default_format', 1);
 $node->format = FILTER_FORMAT_DEFAULT;
 $node->status = 1;
@@ -203,4 +210,5 @@ $node->promote = 0;
 $node->created = 1263769200;
 $node->log = "added $i node";
 node_save($node);
-path_set_alias("node/$node->nid", "content/1263769200");
+$content_path = array('source' => "node/$node->nid", 'alias' => "content/1263769200");
+path_save($content_path);
