You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 15/umbraco-deploy/deployment-workflow/import-export-v7.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,16 @@
1
1
---
2
-
meta.Title: Migrating from Umbraco 7
3
2
description: How to export content and schema from Umbraco 7 and import into a newer version
4
3
---
5
4
6
-
###Migrating from Umbraco 7
5
+
# Migrating from Umbraco 7
7
6
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.
7
+
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.
9
8
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.
9
+
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.
11
10
12
-
####Exporting Umbraco 7 content and schema
11
+
## Exporting Umbraco 7 content and schema
13
12
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.
13
+
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.
15
14
16
15
This is possible via code, by temporarily applying a composer to an Umbraco 7 project to generate the export archive on start-up:
17
16
@@ -88,7 +87,7 @@ public class DeployExportApplicationHandler : ApplicationEventHandler
88
87
89
88
</details>
90
89
91
-
####Importing Umbraco 7 content and schema
90
+
## Importing Umbraco 7 content and schema
92
91
93
92
To import this archive into a newer Umbraco project, you need to install either of these packages:
94
93
@@ -150,6 +149,9 @@ internal class LegacyImportComposer : IComposer
150
149
builder.DeployArtifactMigrators()
151
150
.AddLegacyMigrators()
152
151
.Append<ElementTypeArtifactMigrator>();
152
+
153
+
builder.DeployPropertyTypeMigrators()
154
+
.AddLegacyMigrators(); // Available from Deploy Contrib 13.3.0 and 14.2.0+
@@ -167,23 +169,23 @@ internal class LegacyImportComposer : IComposer
167
169
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.
168
170
{% endhint %}
169
171
170
-
####Obtaining Umbraco Deploy for Umbraco 7
172
+
## Obtaining Umbraco Deploy for Umbraco 7
171
173
172
174
Umbraco Deploy for Umbraco 7 is no longer supported and was only available on Umbraco Cloud. It was not released for use on-premise.
173
175
174
176
As such if you are looking to migrate from an Umbraco Cloud project running on Umbraco 7, you already have Umbraco Deploy installed.
175
177
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.
178
+
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.
177
179
178
180
The export feature can be used without a license.
179
181
180
182
{% hint style="info" %}
181
183
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.
184
+
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.
183
185
184
186
{% endhint %}
185
187
186
-
Use this guide to migrate from on-premise to Umbraco Cloud or to upgrade to a newer Deploy version on-premise.
188
+
Use this guide to migrate from on-premises to Umbraco Cloud or to upgrade to a newer Deploy On-premises version.
187
189
188
190
1. Download the required `dll` files for Umbraco Deploy for Umbraco 7 from the following links:
Copy file name to clipboardExpand all lines: 15/umbraco-deploy/deployment-workflow/import-with-migrations.md
+52-16Lines changed: 52 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
---
2
-
meta.Title: Import with migrations in Umbraco Deploy
3
2
description: How to import content and schema while migrating them into newer alternatives
4
3
---
5
4
@@ -15,7 +14,7 @@ For example, we can migrate from a Nested Content property in Umbraco 8 to a Blo
15
14
16
15
We provide the necessary migration hooks for this to happen, divided into two types - **artifact migrators** and **property migrators**.
17
16
18
-
###Artifact migrators
17
+
## Artifact migrators
19
18
20
19
Artifact migrators work by transforming the serialized artifact of any imported artifact, via two interfaces:
21
20
@@ -37,7 +36,7 @@ We've also made available base implementations that you can use to build your ow
37
36
-`ArtifactJsonMigratorBase<TArtifact>` - migrates the JSON of the specified artifact type
38
37
-`ReplaceGridDataTypeArtifactMigratorBase` - migrates a Data Type based on the legacy Grid layout into the Block Grid
39
38
40
-
###Property migrators
39
+
## Property migrators
41
40
42
41
Property migrators work to transform the content property data itself. They are used in the Deploy content connectors (documents, media and members) when the property editor is changed during an import:
43
42
@@ -60,7 +59,7 @@ And a base type to help you build your own migrations:
60
59
Property editor changes are determined by comparing the `PropertyEditorAliases` dictionary stored in the content artifact to the current Content Type/Data Type configuration. The dictionary contains editor aliases for each content property.
61
60
{% endhint %}
62
61
63
-
###Registering migrators
62
+
## Registering migrators
64
63
65
64
Migrators will run if you have registered them, so you can enable only the ones needed for your solution.
66
65
@@ -84,21 +83,50 @@ internal class ArtifactMigratorsComposer : IComposer
84
83
.Append<MediaPickerPropertyTypeMigrator>();
85
84
}
86
85
}
87
-
```
86
+
```
88
87
89
-
### Details of Specific Migrations
88
+
## Import and migration flow
89
+
90
+
When an import is started, the following happens:
91
+
92
+
1. Artifact signatures are read from the import provider (using `IArtifactImportProvider.GetArtifactSignatures()`).
93
+
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).
94
+
3. For each artifact signature:
95
+
1. Check whether the entity type is allowed to be imported.
96
+
2. Publish an `ArtifactImportingNotification` (cancelling will skip importing the artifact).
97
+
4. Publish a `ValidateArtifactImportNotification`:
98
+
- 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.
99
+
- The import fails on validation errors or 'soft' fails on warnings if the `WarningsAsErrors` import option is set.
100
+
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).
101
+
6. For each artifact signature:
102
+
1. Create a (readonly) `Stream` for the artifact (using `IArtifactImportProvider.CreateArtifactReadStream(Udi)`).
103
+
2. Deserialize the artifact into a generic JSON object (`JsonNode`).
104
+
3. Parse the `__version` and `__type` properties and resolve the artifact type (using `IArtifactTypeResolver`).
105
+
4. Migrate the JSON object (using `IArtifactJsonMigrator`).
106
+
5. Deserialize the JSON object into the artifact type.
107
+
6. Migrate the artifact (using `IArtifactMigrator`).
108
+
7. Initialize artifact processing (using `IServiceConnector.ProcessInit(...)`) and track deploy state with next passes.
109
+
7. For each next process pass (starting at the lowest initial next pass):
110
+
1. Process artifact (using `IServiceConnector.Process(...)`).
111
+
2. During processing: service connectors for content, media and members migrate property type values if a property editor alias has changed (using `IPropertyTypeMigrator`).
112
+
3. When no next pass is required (the deploy state returns -1 as next pass):
113
+
1. Publish an `ArtifactImportedNotification`.
114
+
2. Report the import process (using `IProgress.Report(...)`).
115
+
8. The Deploy scope is completed, causing all scoped notifications to be published to handlers implementing `IDistributedCacheNotificationHandler`) and completing the import.
116
+
117
+
## Details of Specific Migrations
90
118
91
119
Umbraco Deploy ships with migrators to handle the conversion of core property editors as they have changed, been removed or replaced between versions.
92
120
93
-
Open source migrators may be built by HQ or the community for property editors found in community packages. They will be made available for [use](https://www.nuget.org/packages/Umbraco.Deploy.Contrib) and [review](https://github.com/umbraco/Umbraco.Deploy.Contrib/tree/v13/dev/src/Umbraco.Deploy.Contrib/Migrators) via the `Umbraco.Deploy.Contrib` package.
121
+
Open source migrators may be built by HQ or the community for property editors found in community packages. They will be made available for [use](https://www.nuget.org/packages/Umbraco.Deploy.Contrib) and [review](https://github.com/umbraco/Umbraco.Deploy.Contrib/tree/v15/dev/src/Umbraco.Deploy.Contrib/Migrators) via the `Umbraco.Deploy.Contrib` package.
94
122
95
-
####Grid to Block Grid
123
+
### Grid to Block Grid
96
124
97
-
The grid editor introduced in Umbraco 7 has been removed from Umbraco 14. It's functionality is replaced with the Block Grid.
125
+
The Grid editor introduced in Umbraco 7 has been removed from Umbraco 14. Its functionality is replaced with the Block Grid.
98
126
99
127
With Deploy migrators we have support for migrating Data Type configuration and property data between these property editors.
100
128
101
-
You can configure the default migration with the following composer:
129
+
Deploy adds the `ReplaceGridDataTypeArtifactMigrator` and `GridPropertyTypeMigrator` migrators by default, so using a custom migrator requires replacing the default ones:
102
130
103
131
```csharp
104
132
usingUmbraco.Cms.Core.Composing;
@@ -109,20 +137,24 @@ internal sealed class DeployMigratorsComposer : IComposer
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.
150
+
{% endhint %}
151
+
120
152
These implementations make use of the following conventions to migrate the data:
121
153
122
154
-`ReplaceGridDataTypeArtifactMigrator`:
123
155
- Grid layouts are migrated to an existing or new element type with an alias based on the layout name, prefixed with `gridLayout_` (this can be customized by overriding `MigrateGridTemplate()`);
124
156
- Row configurations are migrated to an existing or new element type with an alias based on the row name, prefixed with `gridRow_` (this can be customized by overriding `MigrateGridLayout()`);
125
-
- Similarly, grid editors are migrated to an existing or new element type with an alias based on the editor alias, prefixed with `gridEditor_` (this can be customized by overriding `MigrateGridEditor()`). The available editors are retrieved from the `grid.editors.config.js` files (can be overridden in `GetGridEditors()`). Each migrated grid editor will have the following property types added to the element type:
157
+
- Similarly, grid editors are migrated to an existing or new element type with an alias based on the editor alias, prefixed with `gridEditor_` (this can be customized by overriding `MigrateGridEditor()`). The default editors used in version 13 are returned by `GetGridEditors()` and you can override this method to include your custom editors. Each migrated grid editor will have the following property types added to the element type:
126
158
- The `media` grid editor is migrated to multiple properties: the `value` property contains the selected media item (using Media Picker v3), `altText` the alternate text (using a Textbox) and `caption` the caption (also using a Textbox);
127
159
- The remaining grid editors create a single `value` property that uses the following editors:
128
160
-`rte` - the default 'Rich Text Editor', falling back to the first `Umbraco.TinyMCE` editor.
@@ -170,7 +202,7 @@ The base classes provide the following functionality. Methods you should look to
170
202
- Similarly, if a layout block can be found for the grid layout name, all items are wrapped into that block.
171
203
- The JSON serialized `BlockValue` is returned.
172
204
173
-
####Migrating From Doc Type Grid Editor
205
+
### Migrating From Doc Type Grid Editor
174
206
175
207
[Doc Type Grid Editor](https://our.umbraco.com/packages/backoffice-extensions/doc-type-grid-editor/) was a community package commonly used with the legacy grid editor. If you are using this with Umbraco 7 and up, you can export and migrate into the Block Grid on Umbraco 13 or above.
176
208
@@ -200,7 +232,11 @@ The migrators add the following behavior:
200
232
-`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.
201
233
-`DocTypeGridEditorPropertyTypeMigrator` extends `GridPropertyTypeMigrator` and ensures the Doc Type Grid Editor values are mapped one-to-one to the block item data.
202
234
203
-
#### Migrating from Matryoshka
235
+
{% hint style="info" %}
236
+
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.
237
+
{% endhint %}
238
+
239
+
### Migrating from Matryoshka
204
240
205
241
[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.
206
242
@@ -224,7 +260,7 @@ internal sealed class DeployMigratorsComposer : IComposer
224
260
}
225
261
```
226
262
227
-
###Source Code Example - Nested Content to Block List
263
+
## Source Code Example - Nested Content to Block List
228
264
229
265
As described above, the nested content to block list migration will occur register the corresponding migrator with your application.
0 commit comments