Skip to content

Migration Engine: Copy redirects, subscriptions, retry history and settings to SQL - #6137

Merged
warwickschroeder merged 4 commits into
warwick/migration-engine-1from
migration-engine-7
Nov 20, 2026
Merged

warwickschroeder merged 4 commits into
warwick/migration-engine-1from
migration-engine-7

Conversation

@warwickschroeder

Copy link
Copy Markdown
Contributor

The offline migration now copies five more required categories from RavenDB to SQL. A category that cannot be stored row for row is skipped or merged with a reason, and the SQL target can reset a category so it copies again cleanly.

What this adds

  • Message redirects, subscriptions, retry operations, notification settings and the trial end date are copied by --start-data-migration.
  • Rows whose keys collide in SQL are reported as merges, with a warning naming both keys, for redirects, subscriptions and pending retry operations.
  • Subscriptions for two versions of one message type become one row, because the SQL key has no version.
  • A legacy subscriber with no endpoint gets the endpoint name the product itself stores for one.
  • Endpoint settings that differ only in case keep the name a known endpoint uses, so the heartbeat settings sync no longer deletes the copied setting on SQL Server.
  • The SQL target can reset a category for a retry. For retry history, whose keys SQL generates, the reset also deletes the copied rows in the same transaction. Nothing calls it yet: the --migration-retry command comes later.
  • Single-document categories share one reader and one Settings-row writer, and the licensing report masks and licensed endpoint details now use them.
  • --start-data-migration logs only through the instance's own log providers, so lines are no longer printed twice.
  • Docs: the migration overview and instructions are shorter, and the RavenDB backup step is gone.

Tests

  • ServiceControl.Migration.AcceptanceTests: each new category copied end to end on SQL Server and PostgreSQL, including merges, skips, a retry history larger than one statement, the reset for a retry, endpoint settings surviving the heartbeat sync, and the offline command's log providers.
  • ServiceControl.Persistence.Tests/EFCore/Migration: the new writers and row mappers, their skip reasons and merge details, and that only store-keyed writers delete rows for a retry.
  • ServiceControl.Persistence.Tests.RavenDB/DataMigration: the redirects and subscriptions readers, and every reader finding its document in the right database.
  • ServiceControl.Persistence.Tests.SqlServer: endpoint settings names that differ only in case keep the known endpoint's spelling.
  • ServiceControl.UnitTests/Migration: which skip reasons are harmless and which are faults.

@warwickschroeder
warwickschroeder force-pushed the warwick/migration-engine-1 branch from f770bf8 to f76aa71 Compare November 20, 2026 04:08
@warwickschroeder
warwickschroeder removed this pull request from stack #6157 November 20, 2026 04:26
@warwickschroeder
warwickschroeder force-pushed the warwick/migration-engine-1 branch from f76aa71 to 49f63e6 Compare November 20, 2026 04:39
- Copy message redirects, subscriptions, retry operations, notification settings and the trial end date
- Report rows merged by the SQL key instead of dropping them silently
- Delete store-keyed rows when a category is reset for a retry
@warwickschroeder
warwickschroeder merged commit 750d3ed into warwick/migration-engine-1 Nov 20, 2026
72 checks passed
@warwickschroeder
warwickschroeder deleted the migration-engine-7 branch November 20, 2026 05:24
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