From 35f73a8a31bb8156f8441fda905ca5103ee9fb93 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Mon, 1 Dec 2025 19:13:55 +0100 Subject: [PATCH] Migrations: Set a long timeout by default on the migration of system dates (closes #21013) (#21022) Set a long timeout by default on the migration of system dates. --- .../Upgrade/V_17_0_0/MigrateSystemDatesToUtc.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_17_0_0/MigrateSystemDatesToUtc.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_17_0_0/MigrateSystemDatesToUtc.cs index c4b1f3da47..6f290d455f 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_17_0_0/MigrateSystemDatesToUtc.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_17_0_0/MigrateSystemDatesToUtc.cs @@ -96,6 +96,14 @@ public class MigrateSystemDatesToUtc : UnscopedMigrationBase using IScope scope = _scopeProvider.CreateScope(); using IDisposable notificationSuppression = scope.Notifications.Suppress(); + // Ensure we have a long command timeout as this migration can take a while on large tables within the database. + // If the command timeout is already longer, applied via the connection string with "Connect Timeout={timeout}" we leave it as is. + const int CommandTimeoutInSeconds = 300; + if (scope.Database.CommandTimeout < CommandTimeoutInSeconds) + { + scope.Database.CommandTimeout = CommandTimeoutInSeconds; + } + MigrateDateColumn(scope, "cmsMember", "emailConfirmedDate", timeZone); MigrateDateColumn(scope, "cmsMember", "lastLoginDate", timeZone); MigrateDateColumn(scope, "cmsMember", "lastLockoutDate", timeZone);