From b45c42df13399482f82451873b9c43953ff0106e Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Mon, 1 Dec 2025 18:24:15 +0100 Subject: [PATCH] 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 c4b1f3da4753..6f290d455f7b 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 @@ protected override void Migrate() 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);