Migrated Nested Content to block list with Umbraco Deploy

I’m trying to convert nested content to block lists using Umbraco Deploy. There is a nice article about this in the docs: Import and Export with Migrations | Deploy | Umbraco Documentation . There is also another topic from Owain that provides additional information: Using Umbraco Deploy on Premise to Migrate from U13 -> U17 - #12 by OwainWilliams .

But whatever I do, it just can’t get the content to be converted. Maybe I’m missing something, but I’ve tried a lot of combinations. And since Umbraco Deploy is not open source I cannot check what I can do about it. This is all local with SQL Local DB. Has anyone got this working correctly?

After the upgrade, I’m not going to continue using Deploy. I just want to upgrade the nested content to block lists. If it’s possible to do the conversion on the Umbraco 13 database BEFORE upgrading to Umbraco 17, it would even be better.

Setup Umbraco 13 + export

  1. I created a new, empty Umbraco 13.13.0 website and made sure everything is up and running.

  2. Not sure if it’s needed in the Umbraco 13, project, but I added a composer:
    using Umbraco.Cms.Core.Composing;
    using Umbraco.Deploy.Infrastructure.Migrators;

    internal class ArtifactMigratorsComposer : IComposer
    {
    public void Compose(IUmbracoBuilder builder)
    {
    builder.DeployArtifactMigrators()
    .Append()
    .Append();

        builder.DeployPropertyTypeMigrators()
            .Append<NestedContentPropertyTypeMigrator>()
            .Append<MediaPickerPropertyTypeMigrator>();
    }
    

    }

  3. I then connected the Umbraco 13 database that I want to upgrade/convert to the Umbraco 13 instance.

  4. I added the following packages to make sure all property editors are available that are in the database:

    1. SEOChecker - 13.6.2
    2. Skybrud.Umbraco.Redirects - 13.0.8
    3. Umbraco.Cms - 13.13.0
    4. Umbraco.Deploy.Contrib - 13.3.1
    5. Umbraco.Deploy.OnPrem - 13.4.3
    6. Umbraco.Forms - 13.9.0
    7. Umbraco.ThuisartsConnector - 4.0.0 (internal package)
    8. Umbraco.VideoPlayer - 6.1.2 (internal package)
    9. Umbraco.ContentExpiration - 2.2.0 (internal package)
  5. In deploy (via Settings > Deploy) export + clean the schema to make sure it’s up to date.

So now we should be ready for an export. I made three different exports to try different things:

  1. Export only the schema via Settings > Deploy > Download Deploy Artifacts

  2. Create an export of only the content

  3. And an export of everything (except files because they are not available anyway)

Setup Umbraco 17

Now that I have the exported files, we can try to update Umbraco and import the files. Owain suggested to do this manually and not automatically at startup. So:

  1. I created a new Umbraco 17 project (17.1.0) and made sure everyting is up and running.

  2. I then connected a copy of the Umbraco 13 database that I want to upgrade/convert to the Umbraco 17 instance.

  3. I added the following packages to make sure all property editors are available that are in the database:

    1. SEOChecker - 17.0.1
    2. Skybrud.Umbraco.Redirects - 17.0.1
    3. Umbraco.Cms - 17.1.0
    4. Umbraco.Deploy.Contrib - 17.0.0
    5. Umbraco.Deploy.OnPrem - 17.0.1
    6. Umbraco.Forms - 17.1.3
    7. Umbraco.ThuisartsConnector - 17.0.0-beta (internal package)
    8. Umbraco.VideoPlayer - 17.0.0-beta (internal package)
  4. I also added the composer:
    using Umbraco.Cms.Core.Composing;
    using Umbraco.Deploy.Infrastructure.Migrators;

    internal class ArtifactMigratorsComposer : IComposer
    {
    public void Compose(IUmbracoBuilder builder)
    {
    builder.DeployArtifactMigrators()
    .Append()
    .Append();

        builder.DeployPropertyTypeMigrators()
            .Append<NestedContentPropertyTypeMigrator>()
            .Append<MediaPickerPropertyTypeMigrator>();
    }
    

    }

  5. Run Umbraco and let it upgrade the database to Umbraco 17.

The database is now Umbraco 17 and it’s (rightfully) complaining that Nested Content is not available, but the database is updated to Umbraco 17 without issues:

Import and convert

So now it’s time to start an import and migrate us some nested content.

Only the schema

At first I only imported the schema:

This already causes a relation error:

System.InvalidOperationException: Could not update existing relation type (operation status: InvalidChildObjectType).
Umbraco.Deploy.Core.Exceptions.ProcessArtifactException: Process pass #0 failed for artifact umb://relation-type/0b93e4145abe36eca6bb516e56f12238.
Umbraco.Deploy.Core.Exceptions.ImportArtifactsUnhandledException: An unhandled exception has occurred during the import.

I removed the relations uda files from the zip and tried again and that worked.

The nested content is properly converted and the blocks are created. However, the content is not converted and every block list is empty.

image

So somehow expected that the change in data editors would prompt the content conversion, but that doesn’t seem to work.

Import content

So now also import content from the second export file that only has the content:

Once again, errors:

Umbraco.Deploy.Core.Exceptions.ImportArtifactsUnhandledException: An unhandled exception has occurred during the import.
   at Umbraco.Deploy.Infrastructure.Work.WorkItems.ImportWorkItem.ExecuteAsync(IWorkContext context, CancellationToken cancellationToken)
   at Umbraco.Deploy.Infrastructure.Work.WorkItems.ImportWorkItem.ExecuteAsync(IWorkContext context, CancellationToken cancellationToken)

INNER:
  Umbraco.Deploy.Core.Exceptions.ProcessArtifactException: Process pass #5 failed for artifact umb://document/5118cf7e83da4428b0093128e8d6222f.
     at Umbraco.Deploy.Infrastructure.ArtifactImportExportService.ImportArtifactsAsync(IArtifactImportProvider artifactImportProvider, ImportArtifactOptions options, IProgress`1 progress, CancellationToken cancellationToken, String[] entityTypes)
     at Umbraco.Deploy.Infrastructure.Work.WorkItems.ImportWorkItem.ExecuteAsync(IWorkContext context, CancellationToken cancellationToken)

  INNER:
    System.Text.Json.JsonException: Expected start object
       at Umbraco.Cms.Infrastructure.Serialization.JsonBlockValueConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)

I can’t seem to be able to fix this. The content doesn’t seem to get converted because I think the JSON parser expects the converted JSON object and not the nested content array. But I don’t seem to be able to get the content to work and because I can’t check the source code and there is no more information in the documentation, I don’t know what else to try and even if I’m doing it right.

  • What exactly should I need to export from Umbraco 13 and import into Umbraco 17?
  • Do I need to create all the uda files on Umbraco 17 before importing anything or not?
  • Does this even work on a non-empty database?
  • Could I do this migration in Umbraco 13, so upgrade nested content in my 13.13 database in place?