Skip to content

Commit 85b23da

Browse files
authored
Merge pull request #6533 from ronaldbarendse/deploy/import-operation-order
Document Deploy legacy property type migrators, import and migration flow and clarify grid editor configuration
2 parents b5b5559 + 898c98a commit 85b23da

File tree

4 files changed

+104
-26
lines changed

4 files changed

+104
-26
lines changed

13/umbraco-deploy/deployment-workflow/import-export-v7.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
meta.Title: Migrating from Umbraco 7
3-
description: How to export content and schema from Umbraco 7 and import into a newer version
3+
description: How to export content and schema from Umbraco 7 and import them into a newer version
44
---
55

6-
### Migrating from Umbraco 7
6+
# Migrating from Umbraco 7
77

8-
The import and export features are available for Umbraco Deploy supporting Umbraco 8 and above. It's not been ported back to Umbraco 7, hence you cannot trigger an export from there in the same way.
8+
The import and export features are available for Umbraco Deploy supporting Umbraco 8 and above. It's not been ported back to Umbraco 7, hence you cannot trigger an export from the backoffice or use the service.
99

10-
We can use this feature to help migrate from Umbraco 7 to a supported major version. However, it requires additional logic to be added to the Deploy Contrib project.
10+
However, you can still use this feature to help migrate from Umbraco 7 to a supported major version. This requires adding additional logic to your Umbraco 7 project to create an export ZIP archive similar to newer versions.
1111

12-
#### Exporting Umbraco 7 content and schema
12+
## Exporting Umbraco 7 content and schema
1313

14-
We can generate an export archive in the same format as used by the import/export feature. This is done by adding the [`Umbraco.Deploy.Contrib.Export` assembly](https://github.com/umbraco/Umbraco.Deploy.Contrib/releases/tag/release-2.0.0-export) to your Umbraco 7 project. This archive can then be imported into a newer Umbraco version by configuring the legacy import migrators. You can also apply additional migrators to update obsolete data types and property data into newer equivalents.
14+
You can generate an export archive in the same format as the import/export feature. This is done by adding the [`Umbraco.Deploy.Contrib.Export` assembly](https://github.com/umbraco/Umbraco.Deploy.Contrib/releases/tag/release-2.0.0-export) to your Umbraco 7 project (that already has Deploy and Deploy Contrib installed, see below). This archive can be imported into a newer Umbraco version by configuring the legacy import migrators. You can also apply additional migrators to update obsolete data types and property data into newer equivalents.
1515

1616
This is possible via code, by temporarily applying a composer to an Umbraco 7 project to generate the export archive on start-up:
1717

@@ -88,7 +88,7 @@ public class DeployExportApplicationHandler : ApplicationEventHandler
8888

8989
</details>
9090

91-
#### Importing Umbraco 7 content and schema
91+
## Importing Umbraco 7 content and schema
9292

9393
To import this archive into a newer Umbraco project, you need to install either of these packages:
9494

@@ -150,6 +150,9 @@ internal class LegacyImportComposer : IComposer
150150
builder.DeployArtifactMigrators()
151151
.AddLegacyMigrators()
152152
.Append<ElementTypeArtifactMigrator>();
153+
154+
builder.DeployPropertyTypeMigrators()
155+
.AddLegacyMigrators(); // Available from Deploy Contrib 13.3.0 and 14.2.0+
153156
}
154157

155158
private class ElementTypeArtifactMigrator : ElementTypeArtifactMigratorBase
@@ -167,23 +170,23 @@ internal class LegacyImportComposer : IComposer
167170
It is recommended to start by importing only the schema and schema files (by deselecting 'Content' and 'Content files' in the dialog). Then, you can proceed with importing all content and schema together. The order in which the artifacts are imported depends on their dependencies. By importing the schema first, we ensure that the schema is updated before any content is processed.
168171
{% endhint %}
169172

170-
#### Obtaining Umbraco Deploy for Umbraco 7
173+
## Obtaining Umbraco Deploy for Umbraco 7
171174

172175
Umbraco Deploy for Umbraco 7 is no longer supported and was only available on Umbraco Cloud. It was not released for use on-premise.
173176

174177
As such if you are looking to migrate from an Umbraco Cloud project running on Umbraco 7, you already have Umbraco Deploy installed.
175178

176-
If you have an Umbraco 7 on-premise website, you can use this guide to migrate from on-premise to Umbraco Cloud. Or to upgrade to a newer Deploy on-premise version. You will need to obtain and install Umbraco Deploy for Umbraco 7 into your project, solely to use the export feature.
179+
If you have an Umbraco 7 on-premises website, you can use this guide to migrate from on-premises to Umbraco Cloud. Or to upgrade to a newer Deploy On-premises version. You need to obtain and install Umbraco Deploy for Umbraco 7 into your project, solely to use the export feature.
177180

178181
The export feature can be used without a license.
179182

180183
{% hint style="info" %}
181184

182-
A license is required for the Umbraco project you are importing into. This can be a license that comes as part of an Umbraco Cloud subscription, or an on-premise one.
185+
A license is required for the Umbraco project you are importing into. This can be a license that comes as part of an Umbraco Cloud subscription, or a Deploy On-premises one.
183186

184187
{% endhint %}
185188

186-
Use this guide to migrate from on-premise to Umbraco Cloud or to upgrade to a newer Deploy version on-premise.
189+
Use this guide to migrate from on-premises to Umbraco Cloud or to upgrade to a newer Deploy On-premises version.
187190

188191
1. Download the required `dll` files for Umbraco Deploy for Umbraco 7 from the following links:
189192

@@ -226,4 +229,4 @@ Use this guide to migrate from on-premise to Umbraco Cloud or to upgrade to a ne
226229

227230
4. Export Content.
228231

229-
- **Export** your content, schema, and files to zip.
232+
- **Export** your content, schema, and files to zip.

13/umbraco-deploy/deployment-workflow/import-with-migrations.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,34 @@ internal class ArtifactMigratorsComposer : IComposer
8787
}
8888
```
8989

90+
### Import and migration flow
91+
92+
When an import is started, the following happens:
93+
1. Artifact signatures are read from the import provider (using `IArtifactImportProvider.GetArtifactSignatures()`).
94+
2. The artifact signatures are sorted based on dependencies with `Ordering` enabled (ensuring dependent items are processed in the correct order, like parent items before children and data types before document types).
95+
3. For each artifact signature:
96+
1. Check whether the entity type is allowed to be imported.
97+
2. Publish an `ArtifactImportingNotification` (cancelling will skip importing the artifact).
98+
4. Publish a `ValidateArtifactImportNotification`:
99+
- Deploy adds a default handler (`ValidateArtifactImportDependenciesNotificationHandler`) to validate whether all dependencies are either in the import or already present in the current environment. It emits warnings for missing content artifacts, missing or different artifact checksums and errors for missing schema artifacts.
100+
- The import fails on validation errors or 'soft' fails on warnings if the `WarningsAsErrors` import option is set.
101+
5. Create a Deploy scope and context (containing the 'owner' user for auditing purposes and cultures to import, in case the user doesn't have edit permissions for all languages).
102+
6. For each artifact signature:
103+
1. Create a (readonly) `Stream` for the artifact (using `IArtifactImportProvider.CreateArtifactReadStream(Udi)`).
104+
2. Deserialize the artifact into a generic JSON object (`JToken`).
105+
3. Parse the `__version` and `__type` properties and resolve the artifact type (using `IArtifactTypeResolver`).
106+
4. Migrate the JSON object (using `IArtifactJsonMigrator`).
107+
5. Deserialize the JSON object into the artifact type.
108+
6. Migrate the artifact (using `IArtifactMigrator`).
109+
7. Initialize artifact processing (using `IServiceConnector.ProcessInit(...)`) and track deploy state with next passes.
110+
7. For each next process pass (starting at the lowest initial next pass):
111+
1. Process artifact (using `IServiceConnector.Process(...)`).
112+
2. During processing: service connectors for content, media and members migrate property type values if a property editor alias has changed (using `IPropertyTypeMigrator`).
113+
3. When no next pass is required (the deploy state returns -1 as next pass):
114+
1. Publish an `ArtifactImportedNotification`.
115+
2. Report the import process (using `IProgress.Report(...)`).
116+
8. The Deploy scope is completed, causing all scoped notifications to be published to handlers implementing `IDistributedCacheNotificationHandler`) and completing the import.
117+
90118
### Details of Specific Migrations
91119

92120
Umbraco Deploy ships with migrators to handle the conversion of core property editors as they have changed, been removed or replaced between versions.
@@ -95,7 +123,7 @@ Open source migrators may be built by HQ or the community for property editors f
95123

96124
#### Grid to Block Grid
97125

98-
The grid editor introduced in Umbraco 7 has been removed from Umbraco 14. It's functionality is replaced with the Block Grid.
126+
The Grid editor introduced in Umbraco 7 can still be used in version 13 but has been removed from Umbraco 14. Its functionality is replaced with the Block Grid editor.
99127

100128
With Deploy migrators we have support for migrating Data Type configuration and property data between these property editors.
101129

@@ -118,6 +146,10 @@ internal sealed class DeployMigratorsComposer : IComposer
118146
}
119147
```
120148

149+
{% hint style="info" %}
150+
The project you are importing into needs to know about any custom legacy Grid editor configurations to migrate to the Block Grid editor correctly. Make sure to either copy the `grid.editors.config.js` and `package.manifest` (containing grid editors) files or override the `GetGridEditors()` method of the artifact migrator to provide this.
151+
{% endhint %}
152+
121153
These implementations make use of the following conventions to migrate the data:
122154

123155
- `ReplaceGridDataTypeArtifactMigrator`:
@@ -201,6 +233,10 @@ The migrators add the following behavior:
201233
- `ReplaceDocTypeGridEditorDataTypeArtifactMigrator` extends `ReplaceGridDataTypeArtifactMigrator` and ensures any DocTypeGridEditor is migrated to blocks using the allowed element types. If the element types aren't found the default implementation will migrate to new element types.
202234
- `DocTypeGridEditorPropertyTypeMigrator` extends `GridPropertyTypeMigrator` and ensures the Doc Type Grid Editor values are mapped one-to-one to the block item data.
203235

236+
{% hint style="info" %}
237+
The artifact migrator adds the default DocTypeGridEditor configuration (with alias `docType`). This can be disabled by setting the `AddDefaultDocTypeGridEditor` property to `false` in a custom/inherited class. Similar to the base migrator, any custom DocTypeGridEditor configurations must be available to migrate to the Block Grid editor correctly.
238+
{% endhint %}
239+
204240
#### Migrating from Matryoshka
205241

206242
[Matryoshka](https://our.umbraco.com/packages/backoffice-extensions/matryoshka-tabs-for-umbraco-8/) was an Umbraco package that added tab support for document types in Umbraco. The feature was subsequently added to the product itself.

14/umbraco-deploy/deployment-workflow/import-export-v7.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ description: How to export content and schema from Umbraco 7 and import into a n
55

66
### Migrating from Umbraco 7
77

8-
The import and export features are available for Umbraco Deploy supporting Umbraco 8 and above. It's not been ported back to Umbraco 7, hence you cannot trigger an export from there in the same way.
8+
The import and export features are available for Umbraco Deploy supporting Umbraco 8 and above. It's not been ported back to Umbraco 7, hence you cannot trigger an export from the backoffice or use the service.
99

10-
We can use this feature to help migrate from Umbraco 7 to a supported major version. However, it requires additional logic to be added to the Deploy Contrib project.
10+
However, you can still use this feature to help migrate from Umbraco 7 to a supported major version. This requires adding additional logic to your Umbraco 7 project to create an export ZIP archive similar to newer versions.
1111

1212
#### Exporting Umbraco 7 content and schema
1313

14-
We can generate an export archive in the same format as used by the import/export feature. This is done by adding the [`Umbraco.Deploy.Contrib.Export` assembly](https://github.com/umbraco/Umbraco.Deploy.Contrib/releases/tag/release-2.0.0-export) to your Umbraco 7 project. This archive can then be imported into a newer Umbraco version by configuring the legacy import migrators. You can also apply additional migrators to update obsolete data types and property data into newer equivalents.
14+
You can generate an export archive in the same format as the import/export feature. This is done by adding the [`Umbraco.Deploy.Contrib.Export` assembly](https://github.com/umbraco/Umbraco.Deploy.Contrib/releases/tag/release-2.0.0-export) to your Umbraco 7 project (that already has Deploy and Deploy Contrib installed, see below). This archive can be imported into a newer Umbraco version by configuring the legacy import migrators. You can also apply additional migrators to update obsolete data types and property data into newer equivalents.
1515

1616
This is possible via code, by temporarily applying a composer to an Umbraco 7 project to generate the export archive on start-up:
1717

@@ -150,6 +150,9 @@ internal class LegacyImportComposer : IComposer
150150
builder.DeployArtifactMigrators()
151151
.AddLegacyMigrators()
152152
.Append<ElementTypeArtifactMigrator>();
153+
154+
builder.DeployPropertyTypeMigrators()
155+
.AddLegacyMigrators(); // Available from Deploy Contrib 13.3.0 and 14.2.0+
153156
}
154157

155158
private class ElementTypeArtifactMigrator : ElementTypeArtifactMigratorBase
@@ -173,17 +176,17 @@ Umbraco Deploy for Umbraco 7 is no longer supported and was only available on Um
173176

174177
As such if you are looking to migrate from an Umbraco Cloud project running on Umbraco 7, you already have Umbraco Deploy installed.
175178

176-
If you have an Umbraco 7 on-premise website, you can use this guide to migrate from on-premise to Umbraco Cloud. Or to upgrade to a newer Deploy on-premise version. You will need to obtain and install Umbraco Deploy for Umbraco 7 into your project, solely to use the export feature.
179+
If you have an Umbraco 7 on-premises website, you can use this guide to migrate from on-premises to Umbraco Cloud. Or to upgrade to a newer Deploy On-premises version. You need to obtain and install Umbraco Deploy for Umbraco 7 into your project, solely to use the export feature.
177180

178181
The export feature can be used without a license.
179182

180183
{% hint style="info" %}
181184

182-
A license is required for the Umbraco project you are importing into. This can be a license that comes as part of an Umbraco Cloud subscription, or an on-premise one.
185+
A license is required for the Umbraco project you are importing into. This can be a license that comes as part of an Umbraco Cloud subscription, or a Deploy On-premises one.
183186

184187
{% endhint %}
185188

186-
Use this guide to migrate from on-premise to Umbraco Cloud or to upgrade to a newer Deploy version on-premise.
189+
Use this guide to migrate from on-premises to Umbraco Cloud or to upgrade to a newer Deploy On-premises version.
187190

188191
1. Download the required `dll` files for Umbraco Deploy for Umbraco 7 from the following links:
189192

@@ -226,4 +229,4 @@ Use this guide to migrate from on-premise to Umbraco Cloud or to upgrade to a ne
226229

227230
4. Export Content.
228231

229-
- **Export** your content, schema, and files to zip.
232+
- **Export** your content, schema, and files to zip.

0 commit comments

Comments
 (0)