diff -u b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
--- b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\taxonomy\Plugin\views\filter;
 
+use Drupal\Component\Uuid\Uuid;
 use Drupal\Core\Entity\Element\EntityAutocomplete;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\taxonomy\Entity\Term;
@@ -88,6 +89,11 @@
   }
 
   protected function getEntityIdsFromUuids(array $uuids) {
+    if (!empty($uuids) && !Uuid::isValid(reset($uuids))) {
+      // Entity IDs haven't been converted to UUIDs yet so just return them.
+      return $uuids;
+    }
+
     $terms = $this->termStorage->loadByProperties(['uuid' => $uuids]);
 
     $entity_ids = [];
diff -u b/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
--- b/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -286,42 +285,0 @@
-
-/**
- * Update views filters to use UUIDs for term IDs instead of entity IDs.
- */
-function taxonomy_update_8901() {
-  $config_factory = \Drupal::configFactory();
-
-  foreach ($config_factory->listAll('views.view.') as $id) {
-    $view = $config_factory->getEditable($id);
-
-    foreach (array_keys($view->get('display')) as $display_id) {
-      $changed = FALSE;
-
-      $base_path = "display.$display_id.display_options.filters";
-      $handlers = $view->get($base_path);
-
-      if (!$handlers) {
-        continue;
-      }
-
-      foreach ($handlers as $handler_key => $handler_config) {
-        $value_path = "$base_path.$handler_key.value";
-        $term_uuids = taxonomy_convert_entity_ids_to_uuids($view->get($value_path));
-        // @todo Change the storage from an integer to a string first.
-        // $view->set($value_path, $term_uuids);
-        $changed = TRUE;
-      }
-
-      if ($changed) {
-        $view->save(TRUE);
-      }
-    }
-  }
-}
-
-function taxonomy_convert_entity_ids_to_uuids(array $entity_ids) {
-  $uuids = [];
-  foreach (Term::loadMultiple($entity_ids) as $term) {
-    $uuids[] = $term->uuid();
-  }
-  return $uuids;
-}
only in patch2:
unchanged:
--- a/core/modules/taxonomy/taxonomy.post_update.php
+++ b/core/modules/taxonomy/taxonomy.post_update.php
@@ -13,6 +13,8 @@
 use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\Core\Url;
+use Drupal\Component\Uuid\Uuid;
+use Drupal\taxonomy\Entity\Term;
 use Drupal\taxonomy\TermStorage;
 use Drupal\views\ViewExecutable;
 
@@ -364,3 +366,45 @@ function taxonomy_post_update_configure_status_field_widget(&$sandbox = NULL) {
     return FALSE;
   });
 }
+
+/**
+ * Update views filters to use UUIDs for term IDs instead of entity IDs.
+ */
+function taxonomy_post_update_convert_term_views_filters_to_uuids(&$sandbox = NULL) {
+  if (!\Drupal::moduleHandler()->moduleExists('views')) {
+    return;
+  }
+
+  \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function ($view) {
+    /** @var \Drupal\views\ViewEntityInterface $view */
+    $displays = $view->get('display');
+
+    foreach ($displays as $display_name => &$display) {
+      $filters = isset($display['display_options']['filters']) ? $display['display_options']['filters'] : [];
+      foreach ($filters as $id => $filter) {
+        if (isset($filter['field'])) {
+          $filters[$id]['field']['value'] = taxonomy_convert_entity_ids_to_uuids($filters[$id]['field']['value']);
+        }
+      }
+
+      $display['display_options']['filters'] = $filters;
+    }
+    $view->set('display', $displays);
+    return TRUE;
+  });
+}
+
+function taxonomy_convert_entity_ids_to_uuids(array $entity_ids) {
+  $uuids = [];
+
+  foreach ($entity_ids as $entity_id) {
+    if (Uuid::isValid($entity_id)) {
+      // This ID is already a UUID.
+      $uuids[] = $entity_id;
+      continue;
+    }
+    $uuids[] = Term::load($entity_id)->uuid();
+  }
+
+  return $uuids;
+}
