Class Upgrader
Used to run a MigrationPlan
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Migrations.Upgrade
Assembly: Umbraco.Infrastructure.dll
Syntax
public class Upgrader
Constructors
View SourceUpgrader(MigrationPlan)
Initializes a new instance of the Upgrader class with the specified migration plan.
Declaration
public Upgrader(MigrationPlan plan)
Parameters
| Type | Name | Description |
|---|---|---|
| MigrationPlan | plan | The MigrationPlan to use for the upgrade process. |
Properties
View SourceName
Gets the name of the migration plan.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Plan
Gets the migration plan.
Declaration
public MigrationPlan Plan { get; }
Property Value
| Type | Description |
|---|---|
| MigrationPlan |
StateValueKey
Gets the key for the state value.
Declaration
public virtual string StateValueKey { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceExecute(IMigrationPlanExecutor, ICoreScopeProvider, IKeyValueService)
Executes the migration plan synchronously using the provided migration plan executor, scope provider, and key value service.
Declaration
[Obsolete("Use ExecuteAsync instead. Scheduled for removal in Umbraco 18.")]
public ExecutedMigrationPlan Execute(IMigrationPlanExecutor migrationPlanExecutor, ICoreScopeProvider scopeProvider, IKeyValueService keyValueService)
Parameters
| Type | Name | Description |
|---|---|---|
| IMigrationPlanExecutor | migrationPlanExecutor | The executor responsible for running the migration plan. |
| ICoreScopeProvider | scopeProvider | The scope provider used to manage database scopes during migration. |
| IKeyValueService | keyValueService | The key value service used for storing migration state. |
Returns
| Type | Description |
|---|---|
| ExecutedMigrationPlan | The result of the executed migration plan. |
Remarks
This method is obsolete. Use ExecuteAsync(IMigrationPlanExecutor, ICoreScopeProvider, IKeyValueService) instead.
ExecuteAsync(IMigrationPlanExecutor, ICoreScopeProvider, IKeyValueService)
Executes the migration plan asynchronously using the specified executor, scope provider, and key-value service.
Declaration
public Task<ExecutedMigrationPlan> ExecuteAsync(IMigrationPlanExecutor migrationPlanExecutor, ICoreScopeProvider scopeProvider, IKeyValueService keyValueService)
Parameters
| Type | Name | Description |
|---|---|---|
| IMigrationPlanExecutor | migrationPlanExecutor | The executor responsible for running the migration plan. |
| ICoreScopeProvider | scopeProvider | The provider used to manage database transaction scopes. |
| IKeyValueService | keyValueService | The service used to persist and retrieve key-value pairs for migration state tracking. |
Returns
| Type | Description |
|---|---|
| Task<ExecutedMigrationPlan> | A task that represents the asynchronous operation, containing the result of the executed migration plan. |