Skip to content

Commit 61b081b

Browse files
committed
Add 15 stuff and also #6533
1 parent f2c8f13 commit 61b081b

File tree

4 files changed

+70
-27
lines changed

4 files changed

+70
-27
lines changed

15/umbraco-cms/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
* [Property Editors](fundamentals/backoffice/property-editors/README.md)
3131
* [Built-in Property Editors](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/README.md)
3232
* [Image Cropper](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/image-cropper.md)
33+
* [Block Editors](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/README.md)
34+
* [Block Grid](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor.md)
3335

3436
## Implementation
3537

@@ -83,6 +85,7 @@
8385
* [Web routing](reference/configuration/webroutingsettings.md)
8486
* [Querying & Models](reference/querying/README.md)
8587
* [ITagQuery](reference/querying/itagquery.md)
88+
* [UmbracoContext helper](reference/querying/umbraco-context.md)
8689
* [Routing & Controllers](reference/routing/README.md)
8790
* [Routing in Umbraco](reference/routing/request-pipeline/README.md)
8891
* [IContentFinder](reference/routing/request-pipeline/icontentfinder.md)

15/umbraco-cms/release-candidate-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ Here is a list of all the articles that are new to this version or have been upd
7979
* [Working with Caching: Tags example](reference/cache/examples/tags.md)
8080
* [Unit Testing](implementation/unit-testing.md)
8181
* [Querying: ITagQuery](reference/querying/itagquery.md)
82+
* [UmbracoContext helper](reference/querying/umbraco-context.md)
83+
* [Block Grid](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor.md)
8284

8385
* Replacing the deprecated GetAll() method
8486
* [Working with Caching: Tags example](reference/cache/examples/tags.md)

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
meta.Title: Migrating from Umbraco 7
32
description: How to export content and schema from Umbraco 7 and import into a newer version
43
---
54

6-
### Migrating from Umbraco 7
5+
# Migrating from Umbraco 7
76

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.
98

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.
1110

12-
#### Exporting Umbraco 7 content and schema
11+
## Exporting Umbraco 7 content and schema
1312

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.
1514

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

@@ -88,7 +87,7 @@ public class DeployExportApplicationHandler : ApplicationEventHandler
8887

8988
</details>
9089

91-
#### Importing Umbraco 7 content and schema
90+
## Importing Umbraco 7 content and schema
9291

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

@@ -150,6 +149,9 @@ internal class LegacyImportComposer : IComposer
150149
builder.DeployArtifactMigrators()
151150
.AddLegacyMigrators()
152151
.Append<ElementTypeArtifactMigrator>();
152+
153+
builder.DeployPropertyTypeMigrators()
154+
.AddLegacyMigrators(); // Available from Deploy Contrib 13.3.0 and 14.2.0+
153155
}
154156

155157
private class ElementTypeArtifactMigrator : ElementTypeArtifactMigratorBase
@@ -167,23 +169,23 @@ internal class LegacyImportComposer : IComposer
167169
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.
168170
{% endhint %}
169171

170-
#### Obtaining Umbraco Deploy for Umbraco 7
172+
## Obtaining Umbraco Deploy for Umbraco 7
171173

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

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

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.
177179

178180
The export feature can be used without a license.
179181

180182
{% hint style="info" %}
181183

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.
183185

184186
{% endhint %}
185187

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.
187189

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

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

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
meta.Title: Import with migrations in Umbraco Deploy
32
description: How to import content and schema while migrating them into newer alternatives
43
---
54

@@ -15,7 +14,7 @@ For example, we can migrate from a Nested Content property in Umbraco 8 to a Blo
1514

1615
We provide the necessary migration hooks for this to happen, divided into two types - **artifact migrators** and **property migrators**.
1716

18-
### Artifact migrators
17+
## Artifact migrators
1918

2019
Artifact migrators work by transforming the serialized artifact of any imported artifact, via two interfaces:
2120

@@ -37,7 +36,7 @@ We've also made available base implementations that you can use to build your ow
3736
- `ArtifactJsonMigratorBase<TArtifact>` - migrates the JSON of the specified artifact type
3837
- `ReplaceGridDataTypeArtifactMigratorBase` - migrates a Data Type based on the legacy Grid layout into the Block Grid
3938

40-
### Property migrators
39+
## Property migrators
4140

4241
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:
4342

@@ -60,7 +59,7 @@ And a base type to help you build your own migrations:
6059
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.
6160
{% endhint %}
6261

63-
### Registering migrators
62+
## Registering migrators
6463

6564
Migrators will run if you have registered them, so you can enable only the ones needed for your solution.
6665

@@ -84,21 +83,50 @@ internal class ArtifactMigratorsComposer : IComposer
8483
.Append<MediaPickerPropertyTypeMigrator>();
8584
}
8685
}
87-
```
86+
```
8887

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
90118

91119
Umbraco Deploy ships with migrators to handle the conversion of core property editors as they have changed, been removed or replaced between versions.
92120

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.
94122

95-
#### Grid to Block Grid
123+
### Grid to Block Grid
96124

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.
98126

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

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:
102130

103131
```csharp
104132
using Umbraco.Cms.Core.Composing;
@@ -109,20 +137,24 @@ internal sealed class DeployMigratorsComposer : IComposer
109137
public void Compose(IUmbracoBuilder builder)
110138
{
111139
builder.DeployArtifactMigrators()
112-
.Append<ReplaceGridDataTypeArtifactMigrator>();
140+
.Replace<ReplaceGridDataTypeArtifactMigrator, CustomReplaceGridDataTypeArtifactMigrator>();
113141

114142
builder.DeployPropertyTypeMigrators()
115-
.Append<GridPropertyTypeMigrator>();
143+
.Replace<GridPropertyTypeMigrator, CustomGridPropertyTypeMigrator>();
116144
}
117145
}
118146
```
119147

148+
{% hint style="info" %}
149+
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+
120152
These implementations make use of the following conventions to migrate the data:
121153

122154
- `ReplaceGridDataTypeArtifactMigrator`:
123155
- 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()`);
124156
- 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:
126158
- 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);
127159
- The remaining grid editors create a single `value` property that uses the following editors:
128160
- `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
170202
- Similarly, if a layout block can be found for the grid layout name, all items are wrapped into that block.
171203
- The JSON serialized `BlockValue` is returned.
172204

173-
#### Migrating From Doc Type Grid Editor
205+
### Migrating From Doc Type Grid Editor
174206

175207
[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.
176208

@@ -200,7 +232,11 @@ The migrators add the following behavior:
200232
- `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.
201233
- `DocTypeGridEditorPropertyTypeMigrator` extends `GridPropertyTypeMigrator` and ensures the Doc Type Grid Editor values are mapped one-to-one to the block item data.
202234

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
204240

205241
[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.
206242

@@ -224,7 +260,7 @@ internal sealed class DeployMigratorsComposer : IComposer
224260
}
225261
```
226262

227-
### Source Code Example - Nested Content to Block List
263+
## Source Code Example - Nested Content to Block List
228264

229265
As described above, the nested content to block list migration will occur register the corresponding migrator with your application.
230266

0 commit comments

Comments
 (0)