Skip to content

Migrations: Set a long timeout by default on the migration of system dates (closes #21013)#21022

Merged
kjac merged 1 commit intomainfrom
v17/bugfix/increase-command-timeout-for-date-migration
Dec 1, 2025
Merged

Migrations: Set a long timeout by default on the migration of system dates (closes #21013)#21022
kjac merged 1 commit intomainfrom
v17/bugfix/increase-command-timeout-for-date-migration

Conversation

@AndyButland
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Addresses #21013

Description

Although as noted in the discussion on the linked issue we can resolve this by configuring a command timeout in the connection string, it makes sense to use a long one by default for these migration queries.

So this PR will set a timeout of 5 minutes unless a longer one is already configured.

Testing

Use a SQL update like the following to re-run the migration and verify with a breakpoint that the CommandTimeout is set as expected.

update umbracoKeyValue
set value = '{EB1E50B7-CD5E-4B6B-B307-36237DD2C506}'
where [key] = 'Umbraco.Core.Upgrader.State+Umbraco.Core'

If set in the connection string to a value longer than 300 seconds, e.g. with the following, then the configured value should be kept:

"umbracoDbDSN": "Server=.\\SQLEXPRESS;Database=UmbracoCms17;Integrated Security=true;TrustServerCertificate=true;Connect Timeout=500"

Copilot AI review requested due to automatic review settings December 1, 2025 17:28
@AndyButland AndyButland changed the title Migrations: Set a long timeout by default on the migration of system dates Migrations: Set a long timeout by default on the migration of system dates (closes #21013) Dec 1, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a default command timeout of 5 minutes (300 seconds) to the system dates UTC migration to prevent timeout issues on databases with large tables. The migration updates numerous date columns across multiple tables, which can be time-consuming on production databases with significant data volumes.

  • Sets CommandTimeout to 300 seconds for the MigrateSystemDatesToUtc migration
  • Preserves any existing longer timeout configured via connection string
  • Addresses issue #21013 where migrations were timing out on large databases

Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kjac kjac merged commit 24b3f11 into main Dec 1, 2025
32 of 33 checks passed
@kjac kjac deleted the v17/bugfix/increase-command-timeout-for-date-migration branch December 1, 2025 18:13
AndyButland added a commit that referenced this pull request Dec 1, 2025
…dates (closes #21013) (#21022)

Set a long timeout by default on the migration of system dates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants