Skip to content

Question: Using usync first boot pattern as an alternative to packageMigrationPlan?? #746

@mistyn8

Description

@mistyn8

I wonder if it's ever crossed your path to perhaps use UsyncFirst boot pattern as part of a package migration plan to install a starter set of doctypes/datatypes/templates?

I seem to find myself constantly battling with the foibles of the legacy package migration
https://docs.umbraco.com/umbraco-cms/extending/packages/creating-a-package

Most especially templates where the view should come from the nuget package (as RCL) but is then immediately overrwritted by the template in plain text in the package.xml file process..
Not to mention that docytpes can be updated/merged via the package.xml but datatypes if existing are just ignored.

So I find myself reinventing the uSync wheel and programatically manipulating datatypes in the migration..

var footerBlockConfiguration = igFooterBlockList.Configuration as BlockListConfiguration;
var footerBlocks = footerBlockConfiguration.Blocks.ToList();

// Login widget
IContentType loginContentType = _contentTypeService.Get(loginKey);
IContentType loginSettingsContentType = _contentTypeService.Get(loginSettingsKey);

if (loginContentType is null || loginSettingsContentType is null) { errors.Add("login", "login content types not found"); }

// check we don't already have the block in the config somehow
if (!errors.ContainsKey("login") && !footerBlocks.Exists(x => x.ContentElementTypeKey == loginContentType.Key))
{
    footerBlocks.Add(new BlockListConfiguration.BlockConfiguration
    {
        ContentElementTypeKey = loginContentType.Key,
        SettingsElementTypeKey = loginSettingsContentType.Key,
        Label = "Login"
    });

}

just thought this could be a migration plan that takes a set of uSync config files from the package and processes them ?? (bit like first boot, but just as part of a migration plan) and I can stand on the shoulders of giants.. ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions