diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_formatter_settings.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_formatter_settings.yml
index 8ab6df5..20d2364 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_formatter_settings.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_formatter_settings.yml
@@ -102,7 +102,7 @@ process:
           filefield:
             default: file_default
             url_plain: file_url_plain
-            path_plain: file_url_plan #unsure about this?
+            path_plain: file_url_plain
             image_plain: image
             image_nodelink: image
             image_imagelink: image
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
index 9e6a393..0edbb48 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
@@ -112,21 +112,26 @@ public function loadMultiple(EntityStorageInterface $storage, array $sub_ids = N
               ];
             }
             elseif ($data['type'] === 'text') {
-              $migration->process[$field_name . '/value'] = $field_name . '/value';
+              // The data is stored differently depending on whether we're using
+              // db storage.
+              $value_key = $data['db_storage'] ? $field_name : "$field_name/value";
+              $format_key = $data['db_storage'] ? $field_name . '_format' : "$field_name/format" ;
+
+              $migration->process["$field_name/value"] = $value_key;
               // See d6_user, signature_format for an example of the YAML that
               // represents this process array.
-              $migration->process[$field_name . '/format'] = [
+              $migration->process["$field_name/format"] = [
                 [
                   'plugin' => 'static_map',
                   'bypass' => TRUE,
-                  'source' => $field_name . '/format',
+                  'source' => $format_key,
                   'map' => [0 => NULL]
                 ],
                 ['plugin' => 'skip_process_on_empty'],
                 [
                   'plugin' => 'migration',
                   'migration' => 'd6_filter_format',
-                  'source' => $field_name . '/format',
+                  'source' => $format_key,
                   'no_stub' => 1,
                 ],
               ];
diff --git a/core/scripts/dump-database-d6.sh b/core/scripts/dump-database-d6.sh
index ace93d9..8e6628c 100644
--- a/core/scripts/dump-database-d6.sh
+++ b/core/scripts/dump-database-d6.sh
@@ -2,100 +2,168 @@
 <?php
 
 /**
- * Dump a Drupal 6 database into a Drupal 7 PHP script to test the upgrade
- * process.
+ * Dump a Drupal 6 database into a Drupal PHP files that can be used by the
+ * migration path.
  *
- * Run this script at the root of an existing Drupal 6 installation.
+ * Instructions:
  *
- * 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
- * session and watchdog tables are not recorded.
+ *  - Clone the repository from: https://www.drupal.org/sandbox/benjy/2405029
+ *  - Create a database called d6_migrate
+ *  - Import the database from core/migrate_drupal/src/Tests/d6.gz
+ *  - Add an entry into your D8 settings file, eg: $databases['d6_migrate']['default'] = array ( // Credentials );
+ *  - Login to the D6 site, make changes as required.
+ *  - Run drush scr cores/scripts/dump-database-d6.sh to re-export the tables.
+ *  - Dump the database back 'mysqldump -uroot d6 | gzip -c > core/modules/migrate_drupal/src/Tests/d6.gz'
  */
 
-// Define default settings.
-$cmd = 'index.php';
-$_SERVER['HTTP_HOST']       = 'default';
-$_SERVER['PHP_SELF']        = '/index.php';
-$_SERVER['REMOTE_ADDR']     = '127.0.0.1';
-$_SERVER['SERVER_SOFTWARE'] = NULL;
-$_SERVER['REQUEST_METHOD']  = 'GET';
-$_SERVER['QUERY_STRING']    = '';
-$_SERVER['PHP_SELF']        = $_SERVER['REQUEST_URI'] = '/';
-$_SERVER['HTTP_USER_AGENT'] = 'console';
+use Doctrine\Common\Inflector\Inflector;
+use Drupal\Core\Database\Database;
+use Drupal\Component\Utility\Variable;
 
-// Bootstrap Drupal.
-include_once './includes/bootstrap.inc';
-drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
-
-// Include the utility drupal_var_export() function.
-include_once __DIR__ . '/../includes/utility.inc';
-
-// Output the PHP header.
-$output = <<<ENDOFHEADER
-<?php
+$output_folder = DRUPAL_ROOT . '/core/modules/migrate_drupal/src/Tests/Table';
+$class_template = '<?php
 
 /**
  * @file
- * Filled installation of Drupal 6.17, for test purposes.
+ * Contains \Drupal\migrate_drupal\Tests\Dump\{{CLASS_NAME}}.
  *
- * 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
- * tool. It has the following modules installed:
+ * THIS IS A GENERATED FILE. DO NOT EDIT.
+ *
+ * @see cores/scripts/dump-database-d6.sh
+ * @see https://www.drupal.org/sandbox/benjy/2405029
+ */
 
-ENDOFHEADER;
+namespace Drupal\migrate_drupal\Tests\Table;
 
-foreach (\Drupal::moduleHandler()->getModuleList() as $module => $filename) {
-  $output .= " *  - $module\n";
-}
-$output .= " */\n\n";
+use Drupal\migrate_drupal\Tests\Dump\Drupal6DumpBase;
 
-// Get the current schema, order it by table name.
-$schema = drupal_get_schema();
-ksort($schema);
+/**
+ * Generated file to represent the {{TABLE}} table.
+ */
+class {{CLASS_NAME}} extends Drupal6DumpBase {
 
-// Export all the tables in the schema.
-foreach ($schema as $table => $data) {
-  // Remove descriptions to save time and code.
-  unset($data['description']);
-  foreach ($data['fields'] as &$field) {
-    unset($field['description']);
+  public function load() {
+    $this->createTable("{{TABLE}}", {{TABLE_DEFINITION}});
+    $this->database->insert("{{TABLE}}")->fields({{PHP_FIELDS}})
+    {{PHP_VALUES}}
+    ->execute();
   }
 
-  // Dump the table structure.
-  $output .= "db_create_table('" . $table . "', " . drupal_var_export($data) . ");\n";
+}';
 
-  // Don't output values for those tables.
-  if (substr($table, 0, 5) == 'cache' || $table == 'sessions' || $table == 'watchdog') {
-    $output .= "\n";
+
+// Generate a list of tables using the 'migrate' db connection.
+$connection = Database::getConnection('default', 'd6_migrate');
+$tables = $connection->query('SHOW TABLES')->fetchCol();
+
+foreach ($tables as $table) {
+  if (substr($table, 0, 5) === 'cache' || $table === 'watchdog' || $table === 'menu_router' || $table === 'sessions') {
     continue;
   }
 
-  // Prepare the export of values.
-  $result = db_query('SELECT * FROM {'. $table .'}');
-  $insert = '';
-  while ($record = db_fetch_array($result)) {
-    // 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']++;
+  // Generate the class name.
+  $class = Inflector::classify($table);
+
+  // Generate the field values.
+  $query = $connection->query(_db_get_query($table));
+  $values = '';
+  while(($row = $query->fetchAssoc()) !== FALSE) {
+    $values .= '->values(' . Variable::export($row, '    ') . ')';
+  }
+
+  // Generate the field names.
+  $query = $connection->query("SHOW COLUMNS FROM {$table}");
+  $definition = [];
+  while(($row = $query->fetchAssoc()) !== FALSE) {
+    $field_name = $row['Field'];
+
+    // Parse out the field type and meta information.
+    preg_match('@([a-z]+)(?:\((\d+)(?:,(\d+))?\))?\s*(unsigned)?@', $row['Type'], $matches);
+    $field_type  = _db_field_type_map($matches[1]);
+
+    // If it's auto-increment then make it a serial instead.
+    if ($row['Extra'] === 'auto_increment') {
+      $field_type = 'serial';
     }
-    $insert .= '->values('. drupal_var_export($record) .")\n";
-  }
 
-  // Dump the values if there are some.
-  if ($insert) {
-    $output .= "db_insert('". $table . "')->fields(". drupal_var_export(array_keys($data['fields'])) .")\n";
-    $output .= $insert;
-    $output .= "->execute();\n";
-  }
+    // Add primary key entries as needed.
+    if ($row['Key'] === 'PRI') {
+      $definition['primary key'][] = $field_name;
+    }
 
-  // Add the statement fixing the serial in the user table.
-  if ($table == 'users') {
-    $output .= "db_query('UPDATE {users} SET uid = uid - 1');\n";
-  }
+    // All fields have a type and not null.
+    $definition['fields'][$field_name] = [
+      'type' => $field_type,
+      'not null' => $row['Null'] === 'NO',
+    ];
 
-  $output .= "\n";
+    // If this is a numeric field, the meta will be precision and scale.
+    if (isset($matches[2]) && $field_type === 'numeric') {
+      $definition['fields'][$field_name]['precision'] = $matches[2];
+      $definition['fields'][$field_name]['scale'] = $matches[3];
+    }
+    elseif ($field_type === 'time' || $field_type === 'datetime') {
+      // We use varchar to replace the D6 datetime and time fields.
+      $definition['fields'][$field_name]['type'] = 'varchar';
+      $definition['fields'][$field_name]['length'] = '100';
+    }
+    else {
+      // Try use the provided length, if it doesn't exist default to 100. It's
+      // not great but good enough for our dumps at this point.
+      $definition['fields'][$field_name]['length'] = !is_null($matches[2]) ? $matches[2] : 100;
+    }
+
+    if (isset($row['Default'])) {
+      $definition['fields'][$field_name]['default'] = $row['Default'];
+    }
+
+    if (isset($matches[4])) {
+      $definition['fields'][$field_name]['unsigned'] = TRUE;
+    }
+
+  }
+  $fields = Variable::export(array_keys($definition['fields']), '    ');
+  $definition = Variable::export($definition, '    ');
+
+  // Do our substitutions.
+  $php = str_replace('{{TABLE}}', $table, $class_template);
+  $php = str_replace('{{CLASS_NAME}}', $class, $php);
+  $php = str_replace('{{PHP_VALUES}}', $values, $php);
+  $php = str_replace('{{PHP_FIELDS}}', $fields, $php);
+  $php = str_replace('{{TABLE_DEFINITION}}', $definition, $php);
+
+
+  // Save the file.
+  file_put_contents("$output_folder/$class.php", $php);
 }
 
-print $output;
+function _db_field_type_map($sql_type) {
+  $map = array(
+    'longtext' => 'text',
+    'tinytext' => 'text',
+    'mediumtext' => 'text',
+
+    'tinyint' => 'int',
+    'smallint' => 'int',
+    'mediumint' => 'int',
+    'bigint' => 'int',
+    'int' => 'int',
+
+    'double' => 'numeric',
+    'float' => 'numeric',
+    'decimal' => 'numeric',
+
+    'longblob' => 'blob',
+  );
+
+  return isset($map[$sql_type]) ? $map[$sql_type] : $sql_type;
+}
+
+function _db_get_query($table) {
+  $queries = array(
+    'users' => 'SELECT * FROM {users} WHERE uid NOT IN (0,1)',
+  );
+  return isset($queries[$table]) ? $queries[$table] : 'SELECT * FROM {' . $table .'}';
+}
+
+exit;
