New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add legacy migrators and type resolver to allow importing from Umbraco 7 #61
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updating DTGE connector to make use of mockContentGrid being introduc…
ronaldbarendse
force-pushed
the
v4/feature/import-legacy-artifacts
branch
from
February 26, 2024 16:27
4f881de
to
421ec50
Compare
To test the legacy migrators in v10 and up, you can use the following composer: using Umbraco.Cms.Core.Composing;
using Umbraco.Deploy.Contrib.Migrators.Legacy;
internal class LegacyImportComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.DeployArtifactTypeResolvers()
.AddLegacyTypeResolver();
builder.DeployArtifactMigrators()
.AddLegacyMigrators()
.Append<ElementTypeArtifactMigrator>();
}
private class ElementTypeArtifactMigrator : ElementTypeArtifactMigratorBase
{
public ElementTypeArtifactMigrator()
: base("testElement")
{ }
}
} I've created a very simple test site in v7 and used the export logic added in PR #60 to create the following ZIP archive: export-v7.zip. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To allow importing the ZIP archived created by the Umbraco 7 export (see PR #60), additional artifact migrators and a type resolver need to be configured.
This PR adds an
AddLegacyTypeResolver()
extension method to add the artifact type resolver, which handles the namespace changes of artifact types that occurred between v2 and v4.It also adds an
AddLegacyMigrators()
extension method that adds the artifact migrators to handle the large amount of changes between Umbraco 7 and 8:Umbraco.CheckBoxList
(pre-values to value list)Umbraco.ColorPickerAlias
toUmbraco.ColorPicker
(pre-values to value list)Umbraco.ContentPicker2
toUmbraco.ContentPicker
(removes invalid start node ID)Umbraco.ContentPickerAlias
toUmbraco.ContentPicker
(removes invalid start node ID)Umbraco.Date
toUmbraco.DateTime
Umbraco.DropDown
toUmbraco.DropDownListFlexible
(pre-values to value list, single item select)Umbraco.DropDownListFlexible
(pre-values to value list, defaults to multiple item select)Umbraco.DropdownlistMultiplePublishKeys
toUmbraco.DropDownListFlexible
(pre-values to value list, defaults to multiple item select)Umbraco.DropdownlistPublishingKeys
toUmbraco.DropDownListFlexible
(pre-values to value list, defaults to single item select)Umbraco.DropDownMultiple
toUmbraco.DropDownListFlexible
(pre-values to value list, defaults to multiple item select)(already handled by the pre-values data type migrator now)Umbraco.Grid
(already handled by the pre-values data type migrator now)Umbraco.ImageCropper
(already handled by the pre-values data type migrator now)Umbraco.ListView
Umbraco.MediaPicker2
toUmbraco.MediaPicker
(removes invalid start node ID, defaults to single item select)Umbraco.MediaPicker
(removes invalid start node ID)Umbraco.MemberPicker2
toUmbraco.MemberPicker
Umbraco.MultiNodeTreePicker2
toUmbraco.MultiNodeTreePicker
(removes invalid start node ID)Umbraco.MultiNodeTreePicker
(removes invalid start node ID)Umbraco.MultipleMediaPicker
toUmbraco.MediaPicker
(removes invalid start node ID, defaults to multiple item select)(already handled by the pre-values data type migrator now)Umbraco.NestedContent
Umbraco.NoEdit
toUmbraco.Label
Umbraco.RadioButtonList
(pre-values to value list, change database type from integer to nvarchar)Umbraco.RelatedLinks2
toUmbraco.MultiUrlPicker
Umbraco.RelatedLinks
toUmbraco.MultiUrlPicker
Umbraco.Textbox
toUmbraco.TextBox
Umbraco.TextboxMultiple
toUmbraco.TextArea
Umbraco.TinyMCEv3
toUmbraco.TinyMCE
Umbraco.CheckBoxList
Umbraco.DropDown.Flexible
Umbraco.RadioButtonList
Some of these migrators use base classes that contain shared migration logic (and can be used to create your own migrators). I've also added an
ElementTypeArtifactMigratorBase
class that allows you to configure which document types need to be marked as element types (a concept added in Umbraco 8), so they can be used in Nested Content data types: