diff --git a/core/includes/update.inc b/core/includes/update.inc
index 4b45b27b65..2c73481a9e 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -73,12 +73,47 @@ function update_system_schema_requirements() {
  * Checks update requirements and reports errors and (optionally) warnings.
  */
 function update_check_requirements() {
+  // Because this is one of the earliest points in the update process,
+  // detect and fix missing schema versions for modules here to ensure
+  // it runs on all update code paths.
+  _update_fix_missing_schema();
+
   // Check requirements of all loaded modules.
   $requirements = \Drupal::moduleHandler()->invokeAll('requirements', ['update']);
   $requirements += update_system_schema_requirements();
   return $requirements;
 }
 
+/**
+ * Helper to detect and fix 'missing' schema information.
+ *
+ * Repairs the case where a module has no schema version recorded.
+ * This has to be done prior to updates being run, otherwise the update
+ * system would detect and attempt to run all historical updates for a
+ * module. Can be removed from core once all sites can be expected to have
+ * run this at least once (i.e. Drupal 10).
+ *
+ * @todo: remove in Drupal 10.0.x
+ */
+function _update_fix_missing_schema() {
+  $versions = \Drupal::keyValue('system.schema')->getAll();
+  $enabled_modules = array_keys(\Drupal::moduleHandler()->getModuleList());
+
+  foreach ($enabled_modules as $module) {
+    if (!isset($versions[$module])) {
+      $all_updates = drupal_get_schema_versions($module);
+      // We cannot know the actual schema version a module is at, because
+      // no updates will ever have been run on the site and it was not set
+      // correctly when the module was installed, so instead set it to
+      // the same as the last update. This means that updates will proceed
+      // again the next time the module is updated and a new update is
+      // added.
+      $last_update = end($all_updates);
+      update_set_schema($module, $last_update);
+    }
+  }
+}
+
 /**
  * Forces a module to a given schema version.
  *
