diff --git includes/install.inc includes/install.inc
index 9dccbbd..6e020c1 100644
--- includes/install.inc
+++ includes/install.inc
@@ -77,7 +77,7 @@ define('FILE_NOT_EXECUTABLE', 128);
 function drupal_load_updates() {
   foreach (drupal_get_installed_schema_version(NULL, FALSE, TRUE) as $module => $schema_version) {
     if ($schema_version > -1) {
-      module_load_install($module);
+      module_load_update($module);
     }
   }
 }
diff --git includes/module.inc includes/module.inc
index 31cc2e8..f277492 100644
--- includes/module.inc
+++ includes/module.inc
@@ -235,6 +235,16 @@ function module_load_install($module) {
 }
 
 /**
+ * Load a module's schema and update hooks.
+ */
+function module_load_update($module) {
+  // Make sure the installation API is available
+  include_once DRUPAL_ROOT . '/includes/install.inc';
+
+  module_load_include('install', $module);
+  module_load_include('inc', $module, 'update');
+}
+
+/**
  * Load a module include file.
  *
  * Examples:
diff --git modules/aggregator/aggregator.install modules/aggregator/aggregator.install
index 402774e..cc088ee 100644
--- modules/aggregator/aggregator.install
+++ modules/aggregator/aggregator.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the aggregator module.
+ * Install and uninstall functions for the aggregator module.
  */
 
 /**
@@ -270,30 +270,3 @@ function aggregator_schema() {
 
   return $schema;
 }
-
-/**
- * Add hash column to aggregator_feed table.
- */
-function aggregator_update_7000() {
-  db_add_field('aggregator_feed', 'hash', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''));
-}
-
-/**
- * Add aggregator teaser length to settings from old global default teaser length
- */
-function aggregator_update_7001() {
-  variable_set('aggregator_teaser_length', variable_get('teaser_length'));
-}
-
-/**
- * Add queued timestamp.
- */
-function aggregator_update_7002() {
-  db_add_field('aggregator_feed', 'queued', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'Time when this feed was queued for refresh, 0 if not queued.',
-  ));
-  db_add_index('aggregator_feed', 'queued', array('queued'));
-}
diff --git modules/aggregator/aggregator.update.inc modules/aggregator/aggregator.update.inc
new file mode 100644
index 0000000..d29346b
--- /dev/null
+++ modules/aggregator/aggregator.update.inc
@@ -0,0 +1,34 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the aggregator module.
+ */
+
+/**
+ * Add hash column to aggregator_feed table.
+ */
+function aggregator_update_7000() {
+  db_add_field('aggregator_feed', 'hash', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''));
+}
+
+/**
+ * Add aggregator teaser length to settings from old global default teaser length
+ */
+function aggregator_update_7001() {
+  variable_set('aggregator_teaser_length', variable_get('teaser_length'));
+}
+
+/**
+ * Add queued timestamp.
+ */
+function aggregator_update_7002() {
+  db_add_field('aggregator_feed', 'queued', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'Time when this feed was queued for refresh, 0 if not queued.',
+  ));
+  db_add_index('aggregator_feed', 'queued', array('queued'));
+}
diff --git modules/block/block.install modules/block/block.install
index 1d14962..e173cf7 100644
--- modules/block/block.install
+++ modules/block/block.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the block module.
+ * Install and uninstall functions for the block module.
  */
 
 /**
@@ -187,203 +187,3 @@ function block_install() {
     ->condition('name', 'block')
     ->execute();
 }
-
-/**
- * Set system.weight to a low value for block module.
- *
- * Block should go first so that other modules can alter its output
- * during hook_page_alter(). Almost everything on the page is a block,
- * so before block module runs, there will not be much to alter.
- */
-function block_update_7000() {
-  db_update('system')
-    ->fields(array('weight' => '-5'))
-    ->condition('name', 'block')
-    ->execute();
-}
-
-/**
- * Rename {blocks} table to {block}, {blocks_roles} to {block_role} and
- * {boxes} to {block_custom}.
- */
-function block_update_7002() {
-  db_rename_table('blocks', 'block');
-  db_rename_table('blocks_roles', 'block_role');
-  db_rename_table('boxes', 'block_custom');
-}
-
-/**
- * Change the weight column to normal int.
- */
-function block_update_7003() {
-  db_drop_index('block', 'list');
-  db_change_field('block', 'weight', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'Block weight within region.',
-  ), array(
-    'indexes' => array(
-      'list' => array('theme', 'status', 'region', 'weight', 'module'),
-    ),
-  ));
-}
-
-/**
- * Add new blocks to new regions, migrate custom variables to blocks.
- */
-function block_update_7004() {
-  // Collect a list of themes with blocks.
-  $themes_with_blocks = array();
-  $result = db_query("SELECT s.name FROM {system} s INNER JOIN {block} b ON s.name = b.theme WHERE s.type = 'theme' GROUP by s.name");
-
-  $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
-  foreach ($result as $theme) {
-    $themes_with_blocks[] = $theme->name;
-    // Add new system generated help block.
-    $insert->values(array(
-      'module' => 'system',
-      'delta' => 'help',
-      'theme' => $theme->name,
-      'status' => 1,
-      'weight' => 0,
-      'region' => 'help',
-      'pages' => '',
-      'cache' => 1,
-    ));
-    // Add new system generated main page content block.
-    $insert->values(array(
-      'module' => 'system',
-      'delta' => 'main',
-      'theme' => $theme->name,
-      'status' => 1,
-      'weight' => 0,
-      'region' => 'content',
-      'pages' => '',
-      'cache' => -1,
-    ));
-  }
-  $insert->execute();
-
-  // Migrate blocks from left/right regions to first/second regions.
-  db_update('block')
-    ->fields(array('region' => 'sidebar_first'))
-    ->condition('region', 'left')
-    ->execute();
-  db_update('block')
-    ->fields(array('region' => 'sidebar_second'))
-    ->condition('region', 'right')
-    ->execute();
-
-  // Migrate contact form information.
-  $default_format = variable_get('filter_default_format', 1);
-  if ($contact_help = variable_get('contact_form_information', '')) {
-    $bid = db_insert('block_custom')
-      ->fields(array(
-        'body' => $contact_help,
-        'info' => 'Contact page help',
-        'format' => $default_format,
-      ))
-      ->execute();
-
-    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache'));
-    foreach ($themes_with_blocks as $theme) {
-      // Add contact help block for themes, which had blocks.
-      $insert->values(array(
-        'module' => 'block',
-        'delta' => $bid,
-        'theme' => $theme,
-        'status' => 1,
-        'weight' => 5,
-        'region' => 'help',
-        'visibility' => 1,
-        'pages' => 'contact',
-        'cache' => -1,
-      ));
-    }
-    drupal_set_message('The contact form information setting was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the site-wide contact page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.');
-  }
-  $insert->execute();
-
-  // Migrate user help setting.
-  if ($user_help = variable_get('user_registration_help', '')) {
-    $bid = db_insert('block_custom')->fields(array('body' => $user_help, 'info' => 'User registration guidelines', 'format' => $default_format))->execute();
-
-    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache'));
-    foreach ($themes_with_blocks as $theme) {
-      // Add user registration help block for themes, which had blocks.
-      $insert->values(array(
-        'module' => 'block',
-        'delta' => $bid,
-        'theme' => $theme,
-        'status' => 1,
-        'weight' => 5,
-        'region' => 'help',
-        'visibility' => 1,
-        'pages' => 'user/register',
-        'cache' => -1,
-      ));
-    }
-    drupal_set_message('The user registration guidelines were migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the user registration page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.');
-    $insert->execute();
-  }
-
-  // Migrate site mission setting.
-  if ($mission = variable_get('site_mission')) {
-    $bid = db_insert('block_custom')->fields(array('body' => $mission, 'info' => 'Site mission', 'format' => $default_format))->execute();
-
-    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache'));
-    foreach ($themes_with_blocks as $theme) {
-      // Add mission block for themes, which had blocks.
-      $insert->values(array(
-        'module' => 'block',
-        'delta' => $bid,
-        'theme' => $theme,
-        'status' => 1,
-        'weight' => 0,
-        'region' => 'highlight',
-        'visibility' => 1,
-        'pages' => '<front>',
-        'cache' => -1,
-      ));
-    }
-    drupal_set_message('The site mission was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the front page in the highlighted content region. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a highlighted content region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.');
-    $insert->execute();
-    // Migrate mission to RSS site description.
-    variable_set('feed_description', $mission);
-  }
-
-  // Migrate site footer message to a custom block.
-  if ($footer_message = variable_get('site_footer', '')) {
-    $bid = db_insert('block_custom')->fields(array('body' => $footer_message, 'info' => 'Footer message', 'format' => $default_format))->execute();
-
-    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
-    foreach ($themes_with_blocks as $theme) {
-      // Add site footer block for themes, which had blocks.
-      // Set low weight, so the block comes early (it used to be
-      // before the other blocks).
-      $insert->values(array(
-        'module' => 'block',
-        'delta' => $bid,
-        'theme' => $theme,
-        'status' => 1,
-        'weight' => -10,
-        'region' => 'footer',
-        'pages' => '',
-        'cache' => -1,
-      ));
-    }
-    drupal_set_message('The footer message was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to appear in the footer. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a footer region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.');
-    $insert->execute();
-  }
-
-  // Remove the variables (even if they were saved empty on the admin interface),
-  // to avoid keeping clutter in the variables table.
-  variable_del('contact_form_information');
-  variable_del('user_registration_help');
-  variable_del('site_mission');
-  variable_del('site_footer');
-
-  // Rebuild theme data, so the new 'help' region is identified.
-  system_rebuild_theme_data();
-}
diff --git modules/block/block.update.inc modules/block/block.update.inc
new file mode 100644
index 0000000..fe0182e
--- /dev/null
+++ modules/block/block.update.inc
@@ -0,0 +1,207 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the block module.
+ */
+
+/**
+ * Set system.weight to a low value for block module.
+ *
+ * Block should go first so that other modules can alter its output
+ * during hook_page_alter(). Almost everything on the page is a block,
+ * so before block module runs, there will not be much to alter.
+ */
+function block_update_7000() {
+  db_update('system')
+    ->fields(array('weight' => '-5'))
+    ->condition('name', 'block')
+    ->execute();
+}
+
+/**
+ * Rename {blocks} table to {block}, {blocks_roles} to {block_role} and
+ * {boxes} to {block_custom}.
+ */
+function block_update_7002() {
+  db_rename_table('blocks', 'block');
+  db_rename_table('blocks_roles', 'block_role');
+  db_rename_table('boxes', 'block_custom');
+}
+
+/**
+ * Change the weight column to normal int.
+ */
+function block_update_7003() {
+  db_drop_index('block', 'list');
+  db_change_field('block', 'weight', 'weight', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'Block weight within region.',
+  ), array(
+    'indexes' => array(
+      'list' => array('theme', 'status', 'region', 'weight', 'module'),
+    ),
+  ));
+}
+
+/**
+ * Add new blocks to new regions, migrate custom variables to blocks.
+ */
+function block_update_7004() {
+  // Collect a list of themes with blocks.
+  $themes_with_blocks = array();
+  $result = db_query("SELECT s.name FROM {system} s INNER JOIN {block} b ON s.name = b.theme WHERE s.type = 'theme' GROUP by s.name");
+
+  $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
+  foreach ($result as $theme) {
+    $themes_with_blocks[] = $theme->name;
+    // Add new system generated help block.
+    $insert->values(array(
+      'module' => 'system',
+      'delta' => 'help',
+      'theme' => $theme->name,
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'help',
+      'pages' => '',
+      'cache' => 1,
+    ));
+    // Add new system generated main page content block.
+    $insert->values(array(
+      'module' => 'system',
+      'delta' => 'main',
+      'theme' => $theme->name,
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'content',
+      'pages' => '',
+      'cache' => -1,
+    ));
+  }
+  $insert->execute();
+
+  // Migrate blocks from left/right regions to first/second regions.
+  db_update('block')
+    ->fields(array('region' => 'sidebar_first'))
+    ->condition('region', 'left')
+    ->execute();
+  db_update('block')
+    ->fields(array('region' => 'sidebar_second'))
+    ->condition('region', 'right')
+    ->execute();
+
+  // Migrate contact form information.
+  $default_format = variable_get('filter_default_format', 1);
+  if ($contact_help = variable_get('contact_form_information', '')) {
+    $bid = db_insert('block_custom')
+      ->fields(array(
+        'body' => $contact_help,
+        'info' => 'Contact page help',
+        'format' => $default_format,
+      ))
+      ->execute();
+
+    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache'));
+    foreach ($themes_with_blocks as $theme) {
+      // Add contact help block for themes, which had blocks.
+      $insert->values(array(
+        'module' => 'block',
+        'delta' => $bid,
+        'theme' => $theme,
+        'status' => 1,
+        'weight' => 5,
+        'region' => 'help',
+        'visibility' => 1,
+        'pages' => 'contact',
+        'cache' => -1,
+      ));
+    }
+    drupal_set_message('The contact form information setting was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the site-wide contact page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.');
+  }
+  $insert->execute();
+
+  // Migrate user help setting.
+  if ($user_help = variable_get('user_registration_help', '')) {
+    $bid = db_insert('block_custom')->fields(array('body' => $user_help, 'info' => 'User registration guidelines', 'format' => $default_format))->execute();
+
+    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache'));
+    foreach ($themes_with_blocks as $theme) {
+      // Add user registration help block for themes, which had blocks.
+      $insert->values(array(
+        'module' => 'block',
+        'delta' => $bid,
+        'theme' => $theme,
+        'status' => 1,
+        'weight' => 5,
+        'region' => 'help',
+        'visibility' => 1,
+        'pages' => 'user/register',
+        'cache' => -1,
+      ));
+    }
+    drupal_set_message('The user registration guidelines were migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the user registration page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.');
+    $insert->execute();
+  }
+
+  // Migrate site mission setting.
+  if ($mission = variable_get('site_mission')) {
+    $bid = db_insert('block_custom')->fields(array('body' => $mission, 'info' => 'Site mission', 'format' => $default_format))->execute();
+
+    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache'));
+    foreach ($themes_with_blocks as $theme) {
+      // Add mission block for themes, which had blocks.
+      $insert->values(array(
+        'module' => 'block',
+        'delta' => $bid,
+        'theme' => $theme,
+        'status' => 1,
+        'weight' => 0,
+        'region' => 'highlight',
+        'visibility' => 1,
+        'pages' => '<front>',
+        'cache' => -1,
+      ));
+    }
+    drupal_set_message('The site mission was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the front page in the highlighted content region. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a highlighted content region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.');
+    $insert->execute();
+    // Migrate mission to RSS site description.
+    variable_set('feed_description', $mission);
+  }
+
+  // Migrate site footer message to a custom block.
+  if ($footer_message = variable_get('site_footer', '')) {
+    $bid = db_insert('block_custom')->fields(array('body' => $footer_message, 'info' => 'Footer message', 'format' => $default_format))->execute();
+
+    $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
+    foreach ($themes_with_blocks as $theme) {
+      // Add site footer block for themes, which had blocks.
+      // Set low weight, so the block comes early (it used to be
+      // before the other blocks).
+      $insert->values(array(
+        'module' => 'block',
+        'delta' => $bid,
+        'theme' => $theme,
+        'status' => 1,
+        'weight' => -10,
+        'region' => 'footer',
+        'pages' => '',
+        'cache' => -1,
+      ));
+    }
+    drupal_set_message('The footer message was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to appear in the footer. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a footer region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.');
+    $insert->execute();
+  }
+
+  // Remove the variables (even if they were saved empty on the admin interface),
+  // to avoid keeping clutter in the variables table.
+  variable_del('contact_form_information');
+  variable_del('user_registration_help');
+  variable_del('site_mission');
+  variable_del('site_footer');
+
+  // Rebuild theme data, so the new 'help' region is identified.
+  system_rebuild_theme_data();
+}
diff --git modules/book/book.install modules/book/book.install
index 4195442..a756b19 100644
--- modules/book/book.install
+++ modules/book/book.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the book module.
+ * Install and uninstall functions for the book module.
  */
 
 /**
diff --git modules/color/color.install modules/color/color.install
index 37614f8..a79e022 100644
--- modules/color/color.install
+++ modules/color/color.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the color module.
+ * Install and uninstall functions for the color module.
  */
 
 function color_requirements($phase) {
diff --git modules/comment/comment.install modules/comment/comment.install
index f5939a1..234521c 100644
--- modules/comment/comment.install
+++ modules/comment/comment.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the comment module.
+ * Install and uninstall functions for the comment module.
  */
 
 /**
@@ -76,281 +76,6 @@ function comment_enable() {
 }
 
 /**
- * Implements hook_update_dependencies().
- */
-function comment_update_dependencies() {
-  // Comment update 7005 creates comment Field API bundles and therefore must
-  // run after the Field module has been enabled, but before upgrading field
-  // data.
-  $dependencies['comment'][7005] = array(
-    'system' => 7049,
-  );
-  $dependencies['system'][7050] = array(
-    'comment' => 7005,
-  );
-
-  // Comment update 7012 creates the comment body field and therefore must run
-  // after all entities have been updated.
-  $dependencies['comment'][7012] = array(
-    'system' => 7021,
-  );
-
-  return $dependencies;
-}
-
-/**
- * @defgroup updates-6.x-to-7.x Comment updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Remove comment settings for page ordering.
- */
-function comment_update_7000() {
-  $types = node_type_get_types();
-  foreach ($types as $type => $object) {
-    variable_del('comment_default_order' . $type);
-  }
-  return t('Comment order settings removed.');
-}
-
-/**
- * Change comment status from published being 0 to being 1
- */
-function comment_update_7001() {
-  $changes = array(
-    3 => 0,
-    0 => 1,
-    1 => 3,
-  );
-
-  foreach ($changes as $old => $new) {
-  db_update('comments')
-    ->fields(array('status' => $new))
-    ->condition('status', $old)
-    ->execute();
-  }
-}
-
-/**
- * Rename {comments} table to {comment}.
- */
-function comment_update_7002() {
-  db_rename_table('comments', 'comment');
-}
-
-/**
- * Rename comment display setting variables.
- */
-function comment_update_7004() {
-  $types = node_type_get_types();
-  foreach ($types as $type => $object) {
-    $setting = variable_get('comment_default_mode_' . $type, 4);
-    if ($setting == 3 || $setting == 4) {
-      variable_set('comment_default_mode_' . $type, 1);
-    }
-    else {
-      variable_set('comment_default_mode_' . $type, 0);
-    }
-  }
-}
-
-/**
- * Create comment Field API bundles.
- */
-function comment_update_7005() {
-  foreach (node_type_get_types() as $info) {
-    field_attach_create_bundle('comment', 'comment_node_' . $info->type);
-  }
-}
-
-/**
- * Create user related indexes.
- */
-function comment_update_7006() {
-  db_add_index('comment', 'comment_uid', array('uid'));
-  db_add_index('node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
-}
-
-/**
- * Split {comment}.timestamp into 'created' and 'changed', improve indexing on {comment}.
- */
-function comment_update_7007() {
-  // Drop the old indexes.
-  db_drop_index('comment', 'status');
-  db_drop_index('comment', 'pid');
-
-  // Create a created column.
-  db_add_field('comment', 'created', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-  ));
-
-  // Rename the timestamp column to changed.
-  db_change_field('comment', 'timestamp', 'changed', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-  ));
-
-  // Migrate the data.
-  // @todo db_update() should support this.
-  db_query('UPDATE {comment} SET created = changed');
-
-  // Recreate the indexes.
-  // The 'comment_num_new' index is optimized for comment_num_new()
-  // and comment_new_page_count().
-  db_add_index('comment', 'comment_num_new', array('nid', 'status', 'created', 'cid', 'thread'));
-  db_add_index('comment', 'comment_pid_status', array('pid', 'status'));
-}
-
-/**
- * Add language column to the {comment} table.
- */
-function comment_update_7008() {
-  // Create a language column.
-  db_add_field('comment', 'language', array(
-    'type' => 'varchar',
-    'length' => 12,
-    'not null' => TRUE,
-    'default' => '',
-  ));
-
-  // Create the index.
-  db_add_index('comment', 'comment_nid_language', array('nid', 'language'));
-}
-
-/**
- * Update preview setting variable to use new constants
- */
-function comment_update_7009() {
-  foreach (node_type_get_types() as $type => $object) {
-    // There were only two comment modes in the past:
-    // - 1 was 'required' previously, convert into DRUPAL_REQUIRED (2).
-    // - 0 was 'optional' previously, convert into DRUPAL_OPTIONAL (1).
-    $original_preview = variable_get('comment_preview_' . $type, 1);
-    if ($original_preview) {
-      $preview = DRUPAL_REQUIRED;
-    }
-    else {
-      $preview = DRUPAL_OPTIONAL;
-    }
-    variable_set('comment_preview_' . $type, $preview);
-  }
-  return array();
-}
-
-/**
- * Add {node_comment_statistics}.cid column.
- */
-function comment_update_7010() {
-  db_add_field('node_comment_statistics', 'cid', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'The {comment}.cid of the last comment.',
-  ));
-  db_add_index('node_comment_statistics', 'cid', array('cid'));
-}
-
-/**
- * Add an index to node_comment_statistics on comment_count.
- */
-function comment_update_7011() {
-  db_add_index('node_comment_statistics', 'comment_count', array('comment_count'));
-}
-
-/**
- * Create the comment_body field.
- */
-function comment_update_7012() {
-  // Create comment body field.
-  $field = array(
-    'field_name' => 'comment_body',
-    'type' => 'text_long',
-    'entity_types' => array('comment'),
-  );
-  field_create_field($field);
-
-  // Add the field to comments for all existing bundles.
-  $body_instance = array(
-    'field_name' => 'comment_body',
-    'label' => 'Comment',
-    'entity_type' => 'comment',
-    'settings' => array('text_processing' => 1),
-    // Hide field label by default.
-    'display' => array(
-      'full' => array(
-        'label' => 'hidden',
-      ),
-    ),
-  );
-  foreach (node_type_get_types() as $info) {
-    $body_instance['bundle'] = 'comment_node_' . $info->type;
-    field_create_instance($body_instance);
-  }
-}
-
-/**
- * Migrate data from the comment field to field storage.
- */
-function comment_update_7013(&$sandbox) {
-  // This is a multipass update. First set up some comment variables.
-  if (empty($sandbox['total'])) {
-    $comments = (bool) db_query_range('SELECT 1 FROM {comment}', 0, 1)->fetchField();
-    $sandbox['types'] = array();
-    if ($comments) {
-      $sandbox['etid'] = _field_sql_storage_etid('comment');
-      $sandbox['types'] = node_type_get_types();
-    }
-    $sandbox['total'] = count($sandbox['types']);
-  }
-
-  if (!empty($sandbox['types'])) {
-    $type = array_shift($sandbox['types']);
-
-    $query = db_select('comment', 'c');
-    $query->innerJoin('node', 'n', 'c.nid = n.nid AND n.type = :type', array(':type' => $type->type));
-    $query->addField('c', 'cid', 'entity_id');
-    $query->addExpression("'comment_node_$type->type'", 'bundle');
-    $query->addExpression($sandbox['etid'], 'etid');
-    $query->addExpression('0', 'deleted');
-    $query->addExpression("'" . LANGUAGE_NONE . "'", 'language');
-    $query->addExpression('0', 'delta');
-    $query->addField('c', 'comment', 'comment_body_value');
-    $query->addField('c', 'format', 'comment_body_format');
-
-    $comment_body = field_info_field('comment_body');
-    $comment_body_table = _field_sql_storage_tablename($comment_body);
-
-    db_insert($comment_body_table)
-      ->from($query)
-      ->execute();
-    // Update the comment body format in a similar manner as is done for other
-    // modules in filter_update_7005(), but we do this one here since we are
-    // already migrating the data.
-    db_update($comment_body_table)
-      ->fields(array('comment_body_format' => variable_get('filter_default_format', 1)))
-      ->condition('comment_body_format', 0)
-      ->execute();
-
-    $sandbox['#finished'] = 1 - count($sandbox['types']) / $sandbox['total'];
-  }
-
-  // On the last pass of the update, $sandbox['types'] will be empty.
-  if (empty($sandbox['types'])) {
-    db_drop_field('comment', 'comment');
-    db_drop_field('comment', 'format');
-  }
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
-
-/**
  * Implements hook_schema().
  */
 function comment_schema() {
diff --git modules/comment/comment.update.inc modules/comment/comment.update.inc
new file mode 100644
index 0000000..5b57efd
--- /dev/null
+++ modules/comment/comment.update.inc
@@ -0,0 +1,281 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the comment module.
+ */
+/**
+ * Implements hook_update_dependencies().
+ */
+function comment_update_dependencies() {
+  // Comment update 7005 creates comment Field API bundles and therefore must
+  // run after the Field module has been enabled, but before upgrading field
+  // data.
+  $dependencies['comment'][7005] = array(
+    'system' => 7049,
+  );
+  $dependencies['system'][7050] = array(
+    'comment' => 7005,
+  );
+
+  // Comment update 7012 creates the comment body field and therefore must run
+  // after all entities have been updated.
+  $dependencies['comment'][7012] = array(
+    'system' => 7021,
+  );
+
+  return $dependencies;
+}
+
+/**
+ * @defgroup updates-6.x-to-7.x Comment updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Remove comment settings for page ordering.
+ */
+function comment_update_7000() {
+  $types = node_type_get_types();
+  foreach ($types as $type => $object) {
+    variable_del('comment_default_order' . $type);
+  }
+  return t('Comment order settings removed.');
+}
+
+/**
+ * Change comment status from published being 0 to being 1
+ */
+function comment_update_7001() {
+  $changes = array(
+    3 => 0,
+    0 => 1,
+    1 => 3,
+  );
+
+  foreach ($changes as $old => $new) {
+  db_update('comments')
+    ->fields(array('status' => $new))
+    ->condition('status', $old)
+    ->execute();
+  }
+}
+
+/**
+ * Rename {comments} table to {comment}.
+ */
+function comment_update_7002() {
+  db_rename_table('comments', 'comment');
+}
+
+/**
+ * Rename comment display setting variables.
+ */
+function comment_update_7004() {
+  $types = node_type_get_types();
+  foreach ($types as $type => $object) {
+    $setting = variable_get('comment_default_mode_' . $type, 4);
+    if ($setting == 3 || $setting == 4) {
+      variable_set('comment_default_mode_' . $type, 1);
+    }
+    else {
+      variable_set('comment_default_mode_' . $type, 0);
+    }
+  }
+}
+
+/**
+ * Create comment Field API bundles.
+ */
+function comment_update_7005() {
+  foreach (node_type_get_types() as $info) {
+    field_attach_create_bundle('comment', 'comment_node_' . $info->type);
+  }
+}
+
+/**
+ * Create user related indexes.
+ */
+function comment_update_7006() {
+  db_add_index('comment', 'comment_uid', array('uid'));
+  db_add_index('node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
+}
+
+/**
+ * Split {comment}.timestamp into 'created' and 'changed', improve indexing on {comment}.
+ */
+function comment_update_7007() {
+  // Drop the old indexes.
+  db_drop_index('comment', 'status');
+  db_drop_index('comment', 'pid');
+
+  // Create a created column.
+  db_add_field('comment', 'created', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+
+  // Rename the timestamp column to changed.
+  db_change_field('comment', 'timestamp', 'changed', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+
+  // Migrate the data.
+  // @todo db_update() should support this.
+  db_query('UPDATE {comment} SET created = changed');
+
+  // Recreate the indexes.
+  // The 'comment_num_new' index is optimized for comment_num_new()
+  // and comment_new_page_count().
+  db_add_index('comment', 'comment_num_new', array('nid', 'status', 'created', 'cid', 'thread'));
+  db_add_index('comment', 'comment_pid_status', array('pid', 'status'));
+}
+
+/**
+ * Add language column to the {comment} table.
+ */
+function comment_update_7008() {
+  // Create a language column.
+  db_add_field('comment', 'language', array(
+    'type' => 'varchar',
+    'length' => 12,
+    'not null' => TRUE,
+    'default' => '',
+  ));
+
+  // Create the index.
+  db_add_index('comment', 'comment_nid_language', array('nid', 'language'));
+}
+
+/**
+ * Update preview setting variable to use new constants
+ */
+function comment_update_7009() {
+  foreach (node_type_get_types() as $type => $object) {
+    // There were only two comment modes in the past:
+    // - 1 was 'required' previously, convert into DRUPAL_REQUIRED (2).
+    // - 0 was 'optional' previously, convert into DRUPAL_OPTIONAL (1).
+    $original_preview = variable_get('comment_preview_' . $type, 1);
+    if ($original_preview) {
+      $preview = DRUPAL_REQUIRED;
+    }
+    else {
+      $preview = DRUPAL_OPTIONAL;
+    }
+    variable_set('comment_preview_' . $type, $preview);
+  }
+  return array();
+}
+
+/**
+ * Add {node_comment_statistics}.cid column.
+ */
+function comment_update_7010() {
+  db_add_field('node_comment_statistics', 'cid', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'The {comment}.cid of the last comment.',
+  ));
+  db_add_index('node_comment_statistics', 'cid', array('cid'));
+}
+
+/**
+ * Add an index to node_comment_statistics on comment_count.
+ */
+function comment_update_7011() {
+  db_add_index('node_comment_statistics', 'comment_count', array('comment_count'));
+}
+
+/**
+ * Create the comment_body field.
+ */
+function comment_update_7012() {
+  // Create comment body field.
+  $field = array(
+    'field_name' => 'comment_body',
+    'type' => 'text_long',
+    'entity_types' => array('comment'),
+  );
+  field_create_field($field);
+
+  // Add the field to comments for all existing bundles.
+  $body_instance = array(
+    'field_name' => 'comment_body',
+    'label' => 'Comment',
+    'entity_type' => 'comment',
+    'settings' => array('text_processing' => 1),
+    // Hide field label by default.
+    'display' => array(
+      'full' => array(
+        'label' => 'hidden',
+      ),
+    ),
+  );
+  foreach (node_type_get_types() as $info) {
+    $body_instance['bundle'] = 'comment_node_' . $info->type;
+    field_create_instance($body_instance);
+  }
+}
+
+/**
+ * Migrate data from the comment field to field storage.
+ */
+function comment_update_7013(&$sandbox) {
+  // This is a multipass update. First set up some comment variables.
+  if (empty($sandbox['total'])) {
+    $comments = (bool) db_query_range('SELECT 1 FROM {comment}', 0, 1)->fetchField();
+    $sandbox['types'] = array();
+    if ($comments) {
+      $sandbox['etid'] = _field_sql_storage_etid('comment');
+      $sandbox['types'] = node_type_get_types();
+    }
+    $sandbox['total'] = count($sandbox['types']);
+  }
+
+  if (!empty($sandbox['types'])) {
+    $type = array_shift($sandbox['types']);
+
+    $query = db_select('comment', 'c');
+    $query->innerJoin('node', 'n', 'c.nid = n.nid AND n.type = :type', array(':type' => $type->type));
+    $query->addField('c', 'cid', 'entity_id');
+    $query->addExpression("'comment_node_$type->type'", 'bundle');
+    $query->addExpression($sandbox['etid'], 'etid');
+    $query->addExpression('0', 'deleted');
+    $query->addExpression("'" . LANGUAGE_NONE . "'", 'language');
+    $query->addExpression('0', 'delta');
+    $query->addField('c', 'comment', 'comment_body_value');
+    $query->addField('c', 'format', 'comment_body_format');
+
+    $comment_body = field_info_field('comment_body');
+    $comment_body_table = _field_sql_storage_tablename($comment_body);
+
+    db_insert($comment_body_table)
+      ->from($query)
+      ->execute();
+    // Update the comment body format in a similar manner as is done for other
+    // modules in filter_update_7005(), but we do this one here since we are
+    // already migrating the data.
+    db_update($comment_body_table)
+      ->fields(array('comment_body_format' => variable_get('filter_default_format', 1)))
+      ->condition('comment_body_format', 0)
+      ->execute();
+
+    $sandbox['#finished'] = 1 - count($sandbox['types']) / $sandbox['total'];
+  }
+
+  // On the last pass of the update, $sandbox['types'] will be empty.
+  if (empty($sandbox['types'])) {
+    db_drop_field('comment', 'comment');
+    db_drop_field('comment', 'format');
+  }
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/contact/contact.install modules/contact/contact.install
index 62fbfb1..63ae23e 100644
--- modules/contact/contact.install
+++ modules/contact/contact.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the contact module.
+ * Install and uninstall functions for the contact module.
  */
 
 /**
@@ -88,67 +88,3 @@ function contact_uninstall() {
   variable_del('contact_threshold_limit');
   variable_del('contact_threshold_window');
 }
-
-/**
- * Implements hook_update_dependencies().
- */
-function contact_update_dependencies() {
-  // Contact update 7002 calls the new user_role_grant_permissions() and
-  // therefore needs to run after user_update_7006();
-  $dependencies['contact'][7002] = array(
-    'user' => 7006,
-  );
-  return $dependencies;
-}
-
-/**
- * @defgroup updates-6.x-to-7.x Contact updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Rename the threshold limit variable.
- */
-function contact_update_7000() {
-  variable_set('contact_threshold_limit', variable_get('contact_hourly_threshold', 5));
-  variable_del('contact_hourly_threshold');
-}
-
-/**
- * Rename the administer contact forms permission.
- */
-function contact_update_7001() {
-  db_update('role_permission')
-    ->fields(array('permission' => 'administer contact forms'))
-    ->condition('permission', 'administer site-wide contact form')
-    ->execute();
-}
-
-/**
- * Enable the 'access user contact forms' for registered users by default.
- */
-function contact_update_7002() {
-  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access user contact forms'));
-}
-
-/**
- * Change the weight column to normal int.
- */
-function contact_update_7003() {
-  db_drop_index('contact', 'list');
-  db_change_field('contact', 'weight', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => "The category's weight.",
-  ), array(
-    'indexes' => array(
-      'list' => array('weight', 'category'),
-    ),
-  ));
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
diff --git modules/contact/contact.update.inc modules/contact/contact.update.inc
new file mode 100644
index 0000000..eb5272d
--- /dev/null
+++ modules/contact/contact.update.inc
@@ -0,0 +1,71 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the contact module.
+ */
+
+/**
+ * Implements hook_update_dependencies().
+ */
+function contact_update_dependencies() {
+  // Contact update 7002 calls the new user_role_grant_permissions() and
+  // therefore needs to run after user_update_7006();
+  $dependencies['contact'][7002] = array(
+    'user' => 7006,
+  );
+  return $dependencies;
+}
+
+/**
+ * @defgroup updates-6.x-to-7.x Contact updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Rename the threshold limit variable.
+ */
+function contact_update_7000() {
+  variable_set('contact_threshold_limit', variable_get('contact_hourly_threshold', 5));
+  variable_del('contact_hourly_threshold');
+}
+
+/**
+ * Rename the administer contact forms permission.
+ */
+function contact_update_7001() {
+  db_update('role_permission')
+    ->fields(array('permission' => 'administer contact forms'))
+    ->condition('permission', 'administer site-wide contact form')
+    ->execute();
+}
+
+/**
+ * Enable the 'access user contact forms' for registered users by default.
+ */
+function contact_update_7002() {
+  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access user contact forms'));
+}
+
+/**
+ * Change the weight column to normal int.
+ */
+function contact_update_7003() {
+  db_drop_index('contact', 'list');
+  db_change_field('contact', 'weight', 'weight', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => "The category's weight.",
+  ), array(
+    'indexes' => array(
+      'list' => array('weight', 'category'),
+    ),
+  ));
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/dblog/dblog.install modules/dblog/dblog.install
index 112d441..cf9d879 100644
--- modules/dblog/dblog.install
+++ modules/dblog/dblog.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the dblog module.
+ * Install and uninstall functions for the dblog module.
  */
 
 /**
@@ -91,34 +91,3 @@ function dblog_schema() {
 
   return $schema;
 }
-
-/**
- * @defgroup updates-6.x-to-7.x database logging updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Allow NULL values for links.
- */
-function dblog_update_7001() {
-  db_change_field('watchdog', 'link', 'link', array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''));
-}
-
-/**
- * Add index on uid.
- */
-function dblog_update_7002() {
-  db_add_index('watchdog', 'uid', array('uid'));
-}
-
-/**
- * Allow longer type values.
- */
-function dblog_update_7003() {
-  db_change_field('watchdog', 'type', 'type', array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''));
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
diff --git modules/dblog/dblog.update.inc modules/dblog/dblog.update.inc
new file mode 100644
index 0000000..88de643
--- /dev/null
+++ modules/dblog/dblog.update.inc
@@ -0,0 +1,38 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the dblog module.
+ */
+
+/**
+ * @defgroup updates-6.x-to-7.x database logging updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Allow NULL values for links.
+ */
+function dblog_update_7001() {
+  db_change_field('watchdog', 'link', 'link', array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''));
+}
+
+/**
+ * Add index on uid.
+ */
+function dblog_update_7002() {
+  db_add_index('watchdog', 'uid', array('uid'));
+}
+
+/**
+ * Allow longer type values.
+ */
+function dblog_update_7003() {
+  db_change_field('watchdog', 'type', 'type', array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''));
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/field/field.install modules/field/field.install
index 3ed731e..2fbf587 100644
--- modules/field/field.install
+++ modules/field/field.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the field module.
+ * Install and uninstall functions for the field module.
  */
 
 /**
diff --git modules/field/modules/field_sql_storage/field_sql_storage.install modules/field/modules/field_sql_storage/field_sql_storage.install
index 783c293..e7e77be 100644
--- modules/field/modules/field_sql_storage/field_sql_storage.install
+++ modules/field/modules/field_sql_storage/field_sql_storage.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the field_sql_storage module.
+ * Install and uninstall functions for the field_sql_storage module.
  */
 
 /**
diff --git modules/file/file.install modules/file/file.install
index 7347d19..1c93c26 100644
--- modules/file/file.install
+++ modules/file/file.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for File module.
+ * Install and uninstall functions for File module.
  */
 
 /**
diff --git modules/filter/filter.install modules/filter/filter.install
index c4cf99f..87cab53 100644
--- modules/filter/filter.install
+++ modules/filter/filter.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the filter module.
+ * Install and uninstall functions for the filter module.
  */
 
 /**
@@ -138,290 +138,3 @@ function filter_install() {
   // Set the fallback format to plain text.
   variable_set('filter_fallback_format', $plain_text_format->format);
 }
-
-/**
- * Implements hook_update_dependencies().
- */
-function filter_update_dependencies() {
-  // Filter update 7005 migrates block data and therefore needs to run after
-  // the {block_custom} table is properly set up.
-  $dependencies['filter'][7005] = array(
-    'taxonomy' => 7002,
-  );
-
-  return $dependencies;
-}
-
-/**
- * @defgroup updates-6.x-to-7.x Filter updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Increase the size of {filters}.weight and add {filter_formats}.weight.
- */
-function filter_update_7000() {
-  // The list index will be recreated by filter_update_7003().
-  db_drop_index('filters', 'list');
-
-  // Change the weight column of the filter table to normal (ie. non tiny) int.
-  db_change_field('filters', 'weight', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'Weight of filter within format.',
-  ));
-
-  // Add a new filter_format.weight column.
-  db_add_field('filter_formats', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'Weight of text format to use when listing.',
-  ), array(
-    'indexes' => array(
-      'weight' => array('weight'),
-    ),
-  ));
-}
-
-/**
- * Break out "escape HTML filter" option to its own filter.
- */
-function filter_update_7001() {
-  $result = db_query("SELECT format FROM {filter_formats}")->fetchCol();
-  $insert = db_insert('filters')->fields(array('format', 'module', 'delta', 'weight'));
-
-  foreach ($result as $format_id) {
-    // Deprecated constants FILTER_HTML_STRIP = 1 and FILTER_HTML_ESCAPE = 2.
-    if (variable_get('filter_html_' . $format_id, 1) == 2) {
-      $insert->values(array(
-        'format' => $format_id,
-        'filter' => 'filter',
-        'delta' => 4,
-        'weight' => 0,
-      ));
-    }
-    variable_del('filter_html_' . $format_id);
-  }
-
-  $insert->execute();
-}
-
-/**
- * Rename {filters} table to {filter} and {filter_formats} table to {filter_format}.
- */
-function filter_update_7002() {
-  db_rename_table('filters', 'filter');
-  db_rename_table('filter_formats', 'filter_format');
-}
-
-/**
- * Remove hardcoded numeric deltas from all filters in core.
- */
-function filter_update_7003() {
-  // Duplicates the filter table since core cannot take care of the potential
-  // contributed module filters.
-  db_rename_table('filter', 'd6_upgrade_filter');
-  // Creates the Drupal 7 filter table.
-  $schema = filter_schema();
-  db_create_table('filter', $schema['filter']);
-
-  // Get an array of the renamed filter deltas, organized by module.
-  $renamed_deltas = array(
-    'filter' => array(
-      '0' => 'filter_html',
-      '1' => 'filter_autop',
-      '2' => 'filter_url',
-      '3' => 'filter_htmlcorrector',
-      '4' => 'filter_html_escape',
-    ),
-    'php' => array(
-      '0' => 'php_code',
-    ),
-  );
-
-  // Loop through each filter and make changes to the core filter table by
-  // each record from the old to the new table.
-  foreach ($renamed_deltas as $module => $deltas) {
-    foreach ($deltas as $old_delta => $new_name) {
-      $query = db_select('d6_upgrade_filter');
-      $query->fields('d6_upgrade_filter', array('format', 'weight'));
-      $query->condition('module', $module);
-      $query->condition('delta', $old_delta);
-      $result = $query->execute();
-      foreach ($result as $record) {
-        db_insert('filter')
-          ->fields(array(
-            'format' => $record->format,
-            'module' => $module,
-            'name' => $new_name,
-            'weight' => $record->weight,
-          ))
-          ->execute();
-      }
-      db_delete('d6_upgrade_filter')
-        ->condition('module', $module)
-        ->condition('delta', $old_delta)
-        ->execute();
-    }
-  }
-}
-
-/**
- * Move filter settings storage into {filter} table.
- */
-function filter_update_7004() {
-  // Enable all existing filters ({filter} contained only enabled previously).
-  db_update('filter')
-    ->fields(array('status' => '1'))
-    ->execute();
-
-  // Move filter settings from system variables into {filter}.settings.
-  $filters = db_query("SELECT * FROM {filter} WHERE module = :name", array(':name' => 'filter'));
-  foreach ($filters as $filter) {
-    $settings = array();
-    if ($filter->name == 'filter_html') {
-      if ($setting = variable_get("allowed_html_{$filter->format}", NULL)) {
-        $settings['allowed_html'] = $setting;
-        variable_del("allowed_html_{$filter->format}");
-      }
-      if ($setting = variable_get("filter_html_help_{$filter->format}", NULL)) {
-        $settings['filter_html_help'] = $setting;
-        variable_del("filter_html_help_{$filter->format}");
-      }
-      if ($setting = variable_get("filter_html_nofollow_{$filter->format}", NULL)) {
-        $settings['filter_html_nofollow'] = $setting;
-        variable_del("filter_html_nofollow_{$filter->format}");
-      }
-    }
-    elseif ($filter->name == 'filter_url') {
-      if ($setting = variable_get("filter_url_length_{$filter->format}", NULL)) {
-        $settings['filter_url_length'] = $setting;
-        variable_del("filter_url_length_{$filter->format}");
-      }
-    }
-    if (!empty($settings)) {
-      db_update('filter')
-        ->fields(array('settings' => serialize($settings)))
-        ->condition('format', $filter->format)
-        ->condition('name', $filter->name)
-        ->execute();
-    }
-  }
-}
-
-/**
- * Integrate text formats with the user permissions system.
- *
- * This function converts text format role assignments to use the new text
- * format permissions introduced in Drupal 7, creates a fallback (plain text)
- * format that is available to all users, and explicitly sets the text format
- * in cases that used to rely on a single site-wide default.
- */
-function filter_update_7005() {
-
-  // Move role data from the filter system to the user permission system.
-  $all_roles = array_keys(user_roles());
-  $default_format = variable_get('filter_default_format', 1);
-  $result = db_query("SELECT * FROM {filter_format}");
-  foreach ($result as $format) {
-    // We need to assign the default format to all roles (regardless of what
-    // was stored in the database) to preserve the behavior of the site at the
-    // moment of the upgrade.
-    $format_roles = ($format->format == $default_format ? $all_roles : explode(',', $format->roles));
-    foreach ($format_roles as $format_role) {
-      if (in_array($format_role, $all_roles)) {
-        user_role_grant_permissions($format_role, array(filter_permission_name($format)));
-      }
-    }
-  }
-
-  // Drop the roles field from the {filter_format} table.
-  db_drop_field('filter_format', 'roles');
-
-  // Add a fallback text format which outputs plain text and appears last on
-  // the list for all users. Generate a unique name for it, starting with
-  // "Plain text".
-  $start_name = 'Plain text';
-  $format_name = $start_name;
-  while ($format = db_query('SELECT format FROM {filter_format} WHERE name = :name', array(':name' => $format_name))->fetchField()) {
-    $id = empty($id) ? 2 : $id + 1;
-    $format_name = $start_name . ' ' . $id;
-  }
-  $fallback_format = new stdClass();
-  $fallback_format->name = $format_name;
-  $fallback_format->weight = 1;
-  // This format should output plain text, so we escape all HTML and apply the
-  // line break and URL filters only.
-  $fallback_format->filters = array(
-    'filter_html_escape' => array(
-      'weight' => 0,
-      'status' => 1,
-    ),
-    'filter_url' => array(
-      'weight' => 1,
-      'status' => 1,
-    ),
-    'filter_autop' => array(
-      'weight' => 2,
-      'status' => 1,
-    ),
-  );
-  filter_format_save($fallback_format);
-  variable_set('filter_fallback_format', $fallback_format->format);
-  drupal_set_message('A new <em>Plain text</em> format has been created which will be available to all users. You can configure this text format on the <a href="' . url('admin/config/content/formats/' . $fallback_format->format) . '">text format configuration page</a>.');
-
-  // Move the former site-wide default text format to the top of the list, so
-  // that it continues to be the default text format for all users.
-  db_update('filter_format')
-    ->fields(array('weight' => -1))
-    ->condition('format', $default_format)
-    ->execute();
-
-  // It was previously possible for a value of "0" to be stored in database
-  // tables to indicate that a particular piece of text should be filtered
-  // using the default text format. Therefore, we have to convert all such
-  // instances (in Drupal core) to explicitly use the appropriate format.
-  // Note that the update of the node body field is handled separately, in
-  // node_update_7006(), as is the update of the comment body field, in
-  // comment_update_7013().
-  foreach (array('block_custom') as $table) {
-    if (db_table_exists($table)) {
-      db_update($table)
-        ->fields(array('format' => $default_format))
-        ->condition('format', 0)
-        ->execute();
-    }
-  }
-
-  // We do not delete the 'filter_default_format' variable, since other modules
-  // may need it in their update functions.
-  // @todo This variable can be deleted in Drupal 8.
-}
-
-/**
- * Grant usage of all text formats to user roles having the 'administer filters' permission.
- */
-function filter_update_7008() {
-  // Build the list of permissions to grant.
-  $permissions = array();
-  foreach (filter_formats() as $format_id => $format) {
-    if ($permission = filter_permission_name($format)) {
-      $permissions[] = $permission;
-    }
-  }
-  // Grant text format permissions to all roles that can 'administer filters'.
-  // Albeit anonymous users *should not* have the permission, we cannot presume
-  // that they do not or must not.
-  if ($roles = user_roles(FALSE, 'administer filters')) {
-    foreach ($roles as $rid => $name) {
-      user_role_grant_permissions($rid, $permissions);
-    }
-  }
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
diff --git modules/filter/filter.update.inc modules/filter/filter.update.inc
new file mode 100644
index 0000000..9090c9f
--- /dev/null
+++ modules/filter/filter.update.inc
@@ -0,0 +1,294 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the filter module.
+ */
+
+/**
+ * Implements hook_update_dependencies().
+ */
+function filter_update_dependencies() {
+  // Filter update 7005 migrates block data and therefore needs to run after
+  // the {block_custom} table is properly set up.
+  $dependencies['filter'][7005] = array(
+    'taxonomy' => 7002,
+  );
+
+  return $dependencies;
+}
+
+/**
+ * @defgroup updates-6.x-to-7.x Filter updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Increase the size of {filters}.weight and add {filter_formats}.weight.
+ */
+function filter_update_7000() {
+  // The list index will be recreated by filter_update_7003().
+  db_drop_index('filters', 'list');
+
+  // Change the weight column of the filter table to normal (ie. non tiny) int.
+  db_change_field('filters', 'weight', 'weight', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'Weight of filter within format.',
+  ));
+
+  // Add a new filter_format.weight column.
+  db_add_field('filter_formats', 'weight', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'Weight of text format to use when listing.',
+  ), array(
+    'indexes' => array(
+      'weight' => array('weight'),
+    ),
+  ));
+}
+
+/**
+ * Break out "escape HTML filter" option to its own filter.
+ */
+function filter_update_7001() {
+  $result = db_query("SELECT format FROM {filter_formats}")->fetchCol();
+  $insert = db_insert('filters')->fields(array('format', 'module', 'delta', 'weight'));
+
+  foreach ($result as $format_id) {
+    // Deprecated constants FILTER_HTML_STRIP = 1 and FILTER_HTML_ESCAPE = 2.
+    if (variable_get('filter_html_' . $format_id, 1) == 2) {
+      $insert->values(array(
+        'format' => $format_id,
+        'filter' => 'filter',
+        'delta' => 4,
+        'weight' => 0,
+      ));
+    }
+    variable_del('filter_html_' . $format_id);
+  }
+
+  $insert->execute();
+}
+
+/**
+ * Rename {filters} table to {filter} and {filter_formats} table to {filter_format}.
+ */
+function filter_update_7002() {
+  db_rename_table('filters', 'filter');
+  db_rename_table('filter_formats', 'filter_format');
+}
+
+/**
+ * Remove hardcoded numeric deltas from all filters in core.
+ */
+function filter_update_7003() {
+  // Duplicates the filter table since core cannot take care of the potential
+  // contributed module filters.
+  db_rename_table('filter', 'd6_upgrade_filter');
+  // Creates the Drupal 7 filter table.
+  $schema = filter_schema();
+  db_create_table('filter', $schema['filter']);
+
+  // Get an array of the renamed filter deltas, organized by module.
+  $renamed_deltas = array(
+    'filter' => array(
+      '0' => 'filter_html',
+      '1' => 'filter_autop',
+      '2' => 'filter_url',
+      '3' => 'filter_htmlcorrector',
+      '4' => 'filter_html_escape',
+    ),
+    'php' => array(
+      '0' => 'php_code',
+    ),
+  );
+
+  // Loop through each filter and make changes to the core filter table by
+  // each record from the old to the new table.
+  foreach ($renamed_deltas as $module => $deltas) {
+    foreach ($deltas as $old_delta => $new_name) {
+      $query = db_select('d6_upgrade_filter');
+      $query->fields('d6_upgrade_filter', array('format', 'weight'));
+      $query->condition('module', $module);
+      $query->condition('delta', $old_delta);
+      $result = $query->execute();
+      foreach ($result as $record) {
+        db_insert('filter')
+          ->fields(array(
+            'format' => $record->format,
+            'module' => $module,
+            'name' => $new_name,
+            'weight' => $record->weight,
+          ))
+          ->execute();
+      }
+      db_delete('d6_upgrade_filter')
+        ->condition('module', $module)
+        ->condition('delta', $old_delta)
+        ->execute();
+    }
+  }
+}
+
+/**
+ * Move filter settings storage into {filter} table.
+ */
+function filter_update_7004() {
+  // Enable all existing filters ({filter} contained only enabled previously).
+  db_update('filter')
+    ->fields(array('status' => '1'))
+    ->execute();
+
+  // Move filter settings from system variables into {filter}.settings.
+  $filters = db_query("SELECT * FROM {filter} WHERE module = :name", array(':name' => 'filter'));
+  foreach ($filters as $filter) {
+    $settings = array();
+    if ($filter->name == 'filter_html') {
+      if ($setting = variable_get("allowed_html_{$filter->format}", NULL)) {
+        $settings['allowed_html'] = $setting;
+        variable_del("allowed_html_{$filter->format}");
+      }
+      if ($setting = variable_get("filter_html_help_{$filter->format}", NULL)) {
+        $settings['filter_html_help'] = $setting;
+        variable_del("filter_html_help_{$filter->format}");
+      }
+      if ($setting = variable_get("filter_html_nofollow_{$filter->format}", NULL)) {
+        $settings['filter_html_nofollow'] = $setting;
+        variable_del("filter_html_nofollow_{$filter->format}");
+      }
+    }
+    elseif ($filter->name == 'filter_url') {
+      if ($setting = variable_get("filter_url_length_{$filter->format}", NULL)) {
+        $settings['filter_url_length'] = $setting;
+        variable_del("filter_url_length_{$filter->format}");
+      }
+    }
+    if (!empty($settings)) {
+      db_update('filter')
+        ->fields(array('settings' => serialize($settings)))
+        ->condition('format', $filter->format)
+        ->condition('name', $filter->name)
+        ->execute();
+    }
+  }
+}
+
+/**
+ * Integrate text formats with the user permissions system.
+ *
+ * This function converts text format role assignments to use the new text
+ * format permissions introduced in Drupal 7, creates a fallback (plain text)
+ * format that is available to all users, and explicitly sets the text format
+ * in cases that used to rely on a single site-wide default.
+ */
+function filter_update_7005() {
+
+  // Move role data from the filter system to the user permission system.
+  $all_roles = array_keys(user_roles());
+  $default_format = variable_get('filter_default_format', 1);
+  $result = db_query("SELECT * FROM {filter_format}");
+  foreach ($result as $format) {
+    // We need to assign the default format to all roles (regardless of what
+    // was stored in the database) to preserve the behavior of the site at the
+    // moment of the upgrade.
+    $format_roles = ($format->format == $default_format ? $all_roles : explode(',', $format->roles));
+    foreach ($format_roles as $format_role) {
+      if (in_array($format_role, $all_roles)) {
+        user_role_grant_permissions($format_role, array(filter_permission_name($format)));
+      }
+    }
+  }
+
+  // Drop the roles field from the {filter_format} table.
+  db_drop_field('filter_format', 'roles');
+
+  // Add a fallback text format which outputs plain text and appears last on
+  // the list for all users. Generate a unique name for it, starting with
+  // "Plain text".
+  $start_name = 'Plain text';
+  $format_name = $start_name;
+  while ($format = db_query('SELECT format FROM {filter_format} WHERE name = :name', array(':name' => $format_name))->fetchField()) {
+    $id = empty($id) ? 2 : $id + 1;
+    $format_name = $start_name . ' ' . $id;
+  }
+  $fallback_format = new stdClass();
+  $fallback_format->name = $format_name;
+  $fallback_format->weight = 1;
+  // This format should output plain text, so we escape all HTML and apply the
+  // line break and URL filters only.
+  $fallback_format->filters = array(
+    'filter_html_escape' => array(
+      'weight' => 0,
+      'status' => 1,
+    ),
+    'filter_url' => array(
+      'weight' => 1,
+      'status' => 1,
+    ),
+    'filter_autop' => array(
+      'weight' => 2,
+      'status' => 1,
+    ),
+  );
+  filter_format_save($fallback_format);
+  variable_set('filter_fallback_format', $fallback_format->format);
+  drupal_set_message('A new <em>Plain text</em> format has been created which will be available to all users. You can configure this text format on the <a href="' . url('admin/config/content/formats/' . $fallback_format->format) . '">text format configuration page</a>.');
+
+  // Move the former site-wide default text format to the top of the list, so
+  // that it continues to be the default text format for all users.
+  db_update('filter_format')
+    ->fields(array('weight' => -1))
+    ->condition('format', $default_format)
+    ->execute();
+
+  // It was previously possible for a value of "0" to be stored in database
+  // tables to indicate that a particular piece of text should be filtered
+  // using the default text format. Therefore, we have to convert all such
+  // instances (in Drupal core) to explicitly use the appropriate format.
+  // Note that the update of the node body field is handled separately, in
+  // node_update_7006(), as is the update of the comment body field, in
+  // comment_update_7013().
+  foreach (array('block_custom') as $table) {
+    if (db_table_exists($table)) {
+      db_update($table)
+        ->fields(array('format' => $default_format))
+        ->condition('format', 0)
+        ->execute();
+    }
+  }
+
+  // We do not delete the 'filter_default_format' variable, since other modules
+  // may need it in their update functions.
+  // @todo This variable can be deleted in Drupal 8.
+}
+
+/**
+ * Grant usage of all text formats to user roles having the 'administer filters' permission.
+ */
+function filter_update_7008() {
+  // Build the list of permissions to grant.
+  $permissions = array();
+  foreach (filter_formats() as $format_id => $format) {
+    if ($permission = filter_permission_name($format)) {
+      $permissions[] = $permission;
+    }
+  }
+  // Grant text format permissions to all roles that can 'administer filters'.
+  // Albeit anonymous users *should not* have the permission, we cannot presume
+  // that they do not or must not.
+  if ($roles = user_roles(FALSE, 'administer filters')) {
+    foreach ($roles as $rid => $name) {
+      user_role_grant_permissions($rid, $permissions);
+    }
+  }
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/forum/forum.install modules/forum/forum.install
index 49aa336..2c7fa38 100644
--- modules/forum/forum.install
+++ modules/forum/forum.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the forum module.
+ * Install and uninstall functions for the forum module.
  */
 
 /**
@@ -202,80 +202,3 @@ function forum_schema() {
 
   return $schema;
 }
-
-/**
- * Add new index to forum table.
- */
-function forum_update_7000() {
-  db_drop_index('forum', 'nid');
-  db_add_index('forum', 'forum_topic', array('nid', 'tid'));
-}
-
-/**
- * Create new {forum_index} table.
- */
-function forum_update_7001() {
-  $forum_index = array(
-    'description' => 'Maintains denormalized information about node/term relationships.',
-    'fields' => array(
-      'nid' => array(
-        'description' => 'The {node}.nid this record tracks.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'title' => array(
-        'description' => 'The title of this node, always treated as non-markup plain text.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'tid' => array(
-         'description' => 'The term ID.',
-         'type' => 'int',
-         'unsigned' => TRUE,
-         'not null' => TRUE,
-         'default' => 0,
-      ),
-      'sticky' => array(
-        'description' => 'Boolean indicating whether the node is sticky.',
-        'type' => 'int',
-        'not null' => FALSE,
-        'default' => 0,
-        'size' => 'tiny',
-      ),
-      'created' => array(
-        'description' => 'The Unix timestamp when the node was created.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default'=> 0,
-      ),
-      'last_comment_timestamp' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.timestamp.',
-      ),
-      'comment_count' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The total number of comments on this node.',
-      ),
-    ),
-    'indexes' => array(
-      'forum_topics' => array('tid', 'sticky', 'last_comment_timestamp'),
-    ),
-    'foreign keys' => array(
-      'node' => 'nid',
-      'taxonomy_term_data' => 'tid',
-    ),
-  );
-  db_create_table('forum_index', $forum_index);
-
-  db_query('INSERT INTO {forum_index} (SELECT n.nid, n.title, f.tid, n.sticky, n.created, ncs.last_comment_timestamp, ncs.comment_count FROM {node} n INNER JOIN {forum} f on n.vid = f.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid)');
-}
diff --git modules/forum/forum.update.inc modules/forum/forum.update.inc
new file mode 100644
index 0000000..ca24cd4
--- /dev/null
+++ modules/forum/forum.update.inc
@@ -0,0 +1,84 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the forum module.
+ */
+
+/**
+ * Add new index to forum table.
+ */
+function forum_update_7000() {
+  db_drop_index('forum', 'nid');
+  db_add_index('forum', 'forum_topic', array('nid', 'tid'));
+}
+
+/**
+ * Create new {forum_index} table.
+ */
+function forum_update_7001() {
+  $forum_index = array(
+    'description' => 'Maintains denormalized information about node/term relationships.',
+    'fields' => array(
+      'nid' => array(
+        'description' => 'The {node}.nid this record tracks.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'title' => array(
+        'description' => 'The title of this node, always treated as non-markup plain text.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'tid' => array(
+         'description' => 'The term ID.',
+         'type' => 'int',
+         'unsigned' => TRUE,
+         'not null' => TRUE,
+         'default' => 0,
+      ),
+      'sticky' => array(
+        'description' => 'Boolean indicating whether the node is sticky.',
+        'type' => 'int',
+        'not null' => FALSE,
+        'default' => 0,
+        'size' => 'tiny',
+      ),
+      'created' => array(
+        'description' => 'The Unix timestamp when the node was created.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default'=> 0,
+      ),
+      'last_comment_timestamp' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.timestamp.',
+      ),
+      'comment_count' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The total number of comments on this node.',
+      ),
+    ),
+    'indexes' => array(
+      'forum_topics' => array('tid', 'sticky', 'last_comment_timestamp'),
+    ),
+    'foreign keys' => array(
+      'node' => 'nid',
+      'taxonomy_term_data' => 'tid',
+    ),
+  );
+  db_create_table('forum_index', $forum_index);
+
+  db_query('INSERT INTO {forum_index} (SELECT n.nid, n.title, f.tid, n.sticky, n.created, ncs.last_comment_timestamp, ncs.comment_count FROM {node} n INNER JOIN {forum} f on n.vid = f.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid)');
+}
diff --git modules/image/image.install modules/image/image.install
index 9bd4b8b..b979a07 100644
--- modules/image/image.install
+++ modules/image/image.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the image module.
+ * Install and uninstall functions for the image module.
  */
 
 /**
@@ -106,90 +106,6 @@ function image_schema() {
 }
 
 /**
- * Install the schema for users upgrading from the contributed module.
- */
-function image_update_7000() {
-  if (!db_table_exists('image_styles')) {
-    $schema = array();
-
-    $schema['cache_image'] = drupal_get_schema_unprocessed('system', 'cache');
-    $schema['cache_image']['description'] = 'Cache table used to store information about image manipulations that are in-progress.';
-
-    $schema['image_styles'] = array(
-      'description' => 'Stores configuration options for image styles.',
-      'fields' => array(
-        'isid' => array(
-          'description' => 'The primary identifier for an image style.',
-          'type' => 'serial',
-          'unsigned' => TRUE,
-          'not null' => TRUE,
-        ),
-        'name' => array(
-          'description' => 'The style name.',
-          'type' => 'varchar',
-          'length' => 255,
-          'not null' => TRUE,
-        ),
-      ),
-      'primary key' => array('isid'),
-      'unique keys' => array(
-        'name' => array('name'),
-      ),
-    );
-
-    $schema['image_effects'] = array(
-      'description' => 'Stores configuration options for image effects.',
-      'fields' => array(
-        'ieid' => array(
-          'description' => 'The primary identifier for an image effect.',
-          'type' => 'serial',
-          'unsigned' => TRUE,
-          'not null' => TRUE,
-        ),
-        'isid' => array(
-          'description' => 'The {image_styles}.isid for an image style.',
-          'type' => 'int',
-          'unsigned' => TRUE,
-          'not null' => TRUE,
-          'default' => 0,
-        ),
-        'weight' => array(
-          'description' => 'The weight of the effect in the style.',
-          'type' => 'int',
-          'unsigned' => FALSE,
-          'not null' => TRUE,
-          'default' => 0,
-        ),
-        'name' => array(
-          'description' => 'The unique name of the effect to be executed.',
-          'type' => 'varchar',
-          'length' => 255,
-          'not null' => TRUE,
-        ),
-        'data' => array(
-          'description' => 'The configuration data for the effect.',
-          'type' => 'text',
-          'not null' => TRUE,
-          'size' => 'big',
-          'serialize' => TRUE,
-        ),
-      ),
-      'primary key' => array('ieid'),
-      'indexes' => array(
-        'isid' => array('isid'),
-        'weight' => array('weight'),
-      ),
-      'foreign keys' => array(
-        'isid' => array('image_styles' => 'isid'),
-      ),
-    );
-    db_create_table('cache_image', $schema['cache_image']);
-    db_create_table('image_styles', $schema['image_styles']);
-    db_create_table('image_effect', $schema['image_effects']);
-  }
-}
-
-/**
  * Implements hook_requirements() to check the PHP GD Library.
  *
  * @param $phase
diff --git modules/image/image.update.inc modules/image/image.update.inc
new file mode 100644
index 0000000..b8009e3
--- /dev/null
+++ modules/image/image.update.inc
@@ -0,0 +1,91 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the image module.
+ */
+
+/**
+ * Install the schema for users upgrading from the contributed module.
+ */
+function image_update_7000() {
+  if (!db_table_exists('image_styles')) {
+    $schema = array();
+
+    $schema['cache_image'] = drupal_get_schema_unprocessed('system', 'cache');
+    $schema['cache_image']['description'] = 'Cache table used to store information about image manipulations that are in-progress.';
+
+    $schema['image_styles'] = array(
+      'description' => 'Stores configuration options for image styles.',
+      'fields' => array(
+        'isid' => array(
+          'description' => 'The primary identifier for an image style.',
+          'type' => 'serial',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+        ),
+        'name' => array(
+          'description' => 'The style name.',
+          'type' => 'varchar',
+          'length' => 255,
+          'not null' => TRUE,
+        ),
+      ),
+      'primary key' => array('isid'),
+      'unique keys' => array(
+        'name' => array('name'),
+      ),
+    );
+
+    $schema['image_effects'] = array(
+      'description' => 'Stores configuration options for image effects.',
+      'fields' => array(
+        'ieid' => array(
+          'description' => 'The primary identifier for an image effect.',
+          'type' => 'serial',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+        ),
+        'isid' => array(
+          'description' => 'The {image_styles}.isid for an image style.',
+          'type' => 'int',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+          'default' => 0,
+        ),
+        'weight' => array(
+          'description' => 'The weight of the effect in the style.',
+          'type' => 'int',
+          'unsigned' => FALSE,
+          'not null' => TRUE,
+          'default' => 0,
+        ),
+        'name' => array(
+          'description' => 'The unique name of the effect to be executed.',
+          'type' => 'varchar',
+          'length' => 255,
+          'not null' => TRUE,
+        ),
+        'data' => array(
+          'description' => 'The configuration data for the effect.',
+          'type' => 'text',
+          'not null' => TRUE,
+          'size' => 'big',
+          'serialize' => TRUE,
+        ),
+      ),
+      'primary key' => array('ieid'),
+      'indexes' => array(
+        'isid' => array('isid'),
+        'weight' => array('weight'),
+      ),
+      'foreign keys' => array(
+        'isid' => array('image_styles' => 'isid'),
+      ),
+    );
+    db_create_table('cache_image', $schema['cache_image']);
+    db_create_table('image_styles', $schema['image_styles']);
+    db_create_table('image_effect', $schema['image_effects']);
+  }
+}
diff --git modules/locale/locale.install modules/locale/locale.install
index 93fb793..9d66035 100644
--- modules/locale/locale.install
+++ modules/locale/locale.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the locale module.
+ * Install and uninstall functions for the locale module.
  */
 
 /**
@@ -28,64 +28,6 @@ function locale_install() {
 }
 
 /**
- * @defgroup updates-6.x-to-7.x Locale updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Add context field index and allow longer location.
- */
-function locale_update_7000() {
-  db_drop_index('locales_source', 'source');
-  db_add_index('locales_source', 'source_context', array(array('source', 30), 'context'));
-  db_change_field('locales_source', 'location', 'location', array('type' => 'text', 'size' => 'big', 'not null' => FALSE));
-}
-
-/**
- * Upgrade language negotiation settings.
- */
-function locale_update_7001() {
-  require_once DRUPAL_ROOT . '/includes/language.inc';
-
-  switch (variable_get('language_negotiation', 0)) {
-    // LANGUAGE_NEGOTIATION_NONE.
-    case 0:
-      $negotiation = array();
-      break;
-
-    // LANGUAGE_NEGOTIATION_PATH_DEFAULT.
-    case 1:
-      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
-      break;
-
-    // LANGUAGE_NEGOTIATION_PATH.
-    case 2:
-      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_USER, LOCALE_LANGUAGE_NEGOTIATION_BROWSER);
-      break;
-
-    // LANGUAGE_NEGOTIATION_DOMAIN.
-    case 3:
-      variable_set('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN);
-      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
-      break;
-  }
-
-  // Save new language negotiation options.
-  language_negotiation_set(LANGUAGE_TYPE_INTERFACE, array_flip($negotiation));
-  language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE => 0));
-  language_negotiation_set(LANGUAGE_TYPE_URL, array(LOCALE_LANGUAGE_NEGOTIATION_URL => 0));
-
-  // Unset the old language negotiation system variable.
-  variable_del('language_negotiation');
-
-  return array();
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- */
-
-/**
  * Implements hook_uninstall().
  */
 function locale_uninstall() {
diff --git modules/locale/locale.update.inc modules/locale/locale.update.inc
new file mode 100644
index 0000000..57606b0
--- /dev/null
+++ modules/locale/locale.update.inc
@@ -0,0 +1,65 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the locale module.
+ */
+
+/**
+ * @defgroup updates-6.x-to-7.x Locale updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Add context field index and allow longer location.
+ */
+function locale_update_7000() {
+  db_drop_index('locales_source', 'source');
+  db_add_index('locales_source', 'source_context', array(array('source', 30), 'context'));
+  db_change_field('locales_source', 'location', 'location', array('type' => 'text', 'size' => 'big', 'not null' => FALSE));
+}
+
+/**
+ * Upgrade language negotiation settings.
+ */
+function locale_update_7001() {
+  require_once DRUPAL_ROOT . '/includes/language.inc';
+
+  switch (variable_get('language_negotiation', 0)) {
+    // LANGUAGE_NEGOTIATION_NONE.
+    case 0:
+      $negotiation = array();
+      break;
+
+    // LANGUAGE_NEGOTIATION_PATH_DEFAULT.
+    case 1:
+      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
+      break;
+
+    // LANGUAGE_NEGOTIATION_PATH.
+    case 2:
+      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_USER, LOCALE_LANGUAGE_NEGOTIATION_BROWSER);
+      break;
+
+    // LANGUAGE_NEGOTIATION_DOMAIN.
+    case 3:
+      variable_set('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN);
+      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
+      break;
+  }
+
+  // Save new language negotiation options.
+  language_negotiation_set(LANGUAGE_TYPE_INTERFACE, array_flip($negotiation));
+  language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE => 0));
+  language_negotiation_set(LANGUAGE_TYPE_URL, array(LOCALE_LANGUAGE_NEGOTIATION_URL => 0));
+
+  // Unset the old language negotiation system variable.
+  variable_del('language_negotiation');
+
+  return array();
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ */
diff --git modules/menu/menu.install modules/menu/menu.install
index c4220e1..bf33cb6 100644
--- modules/menu/menu.install
+++ modules/menu/menu.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the menu module.
+ * Install and uninstall functions for the menu module.
  */
 
 /**
diff --git modules/node/node.install modules/node/node.install
index 5e3b2d8..01297d5 100644
--- modules/node/node.install
+++ modules/node/node.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the node module.
+ * Install and uninstall functions for the node module.
  */
 
 /**
@@ -400,283 +400,3 @@ function node_install() {
     ))
     ->execute();
 }
-
-/**
- * Implements hook_update_dependencies().
- */
-function node_update_dependencies() {
-  // Node update 7006 migrates node data to fields and therefore must run after
-  // the Field module has been enabled, but before upgrading field data.
-  $dependencies['node'][7006] = array(
-    'system' => 7049,
-  );
-  $dependencies['system'][7050] = array(
-    'node' => 7006,
-  );
-  return $dependencies;
-}
-
-/**
- * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Fix node type 'module' attribute to avoid name-space conflicts.
- */
-function node_update_7000() {
-  db_update('node_type')
-    ->fields(array('module' => 'node_content'))
-    ->condition('module', 'node')
-    ->execute();
-
-  // Rename the module column to base.
-  db_change_field('node_type', 'module', 'base', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE));
-}
-
-/**
- * Rename {node_revisions} table to {node_revision}.
- */
-function node_update_7001() {
-  db_rename_table('node_revisions', 'node_revision');
-}
-
-/**
- * Extend the node_promote_status index to include all fields required for the node page query.
- */
-function node_update_7002() {
-  db_drop_index('node', 'node_promote_status');
-  db_add_index('node', 'node_frontpage', array('promote', 'status', 'sticky', 'created'));
-}
-
-/**
- * Remove the node_counter if the statistics module is uninstalled.
- */
-function node_update_7003() {
-  if (drupal_get_installed_schema_version('statistics') == SCHEMA_UNINSTALLED) {
-    db_drop_table('node_counter');
-  }
-}
-
-/**
- * Extend the existing default preview and teaser settings to all node types.
- */
-function node_update_7004() {
-  // Get original settings and all types.
-  $original_length = variable_get('teaser_length', 600);
-  $original_preview = variable_get('node_preview', 0);
-
-  // Map old preview setting to new values order.
-  $original_preview ? $original_preview = 2 : $original_preview = 1;
-  drupal_static_reset('_node_types_build');
-  $type_list = node_type_get_types();
-
-  // Apply original settings to all types.
-  foreach ($type_list as $type => $entity) {
-    variable_set('teaser_length_' . $type, $original_length);
-    variable_set('node_preview_' . $type, $original_preview);
-  }
-  // Delete old variable but leave 'teaser_length' for aggregator module upgrade.
-  variable_del('node_preview');
-}
-
-/**
- * Add status/comment/promote and sticky columns to the {node_revision} table.
- */
-function node_update_7005() {
-  foreach(array('status', 'comment', 'promote', 'sticky') as $column) {
-    db_add_field('node_revision', $column, array(
-      'type' => 'int',
-      'not null' => TRUE,
-      'default' => 0,
-    ));
-  }
-}
-
-/**
- * Convert body and teaser from node properties to fields, and migrate status/comment/promote and sticky columns to the {node_revision} table.
- */
-function node_update_7006(&$context) {
-  $context['#finished'] = 0;
-
-  // Get node type info for every invocation.
-  drupal_static_reset('_node_types_build');
-  $node_types = node_type_get_types();
-
-  if (!isset($context['total'])) {
-    // Initial invocation.
-
-    // Re-save node types to create body field instances.
-    foreach ($node_types as $type => $info) {
-      if ($info->has_body) {
-        node_type_save($info);
-      }
-    }
-
-    // Initialize state for future calls.
-    $context['last'] = 0;
-    $context['count'] = 0;
-
-    $query = db_select('node', 'n');
-    $query->join('node_revision', 'nr', 'n.vid = nr.vid');
-    $context['total'] = $query->countQuery()->execute()->fetchField();
-  }
-  else {
-    // Subsequent invocations.
-
-    // Grab the body field ID for field_sql_storage_field_storage_write().
-    $body_field = field_info_field('body');
-    $body_field_id = $body_field['id'];
-
-    $found = FALSE;
-    if ($context['total']) {
-      // Operate on every revision of every node (whee!), in batches.
-      $batch_size = 200;
-      $query = db_select('node_revision', 'nr');
-      $query->innerJoin('node', 'n', 'n.vid = nr.vid');
-      $query
-        ->fields('nr', array('nid', 'vid', 'body', 'teaser', 'format'))
-        ->fields('n', array('type', 'status', 'comment', 'promote', 'sticky', 'language'))
-        ->condition('nr.vid', $context['last'], '>')
-        ->orderBy('nr.vid', 'ASC')
-        ->range(0, $batch_size);
-      $revisions = $query->execute();
-
-      // Load each reversion of each node, set up 'body'
-      // appropriately, and save the node's field data.  Note that
-      // node_load() will not return the body or teaser values from
-      // {node_revision} because those columns have been removed from the
-      // schema structure in memory (but not yet from the database),
-      // so we get the values from the explicit query of the table
-      // instead.
-      foreach ($revisions as $revision) {
-        $found = TRUE;
-
-        if ($node_types[$revision->type]->has_body) {
-          $node = (object) array(
-            'nid' => $revision->nid,
-            'vid' => $revision->vid,
-            'type' => $revision->type,
-          );
-          // After node_update_7009() we will always have LANGUAGE_NONE as
-          // language neutral language code, but here we still have empty
-          // strings.
-          $langcode = empty($revision->language) ? LANGUAGE_NONE : $revision->language;
-          if (!empty($revision->teaser) && $revision->teaser != text_summary($revision->body)) {
-            $node->body[$langcode][0]['summary'] = $revision->teaser;
-          }
-          // Do this after text_summary() above.
-          $break = '<!--break-->';
-          if (substr($revision->body, 0, strlen($break)) == $break) {
-            $revision->body = substr($revision->body, strlen($break));
-          }
-          $node->body[$langcode][0]['value'] = $revision->body;
-          // Explicitly store the current default text format if the revision
-          // did not have its own text format. Similar conversions for other
-          // core modules are performed in filter_update_7005(), but we do this
-          // one here since we are already migrating the data.
-          $node->body[$langcode][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1);
-          // This is a core update and no contrib modules are enabled yet, so
-          // we can assume default field storage for a faster update.
-          field_sql_storage_field_storage_write('node', $node, FIELD_STORAGE_INSERT, array($body_field_id));
-        }
-
-        // Migrate the status columns to the {node_revision} table.
-        db_update('node_revision')
-          ->fields(array(
-            'status' => $revision->status,
-            'comment' => $revision->comment,
-            'promote' => $revision->promote,
-            'sticky' => $revision->sticky,
-          ))
-          ->condition('vid', $revision->vid)
-          ->execute();
-
-        $context['last'] = $revision->vid;
-        $context['count'] += 1;
-      }
-
-      $context['#finished'] = min(0.99, $context['count'] / $context['total']);
-    }
-
-    if (!$found) {
-      // All nodes are processed.
-
-      // Remove the now-obsolete body info from node_revision.
-      db_drop_field('node_revision', 'body');
-      db_drop_field('node_revision', 'teaser');
-      db_drop_field('node_revision', 'format');
-
-      // We're done.
-      $context['#finished'] = 1;
-      return t("!number node body and teaser properties migrated to the 'body' field.", array('!number' => $context['total']));
-    }
-  }
-}
-
-/**
- * Remove column min_word_count.
- */
-function node_update_7007() {
-  db_drop_field('node_type', 'min_word_count');
-}
-
-/**
- * Split the 'administer nodes' permission from 'access content overview'.
- */
-function node_update_7008() {
-  $roles = user_roles(FALSE, 'administer nodes');
-  foreach ($roles as $rid => $role) {
-    user_role_grant_permissions($rid, array('access content overview'));
-  }
-}
-
-/**
- * Convert node languages from the empty string to LANGUAGE_NONE.
- */
-function node_update_7009() {
-  db_update('node')
-    ->fields(array('language' => LANGUAGE_NONE))
-    ->condition('language', '')
-    ->execute();
-}
-
-/**
- * Add the {block_node_type} table.
- */
-function node_update_7010() {
-  $schema['block_node_type'] = array(
-    'description' => 'Sets up display criteria for blocks based on content types',
-    'fields' => array(
-      'module' => array(
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => TRUE,
-        'description' => "The block's origin module, from {block}.module.",
-      ),
-      'delta' => array(
-        'type' => 'varchar',
-        'length' => 32,
-        'not null' => TRUE,
-        'description' => "The block's unique delta within module, from {block}.delta.",
-      ),
-      'type' => array(
-        'type' => 'varchar',
-        'length' => 32,
-        'not null' => TRUE,
-        'description' => "The machine-readable name of this type from {node_type}.type.",
-      ),
-    ),
-    'primary key' => array('module', 'delta', 'type'),
-    'indexes' => array(
-      'type' => array('type'),
-    ),
-  );
-
-  db_create_table('block_node_type', $schema['block_node_type']);
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
diff --git modules/node/node.update.inc modules/node/node.update.inc
new file mode 100644
index 0000000..771b678
--- /dev/null
+++ modules/node/node.update.inc
@@ -0,0 +1,287 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the node module.
+ */
+
+/**
+ * Implements hook_update_dependencies().
+ */
+function node_update_dependencies() {
+  // Node update 7006 migrates node data to fields and therefore must run after
+  // the Field module has been enabled, but before upgrading field data.
+  $dependencies['node'][7006] = array(
+    'system' => 7049,
+  );
+  $dependencies['system'][7050] = array(
+    'node' => 7006,
+  );
+  return $dependencies;
+}
+
+/**
+ * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Fix node type 'module' attribute to avoid name-space conflicts.
+ */
+function node_update_7000() {
+  db_update('node_type')
+    ->fields(array('module' => 'node_content'))
+    ->condition('module', 'node')
+    ->execute();
+
+  // Rename the module column to base.
+  db_change_field('node_type', 'module', 'base', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE));
+}
+
+/**
+ * Rename {node_revisions} table to {node_revision}.
+ */
+function node_update_7001() {
+  db_rename_table('node_revisions', 'node_revision');
+}
+
+/**
+ * Extend the node_promote_status index to include all fields required for the node page query.
+ */
+function node_update_7002() {
+  db_drop_index('node', 'node_promote_status');
+  db_add_index('node', 'node_frontpage', array('promote', 'status', 'sticky', 'created'));
+}
+
+/**
+ * Remove the node_counter if the statistics module is uninstalled.
+ */
+function node_update_7003() {
+  if (drupal_get_installed_schema_version('statistics') == SCHEMA_UNINSTALLED) {
+    db_drop_table('node_counter');
+  }
+}
+
+/**
+ * Extend the existing default preview and teaser settings to all node types.
+ */
+function node_update_7004() {
+  // Get original settings and all types.
+  $original_length = variable_get('teaser_length', 600);
+  $original_preview = variable_get('node_preview', 0);
+
+  // Map old preview setting to new values order.
+  $original_preview ? $original_preview = 2 : $original_preview = 1;
+  drupal_static_reset('_node_types_build');
+  $type_list = node_type_get_types();
+
+  // Apply original settings to all types.
+  foreach ($type_list as $type => $entity) {
+    variable_set('teaser_length_' . $type, $original_length);
+    variable_set('node_preview_' . $type, $original_preview);
+  }
+  // Delete old variable but leave 'teaser_length' for aggregator module upgrade.
+  variable_del('node_preview');
+}
+
+/**
+ * Add status/comment/promote and sticky columns to the {node_revision} table.
+ */
+function node_update_7005() {
+  foreach(array('status', 'comment', 'promote', 'sticky') as $column) {
+    db_add_field('node_revision', $column, array(
+      'type' => 'int',
+      'not null' => TRUE,
+      'default' => 0,
+    ));
+  }
+}
+
+/**
+ * Convert body and teaser from node properties to fields, and migrate status/comment/promote and sticky columns to the {node_revision} table.
+ */
+function node_update_7006(&$context) {
+  $context['#finished'] = 0;
+
+  // Get node type info for every invocation.
+  drupal_static_reset('_node_types_build');
+  $node_types = node_type_get_types();
+
+  if (!isset($context['total'])) {
+    // Initial invocation.
+
+    // Re-save node types to create body field instances.
+    foreach ($node_types as $type => $info) {
+      if ($info->has_body) {
+        node_type_save($info);
+      }
+    }
+
+    // Initialize state for future calls.
+    $context['last'] = 0;
+    $context['count'] = 0;
+
+    $query = db_select('node', 'n');
+    $query->join('node_revision', 'nr', 'n.vid = nr.vid');
+    $context['total'] = $query->countQuery()->execute()->fetchField();
+  }
+  else {
+    // Subsequent invocations.
+
+    // Grab the body field ID for field_sql_storage_field_storage_write().
+    $body_field = field_info_field('body');
+    $body_field_id = $body_field['id'];
+
+    $found = FALSE;
+    if ($context['total']) {
+      // Operate on every revision of every node (whee!), in batches.
+      $batch_size = 200;
+      $query = db_select('node_revision', 'nr');
+      $query->innerJoin('node', 'n', 'n.vid = nr.vid');
+      $query
+        ->fields('nr', array('nid', 'vid', 'body', 'teaser', 'format'))
+        ->fields('n', array('type', 'status', 'comment', 'promote', 'sticky', 'language'))
+        ->condition('nr.vid', $context['last'], '>')
+        ->orderBy('nr.vid', 'ASC')
+        ->range(0, $batch_size);
+      $revisions = $query->execute();
+
+      // Load each reversion of each node, set up 'body'
+      // appropriately, and save the node's field data.  Note that
+      // node_load() will not return the body or teaser values from
+      // {node_revision} because those columns have been removed from the
+      // schema structure in memory (but not yet from the database),
+      // so we get the values from the explicit query of the table
+      // instead.
+      foreach ($revisions as $revision) {
+        $found = TRUE;
+
+        if ($node_types[$revision->type]->has_body) {
+          $node = (object) array(
+            'nid' => $revision->nid,
+            'vid' => $revision->vid,
+            'type' => $revision->type,
+          );
+          // After node_update_7009() we will always have LANGUAGE_NONE as
+          // language neutral language code, but here we still have empty
+          // strings.
+          $langcode = empty($revision->language) ? LANGUAGE_NONE : $revision->language;
+          if (!empty($revision->teaser) && $revision->teaser != text_summary($revision->body)) {
+            $node->body[$langcode][0]['summary'] = $revision->teaser;
+          }
+          // Do this after text_summary() above.
+          $break = '<!--break-->';
+          if (substr($revision->body, 0, strlen($break)) == $break) {
+            $revision->body = substr($revision->body, strlen($break));
+          }
+          $node->body[$langcode][0]['value'] = $revision->body;
+          // Explicitly store the current default text format if the revision
+          // did not have its own text format. Similar conversions for other
+          // core modules are performed in filter_update_7005(), but we do this
+          // one here since we are already migrating the data.
+          $node->body[$langcode][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1);
+          // This is a core update and no contrib modules are enabled yet, so
+          // we can assume default field storage for a faster update.
+          field_sql_storage_field_storage_write('node', $node, FIELD_STORAGE_INSERT, array($body_field_id));
+        }
+
+        // Migrate the status columns to the {node_revision} table.
+        db_update('node_revision')
+          ->fields(array(
+            'status' => $revision->status,
+            'comment' => $revision->comment,
+            'promote' => $revision->promote,
+            'sticky' => $revision->sticky,
+          ))
+          ->condition('vid', $revision->vid)
+          ->execute();
+
+        $context['last'] = $revision->vid;
+        $context['count'] += 1;
+      }
+
+      $context['#finished'] = min(0.99, $context['count'] / $context['total']);
+    }
+
+    if (!$found) {
+      // All nodes are processed.
+
+      // Remove the now-obsolete body info from node_revision.
+      db_drop_field('node_revision', 'body');
+      db_drop_field('node_revision', 'teaser');
+      db_drop_field('node_revision', 'format');
+
+      // We're done.
+      $context['#finished'] = 1;
+      return t("!number node body and teaser properties migrated to the 'body' field.", array('!number' => $context['total']));
+    }
+  }
+}
+
+/**
+ * Remove column min_word_count.
+ */
+function node_update_7007() {
+  db_drop_field('node_type', 'min_word_count');
+}
+
+/**
+ * Split the 'administer nodes' permission from 'access content overview'.
+ */
+function node_update_7008() {
+  $roles = user_roles(FALSE, 'administer nodes');
+  foreach ($roles as $rid => $role) {
+    user_role_grant_permissions($rid, array('access content overview'));
+  }
+}
+
+/**
+ * Convert node languages from the empty string to LANGUAGE_NONE.
+ */
+function node_update_7009() {
+  db_update('node')
+    ->fields(array('language' => LANGUAGE_NONE))
+    ->condition('language', '')
+    ->execute();
+}
+
+/**
+ * Add the {block_node_type} table.
+ */
+function node_update_7010() {
+  $schema['block_node_type'] = array(
+    'description' => 'Sets up display criteria for blocks based on content types',
+    'fields' => array(
+      'module' => array(
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+        'description' => "The block's origin module, from {block}.module.",
+      ),
+      'delta' => array(
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'description' => "The block's unique delta within module, from {block}.delta.",
+      ),
+      'type' => array(
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'description' => "The machine-readable name of this type from {node_type}.type.",
+      ),
+    ),
+    'primary key' => array('module', 'delta', 'type'),
+    'indexes' => array(
+      'type' => array('type'),
+    ),
+  );
+
+  db_create_table('block_node_type', $schema['block_node_type']);
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/openid/openid.install modules/openid/openid.install
index 70c4238..2994dc8 100644
--- modules/openid/openid.install
+++ modules/openid/openid.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the openid module.
+ * Install and uninstall functions for the openid module.
  */
 
 /**
diff --git modules/overlay/overlay.install modules/overlay/overlay.install
index 77a24b4..3065268 100644
--- modules/overlay/overlay.install
+++ modules/overlay/overlay.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the overlay module.
+ * Install and uninstall functions for the overlay module.
  */
 
 /**
diff --git modules/php/php.install modules/php/php.install
index 4ec0feb..7fd1446 100644
--- modules/php/php.install
+++ modules/php/php.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the php module.
+ * Install and uninstall functions for the php module.
  */
 
 /**
diff --git modules/poll/poll.install modules/poll/poll.install
index d76c652..04b2885 100644
--- modules/poll/poll.install
+++ modules/poll/poll.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the poll module.
+ * Install and uninstall functions for the poll module.
  */
 
 /**
@@ -136,35 +136,3 @@ function poll_schema() {
 
   return $schema;
 }
-
-/**
- * Rename {poll_choices} table to {poll_choice} and {poll_votes} to {poll_vote}.
- */
-function poll_update_7001() {
-  db_rename_table('poll_choices', 'poll_choice');
-  db_rename_table('poll_votes', 'poll_vote');
-}
-
-/**
- * Add timestamp field to {poll_vote}.
- */
-function poll_update_7002() {
-  $field = array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-  );
-  db_add_field('poll_vote', 'timestamp', $field);
-}
-
-/**
- * Change the weight column to normal int.
- */
-function poll_update_7003() {
-  db_change_field('poll_choice', 'weight', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'The sort order of this choice among all choices for the same node.',
-  ));
-}
diff --git modules/poll/poll.update.inc modules/poll/poll.update.inc
new file mode 100644
index 0000000..9784671
--- /dev/null
+++ modules/poll/poll.update.inc
@@ -0,0 +1,39 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the poll module.
+ */
+
+/**
+ * Rename {poll_choices} table to {poll_choice} and {poll_votes} to {poll_vote}.
+ */
+function poll_update_7001() {
+  db_rename_table('poll_choices', 'poll_choice');
+  db_rename_table('poll_votes', 'poll_vote');
+}
+
+/**
+ * Add timestamp field to {poll_vote}.
+ */
+function poll_update_7002() {
+  $field = array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+  );
+  db_add_field('poll_vote', 'timestamp', $field);
+}
+
+/**
+ * Change the weight column to normal int.
+ */
+function poll_update_7003() {
+  db_change_field('poll_choice', 'weight', 'weight', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'The sort order of this choice among all choices for the same node.',
+  ));
+}
diff --git modules/profile/profile.install modules/profile/profile.install
index 6970621..2a3952f 100644
--- modules/profile/profile.install
+++ modules/profile/profile.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the profile module.
+ * Install and uninstall functions for the profile module.
  */
 
 /**
@@ -145,23 +145,3 @@ function profile_schema() {
 
   return $schema;
 }
-
-/**
- * Rename {profile_fields} table to {profile_field} and {profile_values} to {profile_value}.
- */
-function profile_update_7001() {
-  db_rename_table('profile_fields', 'profile_field');
-  db_rename_table('profile_values', 'profile_value');
-}
-
-/**
- * Change the weight column to normal int.
- */
-function profile_update_7002() {
-  db_change_field('profile_field', 'weight', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'Weight of field in relation to other profile fields.',
-  ));
-}
diff --git modules/profile/profile.update.inc modules/profile/profile.update.inc
new file mode 100644
index 0000000..bb6ab12
--- /dev/null
+++ modules/profile/profile.update.inc
@@ -0,0 +1,27 @@
+<?php
+// $Id: profile.install,v 1.25 2010/02/03 18:16:23 webchick Exp $
+
+/**
+ * @file
+ * Update functions for the profile module.
+ */
+
+/**
+ * Rename {profile_fields} table to {profile_field} and {profile_values} to {profile_value}.
+ */
+function profile_update_7001() {
+  db_rename_table('profile_fields', 'profile_field');
+  db_rename_table('profile_values', 'profile_value');
+}
+
+/**
+ * Change the weight column to normal int.
+ */
+function profile_update_7002() {
+  db_change_field('profile_field', 'weight', 'weight', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => 'Weight of field in relation to other profile fields.',
+  ));
+}
diff --git modules/rdf/rdf.install modules/rdf/rdf.install
index 1e82f1d..71a49dd 100644
--- modules/rdf/rdf.install
+++ modules/rdf/rdf.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the rdf module.
+ * Install and uninstall functions for the rdf module.
  */
 
 /**
diff --git modules/search/search.install modules/search/search.install
index 7d8ed58..305a37d 100644
--- modules/search/search.install
+++ modules/search/search.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the search module.
+ * Install and uninstall functions for the search module.
  */
 
 /**
@@ -149,15 +149,3 @@ function search_schema() {
 
   return $schema;
 }
-
-/**
- * Replace unique keys in 'search_dataset' and 'search_index' by primary keys.
- */
-function search_update_7000() {
-  db_drop_unique_key('search_dataset', 'sid_type');
-  db_add_primary_key('search_dataset', array('sid', 'type'));
-
-  db_drop_index('search_index', 'word');
-  db_drop_unique_key('search_index', 'word_sid_type');
-  db_add_primary_key('search_index', array('word', 'sid', 'type'));
-}
diff --git modules/search/search.update.inc modules/search/search.update.inc
new file mode 100644
index 0000000..5d591c7
--- /dev/null
+++ modules/search/search.update.inc
@@ -0,0 +1,19 @@
+<?php
+// $Id: search.install,v 1.27 2009/12/04 16:49:47 dries Exp $
+
+/**
+ * @file
+ * Update functions for the search module.
+ */
+
+/**
+ * Replace unique keys in 'search_dataset' and 'search_index' by primary keys.
+ */
+function search_update_7000() {
+  db_drop_unique_key('search_dataset', 'sid_type');
+  db_add_primary_key('search_dataset', array('sid', 'type'));
+
+  db_drop_index('search_index', 'word');
+  db_drop_unique_key('search_index', 'word_sid_type');
+  db_add_primary_key('search_index', array('word', 'sid', 'type'));
+}
diff --git modules/shortcut/shortcut.install modules/shortcut/shortcut.install
index df9fa78..d86f16d 100644
--- modules/shortcut/shortcut.install
+++ modules/shortcut/shortcut.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the shortcut module.
+ * Install and uninstall functions for the shortcut module.
  */
 
 /**
diff --git modules/simpletest/simpletest.install modules/simpletest/simpletest.install
index 2805a9d..f8c5560 100644
--- modules/simpletest/simpletest.install
+++ modules/simpletest/simpletest.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the simpletest module.
+ * Install and uninstall functions for the simpletest module.
  */
 
 /**
diff --git modules/simpletest/tests/database_test.install modules/simpletest/tests/database_test.install
index dfb1497..43ffb8a 100644
--- modules/simpletest/tests/database_test.install
+++ modules/simpletest/tests/database_test.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the database_test module.
+ * Install and uninstall functions for the database_test module.
  */
 
 /**
diff --git modules/simpletest/tests/module_test.install modules/simpletest/tests/module_test.install
index 3f00ee7..848d02d 100644
--- modules/simpletest/tests/module_test.install
+++ modules/simpletest/tests/module_test.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the module_test module.
+ * Install and uninstall functions for the module_test module.
  */
 
 /**
diff --git modules/simpletest/tests/taxonomy_test.install modules/simpletest/tests/taxonomy_test.install
index b901e7a..0d3e09d 100644
--- modules/simpletest/tests/taxonomy_test.install
+++ modules/simpletest/tests/taxonomy_test.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the taxonomy_test module.
+ * Install and uninstall functions for the taxonomy_test module.
  */
 
 /**
diff --git modules/simpletest/tests/update_test_1.install modules/simpletest/tests/update_test_1.install
deleted file mode 100644
index 814a74a..0000000
--- modules/simpletest/tests/update_test_1.install
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-// $Id: update_test_1.install,v 1.2 2010/04/28 05:28:22 webchick Exp $
-
-/**
- * @file
- * Install, update and uninstall functions for the update_test_1 module.
- */
-
-/**
- * Implements hook_update_dependencies().
- *
- * @see update_test_2_update_dependencies()
- */
-function update_test_1_update_dependencies() {
-  // These dependencies are used in combination with those declared in
-  // update_test_2_update_dependencies() for the sole purpose of testing that
-  // the results of hook_update_dependencies() are collected correctly and have
-  // the correct array structure. Therefore, we use updates from System module
-  // (which have already run), so that they will not get in the way of other
-  // tests.
-  $dependencies['system'][7000] = array(
-    // Compare to update_test_2_update_dependencies(), where the same System
-    // module update function is forced to depend on an update function from a
-    // different module. This allows us to test that both dependencies are
-    // correctly recorded.
-    'update_test_1' => 7000,
-  );
-  $dependencies['system'][7001] = array(
-    // Compare to update_test_2_update_dependencies(), where the same System
-    // module update function is forced to depend on a different update
-    // function within the same module. This allows us to test that only the
-    // dependency on the higher-numbered update function is recorded.
-    'update_test_1' => 7002,
-  );
-  return $dependencies;
-}
-
-/**
- * Dummy update_test_1 update 7000.
- */
-function update_test_1_update_7000() {
-}
-
-/**
- * Dummy update_test_1 update 7001.
- */
-function update_test_1_update_7001() {
-}
-
-/**
- * Dummy update_test_1 update 7002.
- */
-function update_test_1_update_7002() {
-}
diff --git modules/simpletest/tests/update_test_1.update.inc modules/simpletest/tests/update_test_1.update.inc
new file mode 100644
index 0000000..814a74a
--- /dev/null
+++ modules/simpletest/tests/update_test_1.update.inc
@@ -0,0 +1,54 @@
+<?php
+// $Id: update_test_1.install,v 1.2 2010/04/28 05:28:22 webchick Exp $
+
+/**
+ * @file
+ * Install, update and uninstall functions for the update_test_1 module.
+ */
+
+/**
+ * Implements hook_update_dependencies().
+ *
+ * @see update_test_2_update_dependencies()
+ */
+function update_test_1_update_dependencies() {
+  // These dependencies are used in combination with those declared in
+  // update_test_2_update_dependencies() for the sole purpose of testing that
+  // the results of hook_update_dependencies() are collected correctly and have
+  // the correct array structure. Therefore, we use updates from System module
+  // (which have already run), so that they will not get in the way of other
+  // tests.
+  $dependencies['system'][7000] = array(
+    // Compare to update_test_2_update_dependencies(), where the same System
+    // module update function is forced to depend on an update function from a
+    // different module. This allows us to test that both dependencies are
+    // correctly recorded.
+    'update_test_1' => 7000,
+  );
+  $dependencies['system'][7001] = array(
+    // Compare to update_test_2_update_dependencies(), where the same System
+    // module update function is forced to depend on a different update
+    // function within the same module. This allows us to test that only the
+    // dependency on the higher-numbered update function is recorded.
+    'update_test_1' => 7002,
+  );
+  return $dependencies;
+}
+
+/**
+ * Dummy update_test_1 update 7000.
+ */
+function update_test_1_update_7000() {
+}
+
+/**
+ * Dummy update_test_1 update 7001.
+ */
+function update_test_1_update_7001() {
+}
+
+/**
+ * Dummy update_test_1 update 7002.
+ */
+function update_test_1_update_7002() {
+}
diff --git modules/simpletest/tests/update_test_2.install modules/simpletest/tests/update_test_2.install
deleted file mode 100644
index 6e094ac..0000000
--- modules/simpletest/tests/update_test_2.install
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-// $Id: update_test_2.install,v 1.2 2010/04/28 05:28:22 webchick Exp $
-
-/**
- * @file
- * Install, update and uninstall functions for the update_test_2 module.
- */
-
-/**
- * Implements hook_update_dependencies().
- *
- * @see update_test_1_update_dependencies()
- * @see update_test_3_update_dependencies()
- */
-function update_test_2_update_dependencies() {
-  // Combined with update_test_3_update_dependencies(), we are declaring here
-  // that these two modules run updates in the following order:
-  // 1. update_test_2_update_7000()
-  // 2. update_test_3_update_7000()
-  // 3. update_test_2_update_7001()
-  // 4. update_test_2_update_7002()
-  $dependencies['update_test_2'][7001] = array(
-    'update_test_3' => 7000,
-  );
-
-  // These are coordinated with the corresponding dependencies declared in
-  // update_test_1_update_dependencies().
-  $dependencies['system'][7000] = array(
-    'update_test_2' => 7001,
-  );
-  $dependencies['system'][7001] = array(
-    'update_test_1' => 7001,
-  );
-
-  return $dependencies;
-}
-
-/**
- * Dummy update_test_2 update 7000.
- */
-function update_test_2_update_7000() {
-}
-
-/**
- * Dummy update_test_2 update 7001.
- */
-function update_test_2_update_7001() {
-}
-
-/**
- * Dummy update_test_2 update 7002.
- */
-function update_test_2_update_7002() {
-}
diff --git modules/simpletest/tests/update_test_2.update.inc modules/simpletest/tests/update_test_2.update.inc
new file mode 100644
index 0000000..b402453
--- /dev/null
+++ modules/simpletest/tests/update_test_2.update.inc
@@ -0,0 +1,35 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the update_test_2 module.
+ */
+
+/**
+ * Implements hook_update_dependencies().
+ */
+function update_test_2_update_dependencies() {
+  $dependencies['update_test_2'][7001] = array(
+    'update_test_3' => 7000,
+  );
+  return $dependencies;
+}
+
+/**
+ * Dummy update_test_2 update 7000.
+ */
+function update_test_2_update_7000() {
+}
+
+/**
+ * Dummy update_test_2 update 7001.
+ */
+function update_test_2_update_7001() {
+}
+
+/**
+ * Dummy update_test_2 update 7002.
+ */
+function update_test_2_update_7002() {
+}
diff --git modules/simpletest/tests/update_test_3.install modules/simpletest/tests/update_test_3.install
deleted file mode 100644
index 4a86e79..0000000
--- modules/simpletest/tests/update_test_3.install
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-// $Id: update_test_3.install,v 1.2 2010/04/28 05:28:22 webchick Exp $
-
-/**
- * @file
- * Install, update and uninstall functions for the update_test_3 module.
- */
-
-/**
- * Implements hook_update_dependencies().
- *
- * @see update_test_2_update_dependencies()
- */
-function update_test_3_update_dependencies() {
-  $dependencies['update_test_3'][7000] = array(
-    'update_test_2' => 7000,
-  );
-  return $dependencies;
-}
-
-/**
- * Dummy update_test_3 update 7000.
- */
-function update_test_3_update_7000() {
-}
diff --git modules/simpletest/tests/update_test_3.update.inc modules/simpletest/tests/update_test_3.update.inc
new file mode 100644
index 0000000..6dbe10c
--- /dev/null
+++ modules/simpletest/tests/update_test_3.update.inc
@@ -0,0 +1,23 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the update_test_3 module.
+ */
+
+/**
+ * Implements hook_update_dependencies().
+ */
+function update_test_3_update_dependencies() {
+  $dependencies['update_test_3'][7000] = array(
+    'update_test_2' => 7000,
+  );
+  return $dependencies;
+}
+
+/**
+ * Dummy update_test_3 update 7000.
+ */
+function update_test_3_update_7000() {
+}
diff --git modules/statistics/statistics.install modules/statistics/statistics.install
index 0276503..12e6808 100644
--- modules/statistics/statistics.install
+++ modules/statistics/statistics.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the statistics module.
+ * Install and uninstall functions for the statistics module.
  */
 
 /**
@@ -132,13 +132,3 @@ function statistics_schema() {
 
   return $schema;
 }
-
-/**
- * @defgroup updates-6.x-to-7.x statistics updates from 6.x to 7.x
- * @{
- */
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
diff --git modules/statistics/statistics.update.inc modules/statistics/statistics.update.inc
new file mode 100644
index 0000000..f88b8c1
--- /dev/null
+++ modules/statistics/statistics.update.inc
@@ -0,0 +1,17 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the statistics module.
+ */
+
+/**
+ * @defgroup updates-6.x-to-7.x statistics updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/system/system.install modules/system/system.install
index cda7f2d..7e79fbe 100644
--- modules/system/system.install
+++ modules/system/system.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the system module.
+ * Install and uninstall functions for the system module.
  */
 
 /**
@@ -1509,797 +1509,3 @@ function system_schema() {
 
   return $schema;
 }
-
-// Updates for core.
-
-function system_update_last_removed() {
-  return 6055;
-}
-
-/**
- * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Rename blog and forum permissions to be consistent with other content types.
- */
-function system_update_7000() {
-  $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
-  foreach ($result as $role) {
-    $renamed_permission = preg_replace('/(?<=^|,\ )create\ blog\ entries(?=,|$)/', 'create blog content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ blog\ entries(?=,|$)/', 'edit own blog content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ blog\ entry(?=,|$)/', 'edit any blog content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ blog\ entries(?=,|$)/', 'delete own blog content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ blog\ entry(?=,|$)/', 'delete any blog content', $role->perm);
-
-    $renamed_permission = preg_replace('/(?<=^|,\ )create\ forum\ topics(?=,|$)/', 'create forum content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ forum\ topic(?=,|$)/', 'delete any forum content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ forum\ topics(?=,|$)/', 'delete own forum content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ forum\ topic(?=,|$)/', 'edit any forum content', $role->perm);
-    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ forum\ topics(?=,|$)/', 'edit own forum content', $role->perm);
-
-    if ($renamed_permission != $role->perm) {
-      db_update('permission')
-        ->fields(array('perm' => $renamed_permission))
-        ->condition('rid', $role->rid)
-        ->execute();
-    }
-  }
-}
-
-/**
- * Generate a cron key and save it in the variables table.
- */
-function system_update_7001() {
-  variable_set('cron_key', md5(mt_rand()));
-}
-
-/**
- * Add a table to store blocked IP addresses.
- */
-function system_update_7002() {
-  $schema['blocked_ips'] = array(
-    'description' => 'Stores blocked IP addresses.',
-    'fields' => array(
-      'iid' => array(
-        'description' => 'Primary Key: unique ID for IP addresses.',
-        'type' => 'serial',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-      'ip' => array(
-        'description' => 'IP address',
-        'type' => 'varchar',
-        'length' => 32,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-    ),
-    'indexes' => array(
-      'blocked_ip' => array('ip'),
-    ),
-    'primary key' => array('iid'),
-  );
-
-  db_create_table('blocked_ips', $schema['blocked_ips']);
-}
-
-/**
- * Update {blocked_ips} with valid IP addresses from {access}.
- */
-function system_update_7003() {
-  $messages = array();
-  $type = 'host';
-  $result = db_query("SELECT mask FROM {access} WHERE status = :status AND type = :type", array(
-    ':status' => 0,
-    ':type' => $type,
-  ));
-  foreach ($result as $blocked) {
-    if (filter_var($blocked->mask, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) !== FALSE) {
-      db_insert('blocked_ips')
-        ->fields(array('ip' => $blocked->mask))
-        ->execute();
-    }
-    else {
-      $invalid_host = check_plain($blocked->mask);
-      $messages[] = t('The host !host is no longer blocked because it is not a valid IP address.', array('!host' => $invalid_host ));
-    }
-  }
-  if (isset($invalid_host)) {
-    drupal_set_message('Drupal no longer supports wildcard IP address blocking. Visitors whose IP addresses match ranges you have previously set using <em>access rules</em> will no longer be blocked from your site when you put the site online. See the <a href="http://drupal.org/node/24302">IP address and referrer blocking Handbook page</a> for alternative methods.', 'warning');
-  }
-  // Make sure not to block any IP addresses that were specifically allowed by access rules.
-  if (!empty($result)) {
-    $result = db_query("SELECT mask FROM {access} WHERE status = :status AND type = :type", array(
-      ':status' => 1,
-      ':type' => $type,
-    ));
-    $or = db_condition('or');
-    foreach ($result as $allowed) {
-      $or->condition('ip', $allowed->mask, 'LIKE');
-    }
-    if (count($or)) {
-      db_delete('blocked_ips')
-        ->condition($or)
-        ->execute();
-    }
-  }
-}
-
-/**
- * Remove hardcoded numeric deltas from all blocks in core.
- */
-function system_update_7004(&$sandbox) {
-  // Get an array of the renamed block deltas, organized by module.
-  $renamed_deltas = array(
-    'blog' => array('0' => 'recent'),
-    'book' => array('0' => 'navigation'),
-    'comment' => array('0' => 'recent'),
-    'forum' => array(
-      '0' => 'active',
-      '1' => 'new',
-    ),
-    'locale' => array('0' => 'language-switcher'),
-    'node' => array('0' => 'syndicate'),
-    'poll' => array('0' => 'recent'),
-    'profile' => array('0' => 'author-information'),
-    'search' => array('0' => 'form'),
-    'statistics' => array('0' => 'popular'),
-    'system' => array('0' => 'powered-by'),
-    'user' => array(
-      '0' => 'login',
-      '1' => 'navigation',
-      '2' => 'new',
-      '3' => 'online',
-    ),
-  );
-
-  // Only run this the first time through the batch update.
-  if (!isset($sandbox['progress'])) {
-    // Rename forum module's block variables.
-    $forum_block_num_0 = variable_get('forum_block_num_0');
-    if (isset($forum_block_num_0)) {
-      variable_set('forum_block_num_active', $forum_block_num_0);
-      variable_del('forum_block_num_0');
-    }
-    $forum_block_num_1 = variable_get('forum_block_num_1');
-    if (isset($forum_block_num_1)) {
-      variable_set('forum_block_num_new', $forum_block_num_1);
-      variable_del('forum_block_num_1');
-    }
-  }
-
-  update_fix_d7_block_deltas($sandbox, $renamed_deltas);
-
-}
-
-/**
- * Remove throttle columns and variables.
- */
-function system_update_7005() {
-  db_drop_field('blocks', 'throttle');
-  db_drop_field('system', 'throttle');
-  variable_del('throttle_user');
-  variable_del('throttle_anonymous');
-  variable_del('throttle_level');
-  variable_del('throttle_probability_limiter');
-}
-
-/**
- * Registry tables and drop the file key of the menu router, since it is no
- * longer needed.
- */
-function system_update_7006() {
-  // Update moved to update_fix_d7_requirements().
-}
-
-/**
- * Convert to new method of storing permissions.
- *
- * This update is in system.install rather than user.install so that
- * all modules can use the updated permission scheme during their updates.
- */
-function system_update_7007() {
-  // Copy the permissions from the old {permission} table to the new {role_permission} table.
-  $messages = array();
-  $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid ASC");
-  $query = db_insert('role_permission')->fields(array('rid', 'permission'));
-  foreach ($result as $role) {
-    foreach (explode(', ', $role->perm) as $perm) {
-      $query->values(array(
-        'rid' => $role->rid,
-        'permission' => $perm,
-      ));
-    }
-    $messages[] = t('Inserted into {role_permission} the permissions for role ID !id', array('!id' => $role->rid));
-  }
-  $query->execute();
-  db_drop_table('permission');
-
-  return implode(', ', $messages);
-}
-
-/**
- * Use the poll_choice primary key to record votes in poll_votes rather than
- * the choice order. Rename chorder to weight.
- */
-function system_update_7008() {
-  if (db_table_exists('poll_votes')) {
-    // Add chid column and convert existing votes.
-    db_add_field('poll_votes', 'chid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
-    db_add_index('poll_votes', 'chid', array('chid'));
-    db_query("UPDATE {poll_votes} SET chid = (SELECT chid FROM {poll_choices} c WHERE {poll_votes}.chorder = c.chorder AND {poll_votes}.nid = c.nid)");
-    // Remove old chorder column.
-    db_drop_field('poll_votes', 'chorder');
-  }
-  if (db_table_exists('poll_choices')) {
-    // Change the chorder column to weight in poll_choices.
-    db_change_field('poll_choices', 'chorder', 'weight', array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'));
-  }
-}
-
-/**
- * Rename the variables for primary and secondary links.
- *
- */
-function system_update_7009() {
-  db_update('variable')
-    ->fields(array('name' => 'main_menu_links_source'))
-    ->condition('name', 'menu_primary_links_source')
-    ->execute();
-}
-
-/**
- * Moved to system_update_6048().
- */
-function system_update_7010() {
-  return '';
-}
-
-/**
- * Split the 'bypass node access' permission from 'administer nodes'.
- */
-function system_update_7011() {
-  // Get existing roles that can 'administer nodes'.
-  $rids = array();
-  $rids = db_query("SELECT rid FROM {role_permission} WHERE permission = :perm", array(':perm' => 'administer nodes'))->fetchCol();
-  // None found.
-  if (empty($rids)) {
-    return;
-  }
-  $insert = db_insert('role_permission')->fields(array('rid', 'permission'));
-  foreach ($rids as $rid) {
-    $insert->values(array(
-    'rid' => $rid,
-    'permission' => 'bypass node access',
-    ));
-  }
-  $insert->execute();
-}
-
-// system_update_7012() moved to block_update_7002().
-
-/**
- * Convert default time zone offset to default time zone name.
- */
-function system_update_7013() {
-  $timezone = NULL;
-  $timezones = system_time_zones();
-  // If the contributed Date module set a default time zone name, use this
-  // setting as the default time zone.
-  if (($timezone_name = variable_get('date_default_timezone_name')) && isset($timezones[$timezone_name])) {
-    $timezone = $timezone_name;
-  }
-  // If the contributed Event module has set a default site time zone, look up
-  // the time zone name and use it as the default time zone.
-  if (!$timezone && ($timezone_id = variable_get('date_default_timezone_id', 0))) {
-    try {
-      $timezone_name = db_query('SELECT name FROM {event_timezones} WHERE timezone = :timezone_id', array(':timezone_id' => $timezone_id))->fetchField();
-      if (($timezone_name = str_replace(' ', '_', $timezone_name)) && isset($timezones[$timezone_name])) {
-        $timezone = $timezone_name;
-      }
-    }
-    catch (PDOException $e) {
-      // Ignore error if event_timezones table does not exist or unexpected
-      // schema found.
-    }
-  }
-  // If the previous default time zone was a non-zero offset, guess the site's
-  // intended time zone based on that offset and the server's daylight saving
-  // time status.
-  if (!$timezone && ($offset = variable_get('date_default_timezone', 0)) && ($timezone_name = timezone_name_from_abbr('', intval($offset), date('I'))) && isset($timezones[$timezone_name])) {
-    $timezone = $timezone_name;
-  }
-  // Otherwise, the default time zone offset was zero, which is UTC.
-  if (!$timezone) {
-    $timezone = 'UTC';
-  }
-  variable_set('date_default_timezone', $timezone);
-  drupal_set_message('The default time zone has been set to <em>' . check_plain($timezone) . '</em>. Check the ' . l('date and time configuration page', 'admin/config/regional/settings') . ' to configure it correctly.', 'warning');
-}
-
-/**
- * Drop the bootstrap column from the {system} table. This was reverted.
- */
-function system_update_7014() {
-}
-
-/**
- * Change the user logout path.
- */
-function system_update_7015() {
-  db_update('menu_links')
-    ->fields(array('link_path' => 'user/logout'))
-    ->condition('link_path', 'logout')
-    ->execute();
-
- db_update('menu_links')
-    ->fields(array('router_path' => 'user/logout'))
-    ->condition('router_path', 'logout')
-    ->execute();
-}
-
-/**
- * Remove custom datatype *_unsigned in PostgreSQL.
- */
-function system_update_7016() {
-  // Only run these queries if the driver used is pgsql.
-  if (db_driver() == 'pgsql') {
-    $result = db_query("SELECT c.relname AS table, a.attname AS field,
-                        pg_catalog.format_type(a.atttypid, a.atttypmod) AS type
-                        FROM pg_catalog.pg_attribute a
-                        LEFT JOIN pg_class c ON (c.oid =  a.attrelid)
-                        WHERE pg_catalog.pg_table_is_visible(c.oid) AND c.relkind = 'r'
-                        AND pg_catalog.format_type(a.atttypid, a.atttypmod) LIKE '%unsigned%'");
-    foreach ($result as $row) {
-      switch ($row->type) {
-        case 'smallint_unsigned':
-          $datatype = 'int';
-          break;
-        case 'int_unsigned':
-        case 'bigint_unsigned':
-        default:
-          $datatype = 'bigint';
-          break;
-      }
-      db_query('ALTER TABLE ' . $row->table . ' ALTER COLUMN ' . $row->field . ' TYPE ' . $datatype);
-      db_query('ALTER TABLE ' . $row->table . ' ADD CHECK (' . $row->field . ' >= 0)');
-    }
-    db_query('DROP DOMAIN smallint_unsigned');
-    db_query('DROP DOMAIN int_unsigned');
-    db_query('DROP DOMAIN bigint_unsigned');
-  }
-}
-
-/**
- * Change the theme setting 'toggle_node_info' into a per content type variable.
- */
-function system_update_7017() {
-  $types = node_type_get_types();
-  if (count($types)) {
-    foreach ($types as $type) {
-      $node_info = theme_get_setting('toggle_node_info_' . $type->type);
-      if ($node_info !== NULL) {
-        variable_set('node_submitted_' . $type->type, $node_info);
-      }
-    }
-  }
-
-  // Unset deprecated 'toggle_node_info' theme settings.
-  $theme_settings = variable_get('theme_settings', array());
-  foreach ($theme_settings as $setting => $value) {
-    if (substr($setting, 0, 16) == 'toggle_node_info') {
-      unset($theme_settings[$setting]);
-    }
-  }
-  variable_set('theme_settings', $theme_settings);
-}
-
-/**
- * Shorten the {system}.type column and modify indexes.
- */
-function system_update_7018() {
-  db_drop_index('system', 'modules');
-  db_drop_index('system', 'type_name');
-  db_change_field('system', 'type', 'type', array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''));
-  db_add_index('system', 'type_name', array('type', 'name'));
-}
-
-/**
- * Enable field module.
- */
-function system_update_7020() {
-  $module_list = array('field_sql_storage', 'field');
-  module_enable($module_list, FALSE);
-}
-
-/**
- * Change the PHP for settings permission.
- */
-function system_update_7021() {
-  db_update('role_permission')
-    ->fields(array('permission' => 'use PHP for settings'))
-    ->condition('permission', 'use PHP for block visibility')
-    ->execute();
-}
-
-/**
- * Add the substr_index() function to PostgreSQL.
- *
- * Note: this should go into the driver itself, but we have no support
- * for driver-specific updates yet.
- */
-function system_update_7024() {
-  if (db_driver() == 'pgsql') {
-    db_query('CREATE OR REPLACE FUNCTION "substring_index"(text, text, integer) RETURNS text AS
-      \'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\'
-      LANGUAGE \'sql\''
-    );
-  }
-}
-
-/**
- * Enable field type modules.
- */
-function system_update_7027() {
-  $module_list = array('text', 'number', 'list', 'options');
-  module_enable($module_list, FALSE);
-}
-
-// system_update_7028() moved to taxonomy_update_7001().
-
-/**
- * Add new 'view own unpublished content' permission for authenticated users.
- * Preserves legacy behavior from Drupal 6.x.
- */
-function system_update_7029() {
-  db_insert('role_permission')
-    ->fields(array(
-      'rid' => DRUPAL_AUTHENTICATED_RID,
-      'permission' => 'view own unpublished content',
-    ))
-    ->execute();
-}
-
-/**
- * Moved to comment_update_7011().
- */
-function system_update_7030() {
-}
-
-/**
- * Removed in favour of Drupal 6 backport.
- *
- * @see system_update_6052()
- */
-function system_update_7031() {
-}
-
-/**
-* Alter field hostname to identifier in the {flood} table.
- */
-function system_update_7032() {
-  db_drop_index('flood', 'allow');
-  db_change_field('flood', 'hostname', 'identifier', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
-  db_add_index('flood', 'allow', array('event', 'identifier', 'timestamp'));
-}
-
-/**
- * Move CACHE_AGGRESSIVE to CACHE_NORMAL.
- */
-function system_update_7033() {
-  if (variable_get('cache') == 2) {
-    variable_set('cache', CACHE_NORMAL);
-    return t('Aggressive caching was disabled and replaced with normal caching. Read the page caching section in default.settings.php for more information on how to enable similar functionality.');
-  }
-}
-
-/**
- * Migrate the file_downloads setting and create the new {file_managed} table.
- */
-function system_update_7034() {
-  $files_directory = variable_get('file_directory_path', NULL);
-  if (variable_get('file_downloads', 1) == 1) {
-    // Our default is public, so we don't need to set anything.
-    if (!empty($files_directory)) {
-      variable_set('file_public_path', $files_directory);
-    }
-  }
-  elseif (variable_get('file_downloads', 1) == 2) {
-    variable_set('file_default_scheme', 'private');
-    if (!empty($files_directory)) {
-      variable_set('file_private_path', $files_directory);
-    }
-  }
-  variable_del('file_downloads');
-
-  $schema['file_managed'] = array(
-    'description' => 'Stores information for uploaded files.',
-    'fields' => array(
-      'fid' => array(
-        'description' => 'File ID.',
-        'type' => 'serial',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-      'uid' => array(
-        'description' => 'The {user}.uid of the user who is associated with the file.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'filename' => array(
-        'description' => 'Name of the file with no path components. This may differ from the basename of the filepath if the file is renamed to avoid overwriting an existing file.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'uri' => array(
-        'description' => 'URI of file.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'filemime' => array(
-        'description' => "The file's MIME type.",
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'filesize' => array(
-        'description' => 'The size of the file in bytes.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'status' => array(
-        'description' => 'A bitmapped field indicating the status of the file the least sigifigant bit indicates temporary (1) or permanent (0). Temporary files older than DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed during a cron run.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'timestamp' => array(
-        'description' => 'UNIX timestamp for when the file was added.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-    ),
-    'indexes' => array(
-      'uid' => array('uid'),
-      'status' => array('status'),
-      'timestamp' => array('timestamp'),
-    ),
-    'unique keys' => array(
-      'uri' => array('uri'),
-    ),
-    'primary key' => array('fid'),
-  );
-
-  db_create_table('file_managed', $schema['file_managed']);
-}
-
-/**
- * Migrate upload module files to the new {file_managed} table.
- */
-function system_update_7035() {
-  if (!db_table_exists('upload')) {
-    return;
-  }
-
-  // The old {files} tables still exists.  We migrate core data from upload
-  // module, but any contrib module using it will need to do its own update.
-  $result = db_query('SELECT f.fid, uid, filename, filepath AS uri, filemime, filesize, status, timestamp FROM {files} f INNER JOIN {upload} u ON u.fid = f.fid', array(), array('fetch' => PDO::FETCH_ASSOC));
-
-  // We will convert filepaths to uri using the default schmeme
-  // and stripping off the existing file directory path.
-  $basename = variable_get('file_directory_path', conf_path() . '/files');
-  $scheme = variable_get('file_default_scheme', 'public') . '://';
-  $fids = array();
-  // TODO: does this function need to run in batch mode, or should we use a multi-insert?
-  foreach ($result as $file) {
-    $file['uri'] = $scheme . str_replace($basename, '', $file['uri']);
-    $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
-    db_insert('file_managed')->fields($file)->execute();
-    $fids[] = $file['fid'];
-  }
-  // TODO: delete the found fids from {files}?
-}
-
-/**
- * Split the 'access site in maintenance mode' permission from 'administer site configuration'.
- */
-function system_update_7036() {
-  // Get existing roles that can 'administer site configuration'.
-  $rids = db_query("SELECT rid FROM {role_permission} WHERE permission = :perm", array(':perm' => 'administer site configuration'))->fetchCol();
-  // None found.
-  if (empty($rids)) {
-    return;
-  }
-  $insert = db_insert('role_permission')->fields(array('rid', 'permission'));
-  foreach ($rids as $rid) {
-    $insert->values(array(
-      'rid' => $rid,
-      'permission' => 'access site in maintenance mode',
-    ));
-  }
-  $insert->execute();
-
-  // Remove obsolete variable 'site_offline_message'. See
-  // update_fix_d7_requirements().
-  variable_del('site_offline_message');
-}
-
-/**
- * Rename action description to label.
- */
-function system_update_7037() {
-  db_change_field('actions', 'description', 'label', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'));
-}
-
-/**
- * Adds fields to the {menu_router} table to allow custom themes to be set per
- * page.
- */
-function system_update_7039() {
-  // Moved to update_fix_d7_requirements().
-}
-
-/**
- * Create new date format tables.
- */
-function system_update_7040() {
-  // Moved to update_fix_d7_requirements().
-}
-
-/**
- * Adds 'delivery_callback' field to the {menu_router} table to allow a custom
- * function to be used for final page rendering and sending to browser.
- */
-function system_update_7041() {
-  // Moved to update_fix_d7_requirements().
-}
-
-/**
- * Upgrade the {url_alias} table and create a cache bin for path aliases.
- */
-function system_update_7042() {
-  // update_fix_d7_requirements() adds 'fake' source and alias columns to
-  // allow bootstrap to run without fatal errors. Remove those columns now
-  // so that we can rename properly.
-  db_drop_field('url_alias', 'source');
-  db_drop_field('url_alias', 'alias');
-
-  // Drop indexes.
-  db_drop_index('url_alias', 'src_language_pid');
-  db_drop_unique_key('url_alias', 'dst_language_pid');
-  // Rename the fields, and increase their length to 255 characters.
-  db_change_field('url_alias', 'src', 'source', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
-  db_change_field('url_alias', 'dst', 'alias', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
-  // Add indexes back.
-  db_add_index('url_alias', 'source_language_pid', array('source', 'language', 'pid'));
-  db_add_unique_key('url_alias', 'alias_language_pid', array('alias', 'language', 'pid'));
-}
-
-/**
- * Add a 'context' field to {menu_router} to control contextual placement of local tasks.
- */
-function system_update_7043() {
-  // Moved to update_fix_d7_requirements().
-}
-
-/**
- * Drop the actions_aid table.
- */
-function system_update_7044() {
-  // The current value of the increment has been taken into account when
-  // creating the sequences table in update_fix_d7_requirements().
-  db_drop_table('actions_aid');
-}
-
-/**
- * Add expiration field to the {flood} table.
- */
-function system_update_7045() {
-  db_add_field('flood', 'expiration', array('description' => 'Expiration timestamp. Expired events are purged on cron run.', 'type' => 'int', 'not null' => TRUE, 'default' => 0));
-  db_add_index('flood', 'purge', array('expiration'));
-}
-
-/**
- * Switch from the Minnelli theme if it is the default or admin theme.
- */
-function system_update_7046() {
-  if (variable_get('theme_default') == 'minnelli' || variable_get('admin_theme') == 'minnelli') {
-    // Make sure Garland is enabled.
-    db_update('system')
-      ->fields(array('status' => 1))
-      ->condition('type', 'theme')
-      ->condition('name', 'garland')
-      ->execute();
-    if (variable_get('theme_default') != 'garland') {
-      // If the default theme isn't Garland, transfer all of Minnelli's old
-      // settings to Garland.
-      $settings = variable_get('theme_minnelli_settings', array());
-      // Set the theme setting width to "fixed" to match Minnelli's old layout.
-      $settings['garland_width'] = 'fixed';
-      variable_set('theme_garland_settings', $settings);
-      // Remove Garland's color files since they won't match Minnelli's.
-      foreach (variable_get('color_garland_files', array()) as $file) {
-        @unlink($file);
-      }
-      if (isset($file) && $file = dirname($file)) {
-        @rmdir($file);
-      }
-      variable_del('color_garland_palette');
-      variable_del('color_garland_stylesheets');
-      variable_del('color_garland_logo');
-      variable_del('color_garland_files');
-      variable_del('color_garland_screenshot');
-    }
-    if (variable_get('theme_default') == 'minnelli') {
-      variable_set('theme_default', 'garland');
-    }
-    if (variable_get('admin_theme') == 'minnelli') {
-      variable_set('admin_theme', 'garland');
-    }
-  }
-}
-
-/**
- * Normalize the front page path variable.
- */
-function system_update_7047() {
-  variable_set('site_frontpage', drupal_get_normal_path(variable_get('site_frontpage', 'node')));
-}
-
-/**
- * Convert path languages from the empty string to LANGUAGE_NONE.
- */
-function system_update_7048() {
-  db_update('url_alias')
-    ->fields(array('language' => LANGUAGE_NONE))
-    ->condition('language', '')
-    ->execute();
-}
-
-/**
- * Rename 'Default' profile to 'Standard.'
- */
-function system_update_7049() {
-  if (variable_get('install_profile', 'standard') == 'default') {
-    variable_set('install_profile', 'standard');
-  }
-}
-
-/**
- * Change {batch}.id column from serial to regular int.
- */
-function system_update_7050() {
-  db_change_field('batch', 'bid', 'bid', array('description' => 'Primary Key: Unique batch ID.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE));
-}
-
-/**
- * make the IP field IPv6 compatible
- */
-function system_update_7051() {
-  db_change_field('blocked_ips', 'ip', 'ip', array('description' => 'IP address', 'type' => 'varchar', 'length' => 40, 'not null' => TRUE, 'default' => ''));
-}
-
-/**
- * Rename file to include_file in {menu_router} table.
- */
-function system_update_7052() {
-  db_change_field('menu_router', 'file', 'include_file', array('type' => 'text', 'size' => 'medium'));
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
diff --git modules/system/system.update.inc modules/system/system.update.inc
new file mode 100644
index 0000000..8e4894f
--- /dev/null
+++ modules/system/system.update.inc
@@ -0,0 +1,801 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the system module.
+ */
+
+// Updates for core.
+
+function system_update_last_removed() {
+  return 6055;
+}
+
+/**
+ * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Rename blog and forum permissions to be consistent with other content types.
+ */
+function system_update_7000() {
+  $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
+  foreach ($result as $role) {
+    $renamed_permission = preg_replace('/(?<=^|,\ )create\ blog\ entries(?=,|$)/', 'create blog content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ blog\ entries(?=,|$)/', 'edit own blog content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ blog\ entry(?=,|$)/', 'edit any blog content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ blog\ entries(?=,|$)/', 'delete own blog content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ blog\ entry(?=,|$)/', 'delete any blog content', $role->perm);
+
+    $renamed_permission = preg_replace('/(?<=^|,\ )create\ forum\ topics(?=,|$)/', 'create forum content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ forum\ topic(?=,|$)/', 'delete any forum content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ forum\ topics(?=,|$)/', 'delete own forum content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ forum\ topic(?=,|$)/', 'edit any forum content', $role->perm);
+    $renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ forum\ topics(?=,|$)/', 'edit own forum content', $role->perm);
+
+    if ($renamed_permission != $role->perm) {
+      db_update('permission')
+        ->fields(array('perm' => $renamed_permission))
+        ->condition('rid', $role->rid)
+        ->execute();
+    }
+  }
+}
+
+/**
+ * Generate a cron key and save it in the variables table.
+ */
+function system_update_7001() {
+  variable_set('cron_key', md5(mt_rand()));
+}
+
+/**
+ * Add a table to store blocked IP addresses.
+ */
+function system_update_7002() {
+  $schema['blocked_ips'] = array(
+    'description' => 'Stores blocked IP addresses.',
+    'fields' => array(
+      'iid' => array(
+        'description' => 'Primary Key: unique ID for IP addresses.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'ip' => array(
+        'description' => 'IP address',
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+    ),
+    'indexes' => array(
+      'blocked_ip' => array('ip'),
+    ),
+    'primary key' => array('iid'),
+  );
+
+  db_create_table('blocked_ips', $schema['blocked_ips']);
+}
+
+/**
+ * Update {blocked_ips} with valid IP addresses from {access}.
+ */
+function system_update_7003() {
+  $messages = array();
+  $type = 'host';
+  $result = db_query("SELECT mask FROM {access} WHERE status = :status AND type = :type", array(
+    ':status' => 0,
+    ':type' => $type,
+  ));
+  foreach ($result as $blocked) {
+    if (filter_var($blocked->mask, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) !== FALSE) {
+      db_insert('blocked_ips')
+        ->fields(array('ip' => $blocked->mask))
+        ->execute();
+    }
+    else {
+      $invalid_host = check_plain($blocked->mask);
+      $messages[] = t('The host !host is no longer blocked because it is not a valid IP address.', array('!host' => $invalid_host ));
+    }
+  }
+  if (isset($invalid_host)) {
+    drupal_set_message('Drupal no longer supports wildcard IP address blocking. Visitors whose IP addresses match ranges you have previously set using <em>access rules</em> will no longer be blocked from your site when you put the site online. See the <a href="http://drupal.org/node/24302">IP address and referrer blocking Handbook page</a> for alternative methods.', 'warning');
+  }
+  // Make sure not to block any IP addresses that were specifically allowed by access rules.
+  if (!empty($result)) {
+    $result = db_query("SELECT mask FROM {access} WHERE status = :status AND type = :type", array(
+      ':status' => 1,
+      ':type' => $type,
+    ));
+    $or = db_condition('or');
+    foreach ($result as $allowed) {
+      $or->condition('ip', $allowed->mask, 'LIKE');
+    }
+    if (count($or)) {
+      db_delete('blocked_ips')
+        ->condition($or)
+        ->execute();
+    }
+  }
+}
+
+/**
+ * Remove hardcoded numeric deltas from all blocks in core.
+ */
+function system_update_7004(&$sandbox) {
+  // Get an array of the renamed block deltas, organized by module.
+  $renamed_deltas = array(
+    'blog' => array('0' => 'recent'),
+    'book' => array('0' => 'navigation'),
+    'comment' => array('0' => 'recent'),
+    'forum' => array(
+      '0' => 'active',
+      '1' => 'new',
+    ),
+    'locale' => array('0' => 'language-switcher'),
+    'node' => array('0' => 'syndicate'),
+    'poll' => array('0' => 'recent'),
+    'profile' => array('0' => 'author-information'),
+    'search' => array('0' => 'form'),
+    'statistics' => array('0' => 'popular'),
+    'system' => array('0' => 'powered-by'),
+    'user' => array(
+      '0' => 'login',
+      '1' => 'navigation',
+      '2' => 'new',
+      '3' => 'online',
+    ),
+  );
+
+  // Only run this the first time through the batch update.
+  if (!isset($sandbox['progress'])) {
+    // Rename forum module's block variables.
+    $forum_block_num_0 = variable_get('forum_block_num_0');
+    if (isset($forum_block_num_0)) {
+      variable_set('forum_block_num_active', $forum_block_num_0);
+      variable_del('forum_block_num_0');
+    }
+    $forum_block_num_1 = variable_get('forum_block_num_1');
+    if (isset($forum_block_num_1)) {
+      variable_set('forum_block_num_new', $forum_block_num_1);
+      variable_del('forum_block_num_1');
+    }
+  }
+
+  update_fix_d7_block_deltas($sandbox, $renamed_deltas);
+
+}
+
+/**
+ * Remove throttle columns and variables.
+ */
+function system_update_7005() {
+  db_drop_field('blocks', 'throttle');
+  db_drop_field('system', 'throttle');
+  variable_del('throttle_user');
+  variable_del('throttle_anonymous');
+  variable_del('throttle_level');
+  variable_del('throttle_probability_limiter');
+}
+
+/**
+ * Registry tables and drop the file key of the menu router, since it is no
+ * longer needed.
+ */
+function system_update_7006() {
+  // Update moved to update_fix_d7_requirements().
+}
+
+/**
+ * Convert to new method of storing permissions.
+ *
+ * This update is in system.install rather than user.install so that
+ * all modules can use the updated permission scheme during their updates.
+ */
+function system_update_7007() {
+  // Copy the permissions from the old {permission} table to the new {role_permission} table.
+  $messages = array();
+  $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid ASC");
+  $query = db_insert('role_permission')->fields(array('rid', 'permission'));
+  foreach ($result as $role) {
+    foreach (explode(', ', $role->perm) as $perm) {
+      $query->values(array(
+        'rid' => $role->rid,
+        'permission' => $perm,
+      ));
+    }
+    $messages[] = t('Inserted into {role_permission} the permissions for role ID !id', array('!id' => $role->rid));
+  }
+  $query->execute();
+  db_drop_table('permission');
+
+  return implode(', ', $messages);
+}
+
+/**
+ * Use the poll_choice primary key to record votes in poll_votes rather than
+ * the choice order. Rename chorder to weight.
+ */
+function system_update_7008() {
+  if (db_table_exists('poll_votes')) {
+    // Add chid column and convert existing votes.
+    db_add_field('poll_votes', 'chid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+    db_add_index('poll_votes', 'chid', array('chid'));
+    db_query("UPDATE {poll_votes} SET chid = (SELECT chid FROM {poll_choices} c WHERE {poll_votes}.chorder = c.chorder AND {poll_votes}.nid = c.nid)");
+    // Remove old chorder column.
+    db_drop_field('poll_votes', 'chorder');
+  }
+  if (db_table_exists('poll_choices')) {
+    // Change the chorder column to weight in poll_choices.
+    db_change_field('poll_choices', 'chorder', 'weight', array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'));
+  }
+}
+
+/**
+ * Rename the variables for primary and secondary links.
+ *
+ */
+function system_update_7009() {
+  db_update('variable')
+    ->fields(array('name' => 'main_menu_links_source'))
+    ->condition('name', 'menu_primary_links_source')
+    ->execute();
+}
+
+/**
+ * Moved to system_update_6048().
+ */
+function system_update_7010() {
+  return '';
+}
+
+/**
+ * Split the 'bypass node access' permission from 'administer nodes'.
+ */
+function system_update_7011() {
+  // Get existing roles that can 'administer nodes'.
+  $rids = array();
+  $rids = db_query("SELECT rid FROM {role_permission} WHERE permission = :perm", array(':perm' => 'administer nodes'))->fetchCol();
+  // None found.
+  if (empty($rids)) {
+    return;
+  }
+  $insert = db_insert('role_permission')->fields(array('rid', 'permission'));
+  foreach ($rids as $rid) {
+    $insert->values(array(
+    'rid' => $rid,
+    'permission' => 'bypass node access',
+    ));
+  }
+  $insert->execute();
+}
+
+// system_update_7012() moved to block_update_7002().
+
+/**
+ * Convert default time zone offset to default time zone name.
+ */
+function system_update_7013() {
+  $timezone = NULL;
+  $timezones = system_time_zones();
+  // If the contributed Date module set a default time zone name, use this
+  // setting as the default time zone.
+  if (($timezone_name = variable_get('date_default_timezone_name')) && isset($timezones[$timezone_name])) {
+    $timezone = $timezone_name;
+  }
+  // If the contributed Event module has set a default site time zone, look up
+  // the time zone name and use it as the default time zone.
+  if (!$timezone && ($timezone_id = variable_get('date_default_timezone_id', 0))) {
+    try {
+      $timezone_name = db_query('SELECT name FROM {event_timezones} WHERE timezone = :timezone_id', array(':timezone_id' => $timezone_id))->fetchField();
+      if (($timezone_name = str_replace(' ', '_', $timezone_name)) && isset($timezones[$timezone_name])) {
+        $timezone = $timezone_name;
+      }
+    }
+    catch (PDOException $e) {
+      // Ignore error if event_timezones table does not exist or unexpected
+      // schema found.
+    }
+  }
+  // If the previous default time zone was a non-zero offset, guess the site's
+  // intended time zone based on that offset and the server's daylight saving
+  // time status.
+  if (!$timezone && ($offset = variable_get('date_default_timezone', 0)) && ($timezone_name = timezone_name_from_abbr('', intval($offset), date('I'))) && isset($timezones[$timezone_name])) {
+    $timezone = $timezone_name;
+  }
+  // Otherwise, the default time zone offset was zero, which is UTC.
+  if (!$timezone) {
+    $timezone = 'UTC';
+  }
+  variable_set('date_default_timezone', $timezone);
+  drupal_set_message('The default time zone has been set to <em>' . check_plain($timezone) . '</em>. Check the ' . l('date and time configuration page', 'admin/config/regional/settings') . ' to configure it correctly.', 'warning');
+}
+
+/**
+ * Drop the bootstrap column from the {system} table. This was reverted.
+ */
+function system_update_7014() {
+}
+
+/**
+ * Change the user logout path.
+ */
+function system_update_7015() {
+  db_update('menu_links')
+    ->fields(array('link_path' => 'user/logout'))
+    ->condition('link_path', 'logout')
+    ->execute();
+
+ db_update('menu_links')
+    ->fields(array('router_path' => 'user/logout'))
+    ->condition('router_path', 'logout')
+    ->execute();
+}
+
+/**
+ * Remove custom datatype *_unsigned in PostgreSQL.
+ */
+function system_update_7016() {
+  // Only run these queries if the driver used is pgsql.
+  if (db_driver() == 'pgsql') {
+    $result = db_query("SELECT c.relname AS table, a.attname AS field,
+                        pg_catalog.format_type(a.atttypid, a.atttypmod) AS type
+                        FROM pg_catalog.pg_attribute a
+                        LEFT JOIN pg_class c ON (c.oid =  a.attrelid)
+                        WHERE pg_catalog.pg_table_is_visible(c.oid) AND c.relkind = 'r'
+                        AND pg_catalog.format_type(a.atttypid, a.atttypmod) LIKE '%unsigned%'");
+    foreach ($result as $row) {
+      switch ($row->type) {
+        case 'smallint_unsigned':
+          $datatype = 'int';
+          break;
+        case 'int_unsigned':
+        case 'bigint_unsigned':
+        default:
+          $datatype = 'bigint';
+          break;
+      }
+      db_query('ALTER TABLE ' . $row->table . ' ALTER COLUMN ' . $row->field . ' TYPE ' . $datatype);
+      db_query('ALTER TABLE ' . $row->table . ' ADD CHECK (' . $row->field . ' >= 0)');
+    }
+    db_query('DROP DOMAIN smallint_unsigned');
+    db_query('DROP DOMAIN int_unsigned');
+    db_query('DROP DOMAIN bigint_unsigned');
+  }
+}
+
+/**
+ * Change the theme setting 'toggle_node_info' into a per content type variable.
+ */
+function system_update_7017() {
+  $types = node_type_get_types();
+  if (count($types)) {
+    foreach ($types as $type) {
+      $node_info = theme_get_setting('toggle_node_info_' . $type->type);
+      if ($node_info !== NULL) {
+        variable_set('node_submitted_' . $type->type, $node_info);
+      }
+    }
+  }
+
+  // Unset deprecated 'toggle_node_info' theme settings.
+  $theme_settings = variable_get('theme_settings', array());
+  foreach ($theme_settings as $setting => $value) {
+    if (substr($setting, 0, 16) == 'toggle_node_info') {
+      unset($theme_settings[$setting]);
+    }
+  }
+  variable_set('theme_settings', $theme_settings);
+}
+
+/**
+ * Shorten the {system}.type column and modify indexes.
+ */
+function system_update_7018() {
+  db_drop_index('system', 'modules');
+  db_drop_index('system', 'type_name');
+  db_change_field('system', 'type', 'type', array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''));
+  db_add_index('system', 'type_name', array('type', 'name'));
+}
+
+/**
+ * Enable field module.
+ */
+function system_update_7020() {
+  $module_list = array('field_sql_storage', 'field');
+  module_enable($module_list, FALSE);
+}
+
+/**
+ * Change the PHP for settings permission.
+ */
+function system_update_7021() {
+  db_update('role_permission')
+    ->fields(array('permission' => 'use PHP for settings'))
+    ->condition('permission', 'use PHP for block visibility')
+    ->execute();
+}
+
+/**
+ * Add the substr_index() function to PostgreSQL.
+ *
+ * Note: this should go into the driver itself, but we have no support
+ * for driver-specific updates yet.
+ */
+function system_update_7024() {
+  if (db_driver() == 'pgsql') {
+    db_query('CREATE OR REPLACE FUNCTION "substring_index"(text, text, integer) RETURNS text AS
+      \'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\'
+      LANGUAGE \'sql\''
+    );
+  }
+}
+
+/**
+ * Enable field type modules.
+ */
+function system_update_7027() {
+  $module_list = array('text', 'number', 'list', 'options');
+  module_enable($module_list, FALSE);
+}
+
+// system_update_7028() moved to taxonomy_update_7001().
+
+/**
+ * Add new 'view own unpublished content' permission for authenticated users.
+ * Preserves legacy behavior from Drupal 6.x.
+ */
+function system_update_7029() {
+  db_insert('role_permission')
+    ->fields(array(
+      'rid' => DRUPAL_AUTHENTICATED_RID,
+      'permission' => 'view own unpublished content',
+    ))
+    ->execute();
+}
+
+/**
+ * Moved to comment_update_7011().
+ */
+function system_update_7030() {
+}
+
+/**
+ * Removed in favour of Drupal 6 backport.
+ *
+ * @see system_update_6052()
+ */
+function system_update_7031() {
+}
+
+/**
+* Alter field hostname to identifier in the {flood} table.
+ */
+function system_update_7032() {
+  db_drop_index('flood', 'allow');
+  db_change_field('flood', 'hostname', 'identifier', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
+  db_add_index('flood', 'allow', array('event', 'identifier', 'timestamp'));
+}
+
+/**
+ * Move CACHE_AGGRESSIVE to CACHE_NORMAL.
+ */
+function system_update_7033() {
+  if (variable_get('cache') == 2) {
+    variable_set('cache', CACHE_NORMAL);
+    return t('Aggressive caching was disabled and replaced with normal caching. Read the page caching section in default.settings.php for more information on how to enable similar functionality.');
+  }
+}
+
+/**
+ * Migrate the file_downloads setting and create the new {file_managed} table.
+ */
+function system_update_7034() {
+  $files_directory = variable_get('file_directory_path', NULL);
+  if (variable_get('file_downloads', 1) == 1) {
+    // Our default is public, so we don't need to set anything.
+    if (!empty($files_directory)) {
+      variable_set('file_public_path', $files_directory);
+    }
+  }
+  elseif (variable_get('file_downloads', 1) == 2) {
+    variable_set('file_default_scheme', 'private');
+    if (!empty($files_directory)) {
+      variable_set('file_private_path', $files_directory);
+    }
+  }
+  variable_del('file_downloads');
+
+  $schema['file_managed'] = array(
+    'description' => 'Stores information for uploaded files.',
+    'fields' => array(
+      'fid' => array(
+        'description' => 'File ID.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'uid' => array(
+        'description' => 'The {user}.uid of the user who is associated with the file.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'filename' => array(
+        'description' => 'Name of the file with no path components. This may differ from the basename of the filepath if the file is renamed to avoid overwriting an existing file.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'uri' => array(
+        'description' => 'URI of file.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'filemime' => array(
+        'description' => "The file's MIME type.",
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'filesize' => array(
+        'description' => 'The size of the file in bytes.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'status' => array(
+        'description' => 'A bitmapped field indicating the status of the file the least sigifigant bit indicates temporary (1) or permanent (0). Temporary files older than DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed during a cron run.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'timestamp' => array(
+        'description' => 'UNIX timestamp for when the file was added.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'indexes' => array(
+      'uid' => array('uid'),
+      'status' => array('status'),
+      'timestamp' => array('timestamp'),
+    ),
+    'unique keys' => array(
+      'uri' => array('uri'),
+    ),
+    'primary key' => array('fid'),
+  );
+
+  db_create_table('file_managed', $schema['file_managed']);
+}
+
+/**
+ * Migrate upload module files to the new {file_managed} table.
+ */
+function system_update_7035() {
+  if (!db_table_exists('upload')) {
+    return;
+  }
+
+  // The old {files} tables still exists.  We migrate core data from upload
+  // module, but any contrib module using it will need to do its own update.
+  $result = db_query('SELECT f.fid, uid, filename, filepath AS uri, filemime, filesize, status, timestamp FROM {files} f INNER JOIN {upload} u ON u.fid = f.fid', array(), array('fetch' => PDO::FETCH_ASSOC));
+
+  // We will convert filepaths to uri using the default schmeme
+  // and stripping off the existing file directory path.
+  $basename = variable_get('file_directory_path', conf_path() . '/files');
+  $scheme = variable_get('file_default_scheme', 'public') . '://';
+  $fids = array();
+  // TODO: does this function need to run in batch mode, or should we use a multi-insert?
+  foreach ($result as $file) {
+    $file['uri'] = $scheme . str_replace($basename, '', $file['uri']);
+    $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
+    db_insert('file_managed')->fields($file)->execute();
+    $fids[] = $file['fid'];
+  }
+  // TODO: delete the found fids from {files}?
+}
+
+/**
+ * Split the 'access site in maintenance mode' permission from 'administer site configuration'.
+ */
+function system_update_7036() {
+  // Get existing roles that can 'administer site configuration'.
+  $rids = db_query("SELECT rid FROM {role_permission} WHERE permission = :perm", array(':perm' => 'administer site configuration'))->fetchCol();
+  // None found.
+  if (empty($rids)) {
+    return;
+  }
+  $insert = db_insert('role_permission')->fields(array('rid', 'permission'));
+  foreach ($rids as $rid) {
+    $insert->values(array(
+      'rid' => $rid,
+      'permission' => 'access site in maintenance mode',
+    ));
+  }
+  $insert->execute();
+
+  // Remove obsolete variable 'site_offline_message'. See
+  // update_fix_d7_requirements().
+  variable_del('site_offline_message');
+}
+
+/**
+ * Rename action description to label.
+ */
+function system_update_7037() {
+  db_change_field('actions', 'description', 'label', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'));
+}
+
+/**
+ * Adds fields to the {menu_router} table to allow custom themes to be set per
+ * page.
+ */
+function system_update_7039() {
+  // Moved to update_fix_d7_requirements().
+}
+
+/**
+ * Create new date format tables.
+ */
+function system_update_7040() {
+  // Moved to update_fix_d7_requirements().
+}
+
+/**
+ * Adds 'delivery_callback' field to the {menu_router} table to allow a custom
+ * function to be used for final page rendering and sending to browser.
+ */
+function system_update_7041() {
+  // Moved to update_fix_d7_requirements().
+}
+
+/**
+ * Upgrade the {url_alias} table and create a cache bin for path aliases.
+ */
+function system_update_7042() {
+  // update_fix_d7_requirements() adds 'fake' source and alias columns to
+  // allow bootstrap to run without fatal errors. Remove those columns now
+  // so that we can rename properly.
+  db_drop_field('url_alias', 'source');
+  db_drop_field('url_alias', 'alias');
+
+  // Drop indexes.
+  db_drop_index('url_alias', 'src_language_pid');
+  db_drop_unique_key('url_alias', 'dst_language_pid');
+  // Rename the fields, and increase their length to 255 characters.
+  db_change_field('url_alias', 'src', 'source', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_field('url_alias', 'dst', 'alias', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  // Add indexes back.
+  db_add_index('url_alias', 'source_language_pid', array('source', 'language', 'pid'));
+  db_add_unique_key('url_alias', 'alias_language_pid', array('alias', 'language', 'pid'));
+}
+
+/**
+ * Add a 'context' field to {menu_router} to control contextual placement of local tasks.
+ */
+function system_update_7043() {
+  // Moved to update_fix_d7_requirements().
+}
+
+/**
+ * Drop the actions_aid table.
+ */
+function system_update_7044() {
+  // The current value of the increment has been taken into account when
+  // creating the sequences table in update_fix_d7_requirements().
+  db_drop_table('actions_aid');
+}
+
+/**
+ * Add expiration field to the {flood} table.
+ */
+function system_update_7045() {
+  db_add_field('flood', 'expiration', array('description' => 'Expiration timestamp. Expired events are purged on cron run.', 'type' => 'int', 'not null' => TRUE, 'default' => 0));
+  db_add_index('flood', 'purge', array('expiration'));
+}
+
+/**
+ * Switch from the Minnelli theme if it is the default or admin theme.
+ */
+function system_update_7046() {
+  if (variable_get('theme_default') == 'minnelli' || variable_get('admin_theme') == 'minnelli') {
+    // Make sure Garland is enabled.
+    db_update('system')
+      ->fields(array('status' => 1))
+      ->condition('type', 'theme')
+      ->condition('name', 'garland')
+      ->execute();
+    if (variable_get('theme_default') != 'garland') {
+      // If the default theme isn't Garland, transfer all of Minnelli's old
+      // settings to Garland.
+      $settings = variable_get('theme_minnelli_settings', array());
+      // Set the theme setting width to "fixed" to match Minnelli's old layout.
+      $settings['garland_width'] = 'fixed';
+      variable_set('theme_garland_settings', $settings);
+      // Remove Garland's color files since they won't match Minnelli's.
+      foreach (variable_get('color_garland_files', array()) as $file) {
+        @unlink($file);
+      }
+      if (isset($file) && $file = dirname($file)) {
+        @rmdir($file);
+      }
+      variable_del('color_garland_palette');
+      variable_del('color_garland_stylesheets');
+      variable_del('color_garland_logo');
+      variable_del('color_garland_files');
+      variable_del('color_garland_screenshot');
+    }
+    if (variable_get('theme_default') == 'minnelli') {
+      variable_set('theme_default', 'garland');
+    }
+    if (variable_get('admin_theme') == 'minnelli') {
+      variable_set('admin_theme', 'garland');
+    }
+  }
+}
+
+/**
+ * Normalize the front page path variable.
+ */
+function system_update_7047() {
+  variable_set('site_frontpage', drupal_get_normal_path(variable_get('site_frontpage', 'node')));
+}
+
+/**
+ * Convert path languages from the empty string to LANGUAGE_NONE.
+ */
+function system_update_7048() {
+  db_update('url_alias')
+    ->fields(array('language' => LANGUAGE_NONE))
+    ->condition('language', '')
+    ->execute();
+}
+
+/**
+ * Rename 'Default' profile to 'Standard.'
+ */
+function system_update_7049() {
+  if (variable_get('install_profile', 'standard') == 'default') {
+    variable_set('install_profile', 'standard');
+  }
+}
+
+/**
+ * Change {batch}.id column from serial to regular int.
+ */
+function system_update_7050() {
+  db_change_field('batch', 'bid', 'bid', array('description' => 'Primary Key: Unique batch ID.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE));
+}
+
+/**
+ * make the IP field IPv6 compatible
+ */
+function system_update_7051() {
+  db_change_field('blocked_ips', 'ip', 'ip', array('description' => 'IP address', 'type' => 'varchar', 'length' => 40, 'not null' => TRUE, 'default' => ''));
+}
+
+/**
+ * Rename file to include_file in {menu_router} table.
+ */
+function system_update_7052() {
+  db_change_field('menu_router', 'file', 'include_file', array('type' => 'text', 'size' => 'medium'));
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/taxonomy/taxonomy.install modules/taxonomy/taxonomy.install
index 62a2bc3..02a649b 100644
--- modules/taxonomy/taxonomy.install
+++ modules/taxonomy/taxonomy.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the taxonomy module.
+ * Update functions for the taxonomy module.
  */
 
 /**
@@ -208,296 +208,3 @@ function taxonomy_schema() {
 
   return $schema;
 }
-
-/**
- * Implements hook_update_dependencies().
- */
-function taxonomy_update_dependencies() {
-  // Taxonomy update 7002 creates comment Field API bundles and therefore must
-  // run after the Field module has been enabled, but before upgrading field
-  // data.
-  $dependencies['taxonomy'][7002] = array(
-    'system' => 7049,
-  );
-  $dependencies['user'][7006] = array(
-    'taxonomy' => 7002,
-  );
-  $dependencies['system'][7050] = array(
-    'taxonomy' => 7002,
-  );
-  // It also must run before nodes are upgraded to use the Field API.
-  $dependencies['node'][7006] = array(
-    'taxonomy' => 7002,
-  );
-
-  return $dependencies;
-}
-
-/**
- * Rename taxonomy tables.
- */
-function taxonomy_update_7001() {
-  db_rename_table('term_data', 'taxonomy_term_data');
-  db_rename_table('term_hierarchy', 'taxonomy_term_hierarchy');
-  db_rename_table('term_node', 'taxonomy_term_node');
-  db_rename_table('term_relation', 'taxonomy_term_relation');
-  db_rename_table('term_synonym', 'taxonomy_term_synonym');
-  db_rename_table('vocabulary', 'taxonomy_vocabulary');
-  db_rename_table('vocabulary_node_types', 'taxonomy_vocabulary_node_type');
-}
-
-/**
- * Add {vocabulary}.machine_name column.
- */
-function taxonomy_update_7002() {
-  $field = array(
-    'type' => 'varchar',
-    'length' => 255,
-    'not null' => TRUE,
-    'default' => '',
-    'description' => 'The vocabulary machine name.',
-  );
-
-  db_add_field('taxonomy_vocabulary', 'machine_name', $field);
-
-  foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
-    $machine_name = 'vocabulary_' . $vid;
-    db_update('taxonomy_vocabulary')
-      ->fields(array('machine_name' => $machine_name))
-      ->condition('vid', $vid)
-      ->execute();
-    field_attach_create_bundle('taxonomy_term', $machine_name);
-  }
-
-  // The machine_name unique key can only be added after we ensure the
-  // machine_name column contains unique values.
-  db_add_unique_key('taxonomy_vocabulary', 'machine_name', array('machine_name'));
-}
-
-/**
- * Remove the related terms setting from vocabularies.
- *
- * This setting has not been used since Drupal 6. The {taxonomy_relations} table
- * itself is retained to allow for data to be upgraded.
- */
-function taxonomy_update_7003() {
-  db_drop_field('taxonomy_vocabulary', 'relations');
-}
-
-/**
- * Move taxonomy vocabulary associations for nodes to fields and field instances.
- */
-function taxonomy_update_7004() {
-  $taxonomy_index = array(
-    'description' => 'Maintains denormalized information about node/term relationships.',
-    'fields' => array(
-      'nid' => array(
-        'description' => 'The {node}.nid this record tracks.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'tid' => array(
-         'description' => 'The term ID.',
-         'type' => 'int',
-         'unsigned' => TRUE,
-         'not null' => TRUE,
-         'default' => 0,
-      ),
-      'sticky' => array(
-        'description' => 'Boolean indicating whether the node is sticky.',
-        'type' => 'int',
-        'not null' => FALSE,
-        'default' => 0,
-        'size' => 'tiny',
-      ),
-      'created' => array(
-        'description' => 'The Unix timestamp when the node was created.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default'=> 0,
-      ),
-    ),
-    'indexes' => array(
-      'term_node' => array('tid', 'sticky', 'created'),
-      'nid' => array('nid'),
-    ),
-    'foreign keys' => array(
-      'node' => 'nid',
-      'taxonomy_term_data' => 'tid',
-    ),
-  );
-  db_create_table('taxonomy_index', $taxonomy_index);
-
-  // Use an inline version of Drupal 6 taxonomy_get_vocabularies() here since
-  // we can no longer rely on $vocabulary->nodes from the API function.
-  $result = db_query('SELECT v.*, n.type FROM {taxonomy_vocabulary} v LEFT JOIN {taxonomy_vocabulary_node_type} n ON v.vid = n.vid ORDER BY v.weight, v.name');
-  $vocabularies = array();
-  foreach ($result as $record) {
-    // If no node types are associated with a vocabulary, the LEFT JOIN will
-    // return a NULL value for type.
-    if (isset($record->type)) {
-      $node_types[$record->vid][$record->type] = $record->type;
-      unset($record->type);
-      $record->nodes = $node_types[$record->vid];
-    }
-    elseif (!isset($record->nodes)) {
-      $record->nodes = array();
-    }
-    $vocabularies[$record->vid] = $record;
-  }
-
-  foreach ($vocabularies as $vocabulary) {
-    $field_name = 'taxonomy_' . $vocabulary->machine_name;
-    $field = array(
-      'field_name' => $field_name,
-      'type' => 'taxonomy_term_reference',
-      'cardinality' => $vocabulary->multiple || $vocabulary->tags ? FIELD_CARDINALITY_UNLIMITED : 1,
-      'settings' => array(
-        'required' => $vocabulary->required ? TRUE : FALSE,
-        'allowed_values' => array(
-          array(
-            'vid' => $vocabulary->vid,
-            'parent' => 0,
-          ),
-        ),
-      ),
-    );
-    field_create_field($field);
-
-    foreach ($vocabulary->nodes as $bundle) {
-      $instance = array(
-        'label' => $vocabulary->name,
-        'field_name' => $field_name,
-        'bundle' => $bundle,
-        'entity_type' => 'node',
-        'description' => $vocabulary->help,
-        'widget' => array(
-          'type' => $vocabulary->tags ? 'taxonomy_autocomplete' : 'select',
-        ),
-      );
-      field_create_instance($instance);
-    }
-  }
-  db_drop_table('taxonomy_vocabulary_node_type');
-  $fields = array('help', 'multiple', 'required', 'tags');
-  foreach ($fields as $field) {
-    db_drop_field('taxonomy_vocabulary', $field);
-  }
-}
-
-/**
- * Migrate {taxonomy_term_node} table to field storage.
- */
-function taxonomy_update_7005(&$sandbox) {
-  // Since we are upgrading from Drupal 6, we know that only
-  // field_sql_storage.module will be enabled.
-  $field = field_info_field($field['field_name']);
-  $data_table = _field_sql_storage_tablename($field);
-  $revision_table = _field_sql_storage_revision_tablename($field);
-  $etid = _field_sql_storage_etid('node');
-  $value_column = $field['field_name'] . '_value';
-  $columns = array('etid', 'entity_id', 'revision_id', 'bundle', 'delta', $value_column);
-
-  // This is a multi-pass update. On the first call we need to initialize some
-  // variables.
-  if (!isset($sandbox['total'])) {
-    $sandbox['last'] = 0;
-    $sandbox['count'] = 0;
-
-    $query = db_select('taxonomy_term_node', 't');
-    $sandbox['total'] = $query->countQuery()->execute()->fetchField();
-    $found = (bool) $sandbox['total'];
-  }
-  else {
-    // We do each pass in batches of 1000, this should result in a
-    // maximum of 2000 insert queries each operation.
-    $batch = 1000 + $sandbox['last'];
-
-    // Query and save data for the current revision.
-    $result = db_query_range('SELECT td.tid, tn.nid, td.weight, tn.vid, n2.type, n2.created, n2.sticky FROM {taxonomy_term_data} td INNER JOIN {taxonomy_term_node} tn ON td.tid = tn.tid INNER JOIN {node} n2 ON tn.nid = n2.nid INNER JOIN {node} n ON tn.vid = n.vid AND td.vid = :vocabulary_id ORDER BY td.weight ASC', array(':vocabulary_id' => $vocabulary->vid), $sandbox['last'], $batch);
-    $deltas = array();
-    foreach ($result as $record) {
-      $found = TRUE;
-      $sandbox['count'] += 1;
-      // Start deltas from 0, and increment by one for each
-      // term attached to a node.
-      $deltas[$record->nid] = isset($deltas[$record->nid]) ? ++$deltas[$record->nid] : 0;
-      $values = array($etid, $record->nid, $record->vid, $record->type, $deltas[$record->nid], $record->tid);
-      db_insert($data_table)->fields($columns)->values($values)->execute();
-
-      // Update the {taxonomy_index} table.
-      db_insert('taxonomy_index')
-        ->fields(array('nid', 'tid', 'sticky', 'created',))
-        ->values(array($record->nid, $record->tid, $record->sticky, $record->created))
-        ->execute();
-    }
-
-    // Query and save data for all revisions.
-    $result = db_query('SELECT td.tid, tn.nid, td.weight, tn.vid, n.type FROM {taxonomy_term_data} td INNER JOIN {taxonomy_term_node} tn ON td.tid = tn.tid AND td.vid = :vocabulary_id INNER JOIN {node} n ON tn.nid = n.nid ORDER BY td.weight ASC', array(':vocabulary_id' => $vocabulary->vid), $sandbox['last'][$batch]);
-    $deltas = array();
-    foreach ($result as $record) {
-      $found = TRUE;
-      $sandbox['count'] += 1;
-      // Start deltas at 0, and increment by one for each term attached to a revision.
-      $deltas[$record->vid] = isset($deltas[$record->vid]) ? ++$deltas[$record->vid] : 0;
-      $values = array($etid, $record->nid, $record->vid, $record->type, $deltas[$record->vid], $record->tid);
-      db_insert($revision_table)->fields($columns)->values($values)->execute();
-    }
-    $sandbox['last'] = $batch;
-  }
-  if (!$found) {
-   db_drop_table('taxonomy_term_node');
-  }
-}
-
-/**
- * Add {taxonomy_term_data}.format column.
- */
-function taxonomy_update_7006() {
-  db_add_field('taxonomy_term_data', 'format', array(
-    'type' => 'int',
-    'size' => 'small',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'The {filter_format}.format of the description.',
-  ));
-}
-
-/**
- * Add index on {taxonomy_term_data}.name column to speed up taxonomy_get_term_by_name().
- */
-function taxonomy_update_7007() {
-  db_add_index('taxonomy_term_data', 'name', array('name'));
-}
-
-/**
- * Change the weight columns to normal int.
- */
-function taxonomy_update_7008() {
-  db_drop_index('taxonomy_term_data', 'taxonomy_tree');
-  db_change_field('taxonomy_term_data', 'weight', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'The weight of this term in relation to other terms.',
-  ), array(
-    'indexes' => array(
-       'taxonomy_tree' => array('vid', 'weight', 'name'),
-    ),
-  ));
-
-  db_drop_index('taxonomy_vocabulary', 'list');
-  db_change_field('taxonomy_vocabulary', 'weight', 'weight', array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => 'The weight of this vocabulary in relation to other vocabularies.',
-  ), array(
-    'indexes' => array(
-      'list' => array('weight', 'name'),
-    ),
-  ));
-}
diff --git modules/tracker/tracker.install modules/tracker/tracker.install
index cb17dc6..b9f9b4f 100644
--- modules/tracker/tracker.install
+++ modules/tracker/tracker.install
@@ -2,6 +2,11 @@
 // $Id: tracker.install,v 1.4 2010/03/20 15:06:51 dries Exp $
 
 /**
+ * @file
+ * Install and uninstall functions for the tracker module.
+ */
+
+/**
  * Implements hook_uninstall().
  */
 function tracker_uninstall() {
diff --git modules/tracker/tracker.update.inc modules/tracker/tracker.update.inc
new file mode 100644
index 0000000..5bc4a84
--- /dev/null
+++ modules/tracker/tracker.update.inc
@@ -0,0 +1,106 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the tracker module.
+ */
+
+/**
+ * @defgroup updates-6.x-to-7.x Tracker updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Create new tracker_node and tracker_user tables.
+ */
+function tracker_update_7000() {
+  $schema['tracker_node'] = array(
+    'description' => 'Tracks when nodes were last changed or commented on',
+    'fields' => array(
+      'nid' => array(
+        'description' => 'The {node}.nid this record tracks.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'published' => array(
+        'description' => 'Boolean indicating whether the node is published.',
+        'type' => 'int',
+        'not null' => FALSE,
+        'default' => 0,
+        'size' => 'tiny',
+      ),
+      'changed' => array(
+        'description' => 'The Unix timestamp when the node was most recently saved or commented on.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'indexes' => array(
+      'tracker' => array('published', 'changed'),
+    ),
+    'primary key' => array('nid'),
+    'foreign keys' => array(
+      'node' => 'nid',
+    ),
+  );
+
+  $schema['tracker_user'] = array(
+    'description' => 'Tracks when nodes were last changed or commented on, for each user that authored the node or one of its comments.',
+    'fields' => array(
+      'nid' => array(
+        'description' => 'The {node}.nid this record tracks.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'uid' => array(
+        'description' => 'The {users}.uid of the node author or commenter.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'published' => array(
+        'description' => 'Boolean indicating whether the node is published.',
+        'type' => 'int',
+        'not null' => FALSE,
+        'default' => 0,
+        'size' => 'tiny',
+      ),
+      'changed' => array(
+        'description' => 'The Unix timestamp when the node was most recently saved or commented on.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'indexes' => array(
+      'tracker' => array('uid', 'published', 'changed'),
+    ),
+    'primary key' => array('nid', 'uid'),
+    'foreign keys' => array(
+      'node' => 'nid',
+      'users' => 'uid',
+    ),
+  );
+
+  foreach ($schema as $name => $table) {
+    db_create_table($name, $table);
+  }
+
+  $max_nid = db_query('SELECT MAX(nid) FROM {node}')->fetchField();
+  if ($max_nid != 0) {
+    variable_set('tracker_index_nid', $max_nid);
+  }
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
diff --git modules/trigger/trigger.install modules/trigger/trigger.install
index 14a30bf..2cc1c26 100644
--- modules/trigger/trigger.install
+++ modules/trigger/trigger.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the trigger module.
+ * Install and uninstall functions for the trigger module.
  */
 
 /**
@@ -49,20 +49,3 @@ function trigger_install() {
   // Do initial synchronization of actions in code and the database.
   actions_synchronize();
 }
-
-/**
- * Adds operation names to the hook names and drops the "op" field.
- */
-function trigger_update_7000() {
-  $result = db_query("SELECT hook, op, aid FROM {trigger_assignments} WHERE op <> ''");
-
-  foreach ($result as $record) {
-    db_update('trigger_assignments')
-      ->fields(array('hook' => $record->hook . '_' . $record->op))
-      ->condition('hook', $record->hook)
-      ->condition('op', $record->op)
-      ->condition('aid', $record->aid)
-      ->execute();
-  }
-  db_drop_field('trigger_assignments', 'op');
-}
diff --git modules/trigger/trigger.update.inc modules/trigger/trigger.update.inc
new file mode 100644
index 0000000..978efc6
--- /dev/null
+++ modules/trigger/trigger.update.inc
@@ -0,0 +1,24 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the trigger module.
+ */
+
+/**
+ * Adds operation names to the hook names and drops the "op" field.
+ */
+function trigger_update_7000() {
+  $result = db_query("SELECT hook, op, aid FROM {trigger_assignments} WHERE op <> ''");
+
+  foreach ($result as $record) {
+    db_update('trigger_assignments')
+      ->fields(array('hook' => $record->hook . '_' . $record->op))
+      ->condition('hook', $record->hook)
+      ->condition('op', $record->op)
+      ->condition('aid', $record->aid)
+      ->execute();
+  }
+  db_drop_field('trigger_assignments', 'op');
+}
diff --git modules/update/update.install modules/update/update.install
index 50a68eb..3c97d13 100644
--- modules/update/update.install
+++ modules/update/update.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the update module.
+ * Install and uninstall functions for the update module.
  */
 
 /**
@@ -158,12 +158,3 @@ function _update_requirement_check($project, $type) {
   $requirement['value'] = l($requirement_label, update_manager_access() ? 'admin/reports/updates/update' : 'admin/reports/updates');
   return $requirement;
 }
-
-/**
- * Create a queue to store tasks for requests to fetch available update data.
- */
-function update_update_7000() {
-  module_load_include('inc', 'system', 'system.queue');
-  $queue = DrupalQueue::get('update_fetch_tasks');
-  $queue->createQueue();
-}
diff --git modules/update/update.update.inc modules/update/update.update.inc
new file mode 100644
index 0000000..eda0ded
--- /dev/null
+++ modules/update/update.update.inc
@@ -0,0 +1,16 @@
+<?php
+// $Id: update.install,v 1.16 2010/01/15 10:12:36 dries Exp $
+
+/**
+ * @file
+ * Update functions for the update module.
+ */
+
+/**
+ * Create a queue to store tasks for requests to fetch available update data.
+ */
+function update_update_7000() {
+  module_load_include('inc', 'system', 'system.queue');
+  $queue = DrupalQueue::get('update_fetch_tasks');
+  $queue->createQueue();
+}
diff --git modules/user/user.install modules/user/user.install
index f4866f7..c61adca 100644
--- modules/user/user.install
+++ modules/user/user.install
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Install, update and uninstall functions for the user module.
+ * Install and uninstall functions for the user module.
  */
 
 /**
@@ -312,284 +312,3 @@ function user_install() {
       ->execute();
   }
 }
-
-/**
- * @defgroup user-updates-6.x-to-7.x User updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Increase the length of the password field to accommodate better hashes.
- *
- * Also re-hashes all current passwords to improve security. This may be a
- * lengthy process, and is performed batch-wise.
- */
-function user_update_7000(&$sandbox) {
-  $sandbox['#finished'] = 0;
-  // Lower than DRUPAL_HASH_COUNT to make the update run at a reasonable speed.
-  $hash_count_log2 = 11;
-  // Multi-part update.
-  if (!isset($sandbox['user_from'])) {
-    db_change_field('users', 'pass', 'pass', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
-    $sandbox['user_from'] = 0;
-    $sandbox['user_count'] = db_query("SELECT COUNT(uid) FROM {users}")->fetchField();
-  }
-  else {
-    require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
-    //  Hash again all current hashed passwords.
-    $has_rows = FALSE;
-    // Update this many per page load.
-    $count = 1000;
-    $result = db_query_range("SELECT uid, pass FROM {users} WHERE uid > 0 ORDER BY uid", $sandbox['user_from'], $count);
-    foreach ($result as $account) {
-      $has_rows = TRUE;
-      $new_hash = user_hash_password($account->pass, $hash_count_log2);
-      if ($new_hash) {
-        // Indicate an updated password.
-        $new_hash  = 'U' . $new_hash;
-        db_update('users')
-          ->fields(array('pass' => $new_hash))
-          ->condition('uid', $account->uid)
-          ->execute();
-      }
-    }
-    $sandbox['#finished'] = $sandbox['user_from']/$sandbox['user_count'];
-    $sandbox['user_from'] += $count;
-    if (!$has_rows) {
-      $sandbox['#finished'] = 1;
-      return t('User passwords rehashed to improve security');
-    }
-  }
-}
-
-/**
- * Remove the 'threshold', 'mode' and 'sort' columns from the {users} table.
- *
- * These fields were previously used to store per-user comment settings.
- */
-
-function user_update_7001() {
-  db_drop_field('users', 'threshold');
-  db_drop_field('users', 'mode');
-  db_drop_field('users', 'sort');
-}
-
-/**
- * Convert user time zones from time zone offsets to time zone names.
- */
-function user_update_7002(&$sandbox) {
-  $sandbox['#finished'] = 0;
-
-  // Multi-part update.
-  if (!isset($sandbox['user_from'])) {
-    db_change_field('users', 'timezone', 'timezone', array('type' => 'varchar', 'length' => 32, 'not null' => FALSE));
-    $sandbox['user_from'] = 0;
-    $sandbox['user_count'] = db_query("SELECT COUNT(uid) FROM {users}")->fetchField();
-    $sandbox['user_not_migrated'] = 0;
-  }
-  else {
-    $timezones = system_time_zones();
-    // Update this many per page load.
-    $count = 10000;
-    $contributed_date_module = db_field_exists('users', 'timezone_name');
-    $contributed_event_module = db_field_exists('users', 'timezone_id');
-
-    $results = db_query_range("SELECT uid FROM {users} ORDER BY uid", $sandbox['user_from'], $count);
-    foreach ($results as $account) {
-      $timezone = NULL;
-      // If the contributed Date module has created a users.timezone_name
-      // column, use this data to set each user's time zone.
-      if ($contributed_date_module) {
-        $date_timezone = db_query("SELECT timezone_name FROM {users} WHERE uid = :uid", array(':uid' => $account->uid))->fetchField();
-        if (isset($timezones[$date_timezone])) {
-          $timezone = $date_timezone;
-        }
-      }
-      // If the contributed Event module has stored user time zone information
-      // use that information to update the user accounts.
-      if (!$timezone && $contributed_event_module) {
-        try {
-          $event_timezone = db_query("SELECT t.name FROM {users} u LEFT JOIN {event_timezones} t ON u.timezone_id = t.timezone WHERE u.uid = :uid", array(':uid' => $account->uid))->fetchField();
-          $event_timezone = str_replace(' ', '_', $event_timezone);
-          if (isset($timezones[$event_timezone])) {
-            $timezone = $event_timezone;
-          }
-        }
-        catch (PDOException $e) {
-          // Ignore error if event_timezones table does not exist or unexpected
-          // schema found.
-        }
-      }
-      if ($timezone) {
-        db_update('users')
-          ->fields(array('timezone' => $timezone))
-          ->condition('uid', $account->uid)
-          ->execute();
-      }
-      else {
-        $sandbox['user_not_migrated']++;
-        db_update('users')
-          ->fields(array('timezone' => NULL))
-          ->condition('uid', $account->uid)
-          ->execute();
-      }
-      $sandbox['user_from']++;
-    }
-
-    $sandbox['#finished'] = $sandbox['user_from'] / $sandbox['user_count'];
-    if ($sandbox['user_from'] == $sandbox['user_count']) {
-      if ($sandbox['user_not_migrated'] > 0) {
-        variable_set('empty_timezone_message', 1);
-        drupal_set_message('Some user time zones have been emptied and need to be set to the correct values. Use the new ' . l('time zone options', 'admin/config/regional/settings') . ' to choose whether to remind users at login to set the correct time zone.', 'warning');
-      }
-      return t('Migrated user time zones');
-    }
-  }
-}
-
-/**
- * Update user settings for cancelling user accounts.
- *
- * Prior to 7.x, users were not able to cancel their accounts. When
- * administrators deleted an account, all contents were assigned to uid 0,
- * which is the same as the 'user_cancel_reassign' method now.
- */
-function user_update_7003() {
-  // Set the default account cancellation method.
-  variable_set('user_cancel_method', 'user_cancel_reassign');
-  // Re-assign notification setting.
-  if ($setting = variable_get('user_mail_status_deleted_notify', FALSE)) {
-    variable_set('user_mail_status_canceled_notify', $setting);
-    variable_del('user_mail_status_deleted_notify');
-  }
-  // Re-assign "Account deleted" mail strings to "Account canceled" mail.
-  if ($setting = variable_get('user_mail_status_deleted_subject', FALSE)) {
-    variable_set('user_mail_status_canceled_subject', $setting);
-    variable_del('user_mail_status_deleted_subject');
-  }
-  if ($setting = variable_get('user_mail_status_deleted_body', FALSE)) {
-    variable_set('user_mail_status_canceled_body', $setting);
-    variable_del('user_mail_status_deleted_body');
-  }
-}
-
-/**
- * Add the user's pictures to the {file_managed} table and make them managed
- * files.
- */
-function user_update_7004(&$sandbox) {
-
-  $picture_field = array(
-    'type' => 'int',
-    'not null' => TRUE,
-    'default' => 0,
-    'description' => t("Foreign key: {file_managed}.fid of user's picture."),
-  );
-
-  if (!isset($sandbox['progress'])) {
-    // Check that the field hasn't been updated in an aborted run of this
-    // update.
-    if (!db_field_exists('users', 'picture_fid')) {
-      // Add a new field for the fid.
-      db_add_field('users', 'picture_fid', $picture_field);
-    }
-
-    // Initialize batch update information.
-    $sandbox['progress'] = 0;
-    $sandbox['last_user_processed'] = -1;
-    $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE picture <> ''")->fetchField();
-  }
-
-  // As a batch operation move the photos into the {file_managed} table and
-  // update the {users} records.
-  $limit = 500;
-  $result = db_query_range("SELECT uid, picture FROM {users} WHERE picture <> '' AND uid > :uid ORDER BY uid", 0, $limit, array(':uid' => $sandbox['last_user_processed']));
-  foreach ($result as $user) {
-    // Don't bother adding files that don't exist.
-    if (file_exists($user->picture)) {
-
-      // Check if the file already exists.
-      $files = file_load_multiple(array(), array('uri' => $user->picture));
-      if (count($files)) {
-        $file = reset($files);
-      }
-      else {
-        // Create a file object.
-        $file = new stdClass();
-        $file->uri      = $user->picture;
-        $file->filename = basename($file->uri);
-        $file->filemime = file_get_mimetype($file->uri);
-        $file->uid      = $user->uid;
-        $file->status   = FILE_STATUS_PERMANENT;
-        $file = file_save($file);
-      }
-
-      db_update('users')
-        ->fields(array('picture_fid' => $file->fid))
-        ->condition('uid', $user->uid)
-        ->execute();
-    }
-
-    // Update our progress information for the batch update.
-    $sandbox['progress']++;
-    $sandbox['last_user_processed'] = $user->uid;
-  }
-
-  // Indicate our current progress to the batch update system. If there's no
-  // max value then there's nothing to update and we're finished.
-  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
-
-  // When we're finished, drop the old picture field and rename the new one to
-  // replace it.
-  if (isset($sandbox['#finished']) && $sandbox['#finished'] == 1) {
-    db_drop_field('users', 'picture');
-    db_change_field('users', 'picture_fid', 'picture', $picture_field);
-  }
-}
-
-/**
- * Change the users table to allow longer email addresses - 254 characters instead of 64.
- */
-function user_update_7005(&$sandbox) {
-  $schema = user_schema();
-  db_change_field('users', 'mail', 'mail', $schema['users']['fields']['mail']);
-}
-
-/**
- * Add module data to {role_permission}.
- */
-function user_update_7006(&$sandbox) {
-  $module_field = array(
-    'type' => 'varchar',
-    'length' => 255,
-    'not null' => TRUE,
-    'default' => '',
-    'description' => "The module declaring the permission.",
-  );
-  // Check that the field hasn't been updated in an aborted run of this
-  // update.
-  if (!db_field_exists('role_permission', 'module')) {
-    // Add a new field for the fid.
-    db_add_field('role_permission', 'module', $module_field);
-  }
-  $permissions = user_permission_get_modules();
-  foreach ($permissions as $key => $value) {
-    db_update('role_permission')
-      ->fields(array('module' => $value))
-      ->condition('permission', $key)
-      ->execute();
-  }
-}
-
-/**
- * Add a weight column to user roles.
- */
-function user_update_7007() {
-  db_add_field('role', 'weight', array('type' => 'int', 'not null' => TRUE, 'default' => 0));
-  db_add_index('role', 'name_weight', array('name', 'weight'));
-}
-
-/**
- * @} End of "defgroup user-updates-6.x-to-7.x"
- * The next series of updates should start at 8000.
- */
diff --git modules/user/user.update.inc modules/user/user.update.inc
new file mode 100644
index 0000000..9294d4f
--- /dev/null
+++ modules/user/user.update.inc
@@ -0,0 +1,288 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Update functions for the user module.
+ */
+
+/**
+ * @defgroup user-updates-6.x-to-7.x User updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Increase the length of the password field to accommodate better hashes.
+ *
+ * Also re-hashes all current passwords to improve security. This may be a
+ * lengthy process, and is performed batch-wise.
+ */
+function user_update_7000(&$sandbox) {
+  $sandbox['#finished'] = 0;
+  // Lower than DRUPAL_HASH_COUNT to make the update run at a reasonable speed.
+  $hash_count_log2 = 11;
+  // Multi-part update.
+  if (!isset($sandbox['user_from'])) {
+    db_change_field('users', 'pass', 'pass', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
+    $sandbox['user_from'] = 0;
+    $sandbox['user_count'] = db_query("SELECT COUNT(uid) FROM {users}")->fetchField();
+  }
+  else {
+    require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
+    //  Hash again all current hashed passwords.
+    $has_rows = FALSE;
+    // Update this many per page load.
+    $count = 1000;
+    $result = db_query_range("SELECT uid, pass FROM {users} WHERE uid > 0 ORDER BY uid", $sandbox['user_from'], $count);
+    foreach ($result as $account) {
+      $has_rows = TRUE;
+      $new_hash = user_hash_password($account->pass, $hash_count_log2);
+      if ($new_hash) {
+        // Indicate an updated password.
+        $new_hash  = 'U' . $new_hash;
+        db_update('users')
+          ->fields(array('pass' => $new_hash))
+          ->condition('uid', $account->uid)
+          ->execute();
+      }
+    }
+    $sandbox['#finished'] = $sandbox['user_from']/$sandbox['user_count'];
+    $sandbox['user_from'] += $count;
+    if (!$has_rows) {
+      $sandbox['#finished'] = 1;
+      return t('User passwords rehashed to improve security');
+    }
+  }
+}
+
+/**
+ * Remove the 'threshold', 'mode' and 'sort' columns from the {users} table.
+ *
+ * These fields were previously used to store per-user comment settings.
+ */
+
+function user_update_7001() {
+  db_drop_field('users', 'threshold');
+  db_drop_field('users', 'mode');
+  db_drop_field('users', 'sort');
+}
+
+/**
+ * Convert user time zones from time zone offsets to time zone names.
+ */
+function user_update_7002(&$sandbox) {
+  $sandbox['#finished'] = 0;
+
+  // Multi-part update.
+  if (!isset($sandbox['user_from'])) {
+    db_change_field('users', 'timezone', 'timezone', array('type' => 'varchar', 'length' => 32, 'not null' => FALSE));
+    $sandbox['user_from'] = 0;
+    $sandbox['user_count'] = db_query("SELECT COUNT(uid) FROM {users}")->fetchField();
+    $sandbox['user_not_migrated'] = 0;
+  }
+  else {
+    $timezones = system_time_zones();
+    // Update this many per page load.
+    $count = 10000;
+    $contributed_date_module = db_field_exists('users', 'timezone_name');
+    $contributed_event_module = db_field_exists('users', 'timezone_id');
+
+    $results = db_query_range("SELECT uid FROM {users} ORDER BY uid", $sandbox['user_from'], $count);
+    foreach ($results as $account) {
+      $timezone = NULL;
+      // If the contributed Date module has created a users.timezone_name
+      // column, use this data to set each user's time zone.
+      if ($contributed_date_module) {
+        $date_timezone = db_query("SELECT timezone_name FROM {users} WHERE uid = :uid", array(':uid' => $account->uid))->fetchField();
+        if (isset($timezones[$date_timezone])) {
+          $timezone = $date_timezone;
+        }
+      }
+      // If the contributed Event module has stored user time zone information
+      // use that information to update the user accounts.
+      if (!$timezone && $contributed_event_module) {
+        try {
+          $event_timezone = db_query("SELECT t.name FROM {users} u LEFT JOIN {event_timezones} t ON u.timezone_id = t.timezone WHERE u.uid = :uid", array(':uid' => $account->uid))->fetchField();
+          $event_timezone = str_replace(' ', '_', $event_timezone);
+          if (isset($timezones[$event_timezone])) {
+            $timezone = $event_timezone;
+          }
+        }
+        catch (PDOException $e) {
+          // Ignore error if event_timezones table does not exist or unexpected
+          // schema found.
+        }
+      }
+      if ($timezone) {
+        db_update('users')
+          ->fields(array('timezone' => $timezone))
+          ->condition('uid', $account->uid)
+          ->execute();
+      }
+      else {
+        $sandbox['user_not_migrated']++;
+        db_update('users')
+          ->fields(array('timezone' => NULL))
+          ->condition('uid', $account->uid)
+          ->execute();
+      }
+      $sandbox['user_from']++;
+    }
+
+    $sandbox['#finished'] = $sandbox['user_from'] / $sandbox['user_count'];
+    if ($sandbox['user_from'] == $sandbox['user_count']) {
+      if ($sandbox['user_not_migrated'] > 0) {
+        variable_set('empty_timezone_message', 1);
+        drupal_set_message('Some user time zones have been emptied and need to be set to the correct values. Use the new ' . l('time zone options', 'admin/config/regional/settings') . ' to choose whether to remind users at login to set the correct time zone.', 'warning');
+      }
+      return t('Migrated user time zones');
+    }
+  }
+}
+
+/**
+ * Update user settings for cancelling user accounts.
+ *
+ * Prior to 7.x, users were not able to cancel their accounts. When
+ * administrators deleted an account, all contents were assigned to uid 0,
+ * which is the same as the 'user_cancel_reassign' method now.
+ */
+function user_update_7003() {
+  // Set the default account cancellation method.
+  variable_set('user_cancel_method', 'user_cancel_reassign');
+  // Re-assign notification setting.
+  if ($setting = variable_get('user_mail_status_deleted_notify', FALSE)) {
+    variable_set('user_mail_status_canceled_notify', $setting);
+    variable_del('user_mail_status_deleted_notify');
+  }
+  // Re-assign "Account deleted" mail strings to "Account canceled" mail.
+  if ($setting = variable_get('user_mail_status_deleted_subject', FALSE)) {
+    variable_set('user_mail_status_canceled_subject', $setting);
+    variable_del('user_mail_status_deleted_subject');
+  }
+  if ($setting = variable_get('user_mail_status_deleted_body', FALSE)) {
+    variable_set('user_mail_status_canceled_body', $setting);
+    variable_del('user_mail_status_deleted_body');
+  }
+}
+
+/**
+ * Add the user's pictures to the {file_managed} table and make them managed
+ * files.
+ */
+function user_update_7004(&$sandbox) {
+
+  $picture_field = array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+    'description' => t("Foreign key: {file_managed}.fid of user's picture."),
+  );
+
+  if (!isset($sandbox['progress'])) {
+    // Check that the field hasn't been updated in an aborted run of this
+    // update.
+    if (!db_field_exists('users', 'picture_fid')) {
+      // Add a new field for the fid.
+      db_add_field('users', 'picture_fid', $picture_field);
+    }
+
+    // Initialize batch update information.
+    $sandbox['progress'] = 0;
+    $sandbox['last_user_processed'] = -1;
+    $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE picture <> ''")->fetchField();
+  }
+
+  // As a batch operation move the photos into the {file_managed} table and
+  // update the {users} records.
+  $limit = 500;
+  $result = db_query_range("SELECT uid, picture FROM {users} WHERE picture <> '' AND uid > :uid ORDER BY uid", 0, $limit, array(':uid' => $sandbox['last_user_processed']));
+  foreach ($result as $user) {
+    // Don't bother adding files that don't exist.
+    if (file_exists($user->picture)) {
+
+      // Check if the file already exists.
+      $files = file_load_multiple(array(), array('uri' => $user->picture));
+      if (count($files)) {
+        $file = reset($files);
+      }
+      else {
+        // Create a file object.
+        $file = new stdClass();
+        $file->uri      = $user->picture;
+        $file->filename = basename($file->uri);
+        $file->filemime = file_get_mimetype($file->uri);
+        $file->uid      = $user->uid;
+        $file->status   = FILE_STATUS_PERMANENT;
+        $file = file_save($file);
+      }
+
+      db_update('users')
+        ->fields(array('picture_fid' => $file->fid))
+        ->condition('uid', $user->uid)
+        ->execute();
+    }
+
+    // Update our progress information for the batch update.
+    $sandbox['progress']++;
+    $sandbox['last_user_processed'] = $user->uid;
+  }
+
+  // Indicate our current progress to the batch update system. If there's no
+  // max value then there's nothing to update and we're finished.
+  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
+
+  // When we're finished, drop the old picture field and rename the new one to
+  // replace it.
+  if (isset($sandbox['#finished']) && $sandbox['#finished'] == 1) {
+    db_drop_field('users', 'picture');
+    db_change_field('users', 'picture_fid', 'picture', $picture_field);
+  }
+}
+
+/**
+ * Change the users table to allow longer email addresses - 254 characters instead of 64.
+ */
+function user_update_7005(&$sandbox) {
+  $schema = user_schema();
+  db_change_field('users', 'mail', 'mail', $schema['users']['fields']['mail']);
+}
+
+/**
+ * Add module data to {role_permission}.
+ */
+function user_update_7006(&$sandbox) {
+  $module_field = array(
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => TRUE,
+    'default' => '',
+    'description' => "The module declaring the permission.",
+  );
+  // Check that the field hasn't been updated in an aborted run of this
+  // update.
+  if (!db_field_exists('role_permission', 'module')) {
+    // Add a new field for the fid.
+    db_add_field('role_permission', 'module', $module_field);
+  }
+  $permissions = user_permission_get_modules();
+  foreach ($permissions as $key => $value) {
+    db_update('role_permission')
+      ->fields(array('module' => $value))
+      ->condition('permission', $key)
+      ->execute();
+  }
+}
+
+/**
+ * Add a weight column to user roles.
+ */
+function user_update_7007() {
+  db_add_field('role', 'weight', array('type' => 'int', 'not null' => TRUE, 'default' => 0));
+  db_add_index('role', 'name_weight', array('name', 'weight'));
+}
+
+/**
+ * @} End of "defgroup user-updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
