Using Umbraco Deploy on Premise to Migrate from U13 -> U17

Hi,
I have an Umbraco 13.13.0 site which I’ve installed Umbraco Deploy On Premise on to. Ive then exported the entire site to a zip file via Deploy.

I then have a Umbraco 17 site, with Umbraco Deploy On Premise installed and I copy the zip file in to /umbraco/deploy/import-on-startup.zip

I’ve also added

builder.DeployArtifactMigrators().Append<ReplaceNestedContentDataTypeArtifactMigrator>()
    .Append<ReplaceMediaPickerDataTypeArtifactMigrator>();

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

To my DIComposer within
public void Compose(IUmbracoBuilder builder)

So when I spin up the site - I would expect all my MediaPicker datatypes to be converted to MediaPicker3 and my Nested Content converted so everything should contine to work in Umbraco 17.

However, when I view the backoffice I get told that MediaPicker is obsolete and I should update to MediaPicker3.

Where have I gone wrong with this migration?

And then typically - it now works.
I just commented out some code that was throwing error and moved the Deploy Migrators to the top of my Composer file. Not sure which was fixed it, maybe a combination of the two. I’m going to rerun the deployment importer again on a clean setup just to make sure I can replicate the fix.

Curious about the solution. I’m going to need to upgrade some old project that still uses Nested Content and macro’s and MediaPicker < 3 instances, so I’m curious if this is the way!

So I’ve tried a few options and this seems to be a possible.
Just testing something again to see if I can replicate the fixes.

My rough plan so for is :

Install a clean Umbraco 13 instance, install Deploy, point it at the website database, this means the database is upgraded to the latest 13 version. Export the website using Deploy via the backoffice.

Install a clean Umbraco 17 instance, point it at the website database that you’ve just updated to 13.
Install Deploy and I’ve also installed the Deploy Contrib package - which has some community migrations setup too. Not sure if I need them or not but playing safe.

Before I spin up the Umbraco 17 site, I take a DB backup just so rolling back is quick and easy.

Spin up the Umbraco 17 instance and let the migrations run, this should now mean the MediaPicker and Nested Content are all migrated and the database is in a state of 17.

Now the actually website needs to be upgraded to the same version of 17 and you need to fix all the code issues :smiley: But you should be able to point it at the Umbraco 17 database and get things working.

Thats the plan.

1 Like

Yes in my opinion that is a very sound plan: update the database first, then the code.

1 Like

Annoyingly, for some reason I can’t get deploy to kick in every single time. So just now I have a file called import-on-startup.zip which “should” get read by Deploy since it’s within umbraco\Deploy\ folder however, it never gets deleted / archived.
I’ve even updated the appsettings to see if that helps e.g. Enable Deploy. But nothing.

This should be a simple export / import job but it’s now taking me days to get it to work consistently.

Tomorrow I will try a clean Umbraco 16 setup and see if it’s an Umbraco 17 issue.

1 Like

Looking back at your comments and stuff have you torn apart your code and put some logging in so each time it’s does a migration and fails you can get useful information

also if in doubt take it out have you tried doing each of the migrations separately to see if you can isolate it to a specific set of dst or data type

My thoughts are if you can track down the failure with logging

Eg do it with known data set of thirty media types and then see if there is as A commonality

Basically log when a migration is occurring what data type if its and guid and start

Finish and error

And take that approach with the other one also

So I’ve been doing a lot of similar migrations to this recently except not using the “Deploy on startup” side of it because I found a lot of the time migrators were falling over themselves a lot trying to do Schema + Content together.

The bit of advice I was given in the past is to attempt Schema only imports first, then follow it up with a content export only after the schema only export succeeds.

I ended up doing my imports manually to ensure that occurred but Ronald on the issue tracker also provided a little snippet of the appsettings to do the deploy in stages not sure if that might be useful to you if you havent set it up this way already? Legacy Migrators for V7 to new V16 fail to transfer content. · Issue #276 · umbraco/Umbraco.Deploy.Issues · GitHub

It might not resolve the issue but batching the deploy might help?

1 Like

Great! Thanks @TomChancer - Im actually in the middle of chunking stuff up in to small imports and doing a manual import via the “import” menu option in the backoffice. Hoping that helps :slight_smile:

So, it looks like small chunks is the way forward and also doing it manually instead of the import-on-startup.zip

Thanks everyone for the help.

In case anyone else comes across this with similar issues -
Clean Umbraco 13 with

Umbraco.Deploy.OnPrem
Umbraco.Deploy.Contrib

Then do a manual export of just schema, then just content and make smaller zip files that way, instead of including everything in one zip, especially if you have a large site, which I do.

Then get a Clean Umbraco 17 install setup, install the Umbraco.Deploy packages on there too. Then in the backoffice, import the zip files individually. Dont forget to also setup the composer on the Umbraco 17 site too:

using Umbraco.Cms.Core.Composing;
using Umbraco.Deploy.Infrastructure.Migrators;

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

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

That should hopefully get you up and running!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

I made a follow up topic because I can’t get this to work, but didn’t want to hijack this topic :wink: