diff --git a/domain.admin.inc b/domain.admin.inc
index fb69145..c251356 100644
--- a/domain.admin.inc
+++ b/domain.admin.inc
@@ -16,9 +16,13 @@ function domain_overview_form($form, &$form_state) {
   if (empty($check)) {
     domain_set_primary_domain();
   }
+  // Check for the 7.x.3 update.
+  domain_check_for_update();
+  // Set the form.
   $default = domain_default();
   $active_domain = domain_get_domain();
   $form = array();
+
   $form['top'] = array(
     '#markup' => t('<p>The following domains have been created for your site.  The currently active domain <strong>is shown in boldface</strong>.  You
                     may click on a domain to change the currently active domain.  Your default domain is %name, which will be used for all requests that fail to resolve to a registered domain.</p>', array('%name' => $default['subdomain'])),
@@ -1145,3 +1149,51 @@ function theme_domain_overview_form($variables) {
   $output .= drupal_render_children($form);
   return $output;
 }
+
+/**
+ * Repairs and updates instances of domain_id 0 after the update to 7.x.3.
+ */
+function domain_repair_form($form, &$form_state) {
+  $list = domain_update_module_check();
+  if (empty($list)) {
+    $form['list'] = array(
+      '#markup' => '<p>' . t('No updates are required. <a href="!url">return to domain administration</a>.', array('!url' => url('admin/structure/domain'))) . '</p>',
+    );
+  }
+  else {
+    $form['intro'] = array(
+      '#markup' => '<p>' . t('The following modules have data that references domain_id 0 and will be updated:') . '</p>',
+    );
+    $modules = array();
+    foreach ($list as $item) {
+      $modules[] = check_plain($item['name']);
+    }
+    $form['list'] = array(
+      '#markup' => theme('item_list', array('items' => $modules)),
+    );
+    $form['outro'] = array(
+      '#markup' => '<p>' . t('All records marked with domain_id 0 will be assigned to the default domain.') .'</p>',
+    );
+    $form['tables'] = array(
+      '#type' => 'value',
+      '#value' => domain_update_tables($list),
+    );
+    $form['submit'] = array(
+      '#type' => 'submit',
+      '#value' => t('Update database tables'),
+    );
+  }
+  return $form;
+}
+
+/**
+ * Repairs references to domain_id 0.
+ */
+function domain_repair_form_submit($form, &$form_state) {
+  $tables = $form_state['values']['tables'];
+  $success = domain_update_zero_records($tables);
+  if ($success) {
+    drupal_set_message(t('!count database table(s) were updated.', array('!count' => count($form_state['values']['tables']))));
+  }
+  $form_state['redirect'] = 'admin/structure/domain';
+}
diff --git a/domain.drush.inc b/domain.drush.inc
index 2e1f7dc..d17605c 100644
--- a/domain.drush.inc
+++ b/domain.drush.inc
@@ -91,6 +91,12 @@ function domain_drush_command() {
     ),
     'aliases' => array('gend'),
   );
+  $items['domain-repair'] = array(
+    'description' => 'Updates domain_id 0 records in dependent tables.',
+    'examples' => array(
+      'drush domain-repair',
+    ),
+  );
   return $items;
 }
 
@@ -423,3 +429,28 @@ function drush_domain_get_from_argument($argument) {
   }
   return $domain;
 }
+
+/**
+ * Replaces domain_id 0 records with the default domain.
+ */
+function drush_domain_repair() {
+  $list = domain_update_module_check();
+  if (empty($list)) {
+    drush_print(dt('All tables are up-to-date.'));
+    return;
+  }
+  $modules = array();
+  drush_print(dt('The following modules require a data update:'));
+  drush_print();
+  foreach ($list as $item) {
+    drush_print(' * ' . $item['name']);
+  }
+  drush_print();
+  $choice = drush_choice(array(1 => dt('Update')), dt('Update database?'), '!value');
+  if ($choice) {
+    $success = domain_update_zero_records(domain_update_tables($list));
+    if ($success) {
+      drush_print(dt('!count table(s) updated successfully.', array('!count' => count($list))));
+    }
+  }
+}
diff --git a/domain.install b/domain.install
index 1e076d7..000dcfe 100644
--- a/domain.install
+++ b/domain.install
@@ -318,3 +318,41 @@ function domain_update_7306(&$sandbox) {
 function domain_update_machine_name($subdomain) {
   return preg_replace('/[^a-z0-9_]+/', '_', $subdomain);
 }
+
+/**
+ * Checks module requirements.
+ */
+function domain_requirements($phase) {
+  if ($phase != 'runtime') {
+    return;
+  }
+
+  $messages = array();
+  $severity = REQUIREMENT_ERROR;
+  // Ensure we have a primary domain.
+  $check = domain_default();
+  if ($check['domain_id'] == 0) {
+    $updated = t('set by an administrator');
+    if (user_access('administer domains')) {
+      $updated = l(t('set properly'), 'admin/structure/domain');
+    }
+    $messages[] = t('The site has no primary domain and needs to be !updated.', array('!updated' => $updated));
+  }
+  // Check for domain_id 0.
+  $list = domain_update_module_check();
+  domain_update_messages($messages, $list);
+
+  // Now report.
+  $t = get_t();
+  if (empty($message)) {
+    $severity = REQUIREMENT_OK;
+    $messages[] = t('Module installed correctly.');
+  }
+  $requirements['domain'] = array(
+    'title' => $t('Domain Access'),
+    'value' => theme('item_list', array('items' => $messages)),
+    'severity' => $severity,
+  );
+
+  return $requirements;
+}
diff --git a/domain.module b/domain.module
index 4b96767..487d1be 100644
--- a/domain.module
+++ b/domain.module
@@ -289,6 +289,14 @@ function domain_menu() {
     'file' => 'domain.admin.inc',
     'weight' => 50,
   );
+  $items['admin/structure/domain/repair'] = array(
+    'title' => 'Domain update database',
+    'access arguments' => array('administer domains'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('domain_repair_form'),
+    'type' => MENU_CALLBACK,
+    'file' => 'domain.admin.inc',
+  );
   return $items;
 }
 
@@ -1169,7 +1177,6 @@ function domain_set_primary_domain() {
       'valid' => 1,
       'is_default' => 1,
       'machine_name' => domain_machine_name($root),
-      'export_status' => DOMAIN_EXPORT_STATUS_DATABASE,
     );
     drupal_write_record('domain_export', $domain);
     drupal_write_record('domain', $domain);
@@ -2510,6 +2517,7 @@ function domain_grant_all($reset= FALSE) {
  */
 function domain_modules_enabled() {
   domain_bootstrap_register();
+  domain_check_for_update();
 }
 
 /**
@@ -3276,3 +3284,146 @@ function domain_features_selection($data) {
   return $list;
 }
 
+/**
+ * Checks to see if any dependent modules have a domain_id 0 record left.
+ *
+ * @return
+ *  An array of matching modules, with the human readable name and an array of
+ *  tables that require an update as values for each entry, keyed by module
+ *  name.
+ */
+function domain_update_module_check() {
+  $list = array();
+  $modules = system_rebuild_module_data();
+  $dependencies = $modules['domain']->required_by;
+  $enabled_dependencies = array_intersect_key($dependencies, module_list());
+  if (empty($enabled_dependencies)) {
+    return $list;
+  }
+  foreach($enabled_dependencies as $module => $data) {
+    module_load_install($module);
+    if ($schema = module_invoke($module, 'schema')) {
+      if ($tables = domain_test_schema($schema)) {
+        $list[$module]['name'] = $modules[$module]->info['name'];
+        $list[$module]['tables'] = $tables;
+      }
+    }
+  }
+  return $list;
+}
+
+/**
+ * Checks a dependent module's tables for a domain_id of 0.
+ *
+ * @param $schema
+ *  An array of table schemas, using the SchemaAPI.
+ *
+ * @return $tables
+ *  An array of matching tables.
+ */
+function domain_test_schema($schema = array()) {
+  $tables = array();
+  foreach ($schema as $name => $table) {
+    if (isset($table['fields']['domain_id']['type']) && $table['fields']['domain_id']['type'] == 'int') {
+      $query = db_select($name)
+        ->condition('domain_id', 0);
+      $check = $query->countQuery()->execute()->fetchField();
+      if ($check) {
+        $tables[] = $name;
+      }
+    }
+  }
+  return $tables;
+}
+
+/**
+ * Creates an array of tables to pass to the update script.
+ *
+ * @param $list
+ *  The modules array returned by domain_update_module_check().
+ *
+ * @return $tables
+ *  An array of tables to modify.
+ */
+function domain_update_tables($list) {
+  $tables = array();
+  foreach ($list as $module) {
+    $tables = array_merge($tables, $module['tables']);
+  }
+  return $tables;
+}
+
+/**
+ * Turns a domain_id of 0 into the default domain.
+ *
+ * @param $tables
+ *  An array of database tables to update.
+ *
+ * @return
+ *  TRUE on success or FALSE on failure.
+ */
+function domain_update_zero_records($tables) {
+  $default_id = domain_default_id();
+  $success = TRUE;
+  foreach ($tables as $table) {
+    $transaction = db_transaction();
+    try {
+      db_update($table)
+        ->fields(array('domain_id' => $default_id))
+        ->condition('domain_id', 0)
+        ->execute();
+    }
+    catch (Exception $e) {
+      $transaction->rollback();
+      watchdog_exception('domain_repair', $e);
+      drupal_set_message(t('The update failed due to a duplicate record. You must manually correct the {@table} table in your database.', array('@table' => $table)), 'error');
+      $success = FALSE;
+    }
+  }
+  return $success;
+}
+
+/**
+ * Generates messages about required table updates for 7.x.3.
+ *
+ * This function may be called during module installation, so we use $t to
+ * ensure that we use the correct translation function.
+ *
+ * @see domain_requirements()
+ *
+ * @param &$messages
+ *  An array of translated status messages, passed by reference.
+ * @param $list
+ *  An array of modules that require updates.
+ */
+function domain_update_messages(&$messages, $list) {
+  $t = get_t();
+  foreach($list as $module => $data) {
+    $updated = $t('updated by an administrator');
+    if (user_access('administer domains')) {
+      $updated = l($t('updated for compatibility'), 'admin/structure/domain/repair');
+    }
+    $messages[] = $t('@module has a domain_id of 0 and needs to be !updated.', array('@module' => $data['name'], '!updated' => $updated));
+  }
+}
+
+/**
+ * Checks for tables not compatible with 7.x.3 and provides standard messages.
+ */
+function domain_check_for_update() {
+  $list = domain_update_module_check();
+
+  if (!empty($list)) {
+    $messages = array();
+    domain_update_messages(&$messages, $list);
+    if (!drupal_is_cli()) {
+      drupal_set_message(theme('item_list', array('items' => $messages)), 'error', FALSE);
+    }
+    elseif (function_exists('drush_print')) {
+      foreach ($messages as $message) {
+        drush_print(" * $message");
+      }
+      drush_print(dt(" ** Run 'drush domain-repair' to update these tables."));
+    }
+  }
+}
diff --git a/tests/domain.test b/tests/domain.test
index 567cb89..d20c149 100644
--- a/tests/domain.test
+++ b/tests/domain.test
@@ -672,3 +672,37 @@ class DomainCacheTest extends DomainTestCase {
     $this->domainResetBaseUrl();
   }
 }
+
+class DomainUpdateTest extends DomainTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Domain update tests',
+      'description' => 'Tests for the update to 7.x.3.',
+      'group' => 'Domain Access',
+    );
+  }
+
+  // On setup, install our test module.
+  function setUp($list = array()) {
+    if (!in_array('domain_conf', $list)) {
+      $list[] = 'domain_conf';
+    }
+    parent::setUp($list);
+    db_insert('domain_conf')
+      ->fields(array(
+        'domain_id' => 0,
+        'settings' => '',
+      ))
+      ->execute();
+  }
+
+  function testDomainUpdate() {
+    $count = db_query("SELECT COUNT(domain_id) FROM {domain_conf} WHERE domain_id = 0")->fetchField();
+    $this->assertTrue($count == 1, t('Domain id of 0 inserted in {domain_conf}.'));
+    $list = domain_update_module_check();
+    $this->assertTrue(count($list) > 0, t('domain_update_module_check() returned correctly.'));
+    domain_update_zero_records(domain_update_tables($list));
+    $list = domain_update_module_check();
+    $this->assertTrue(count($list) == 0, t('domain_update_zero_records fired correctly.'));
+  }
+}
