umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.37k stars 2.64k forks source link

Timeout in migration to Umbraco 12 #16348

Open bjarnef opened 1 month ago

bjarnef commented 1 month ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

12.0.0

Bug summary

On a Umbraco Cloud project we struggled a lot with timeout in migration from latest v10 to v12.0.0.

Initially it worked fine with a slim version of database, but after a restore of the live database locally, we had to increase connection timeout in connection string locally, but it succeeded.

However after deployment to Development (and later Live) environment, we could never get this to run successfully on Umbraco Cloud because the connection timeout before migration finished. https://github.com/umbraco/Umbraco-CMS/blob/v13/dev/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs#L66-L89

I guess it was due the amount of content as there are a lot or course and category nodes.

However to solved this we had to deployment changes to Development, connect project on local to development with increased connection timeout, run migration and afterwards restart application.

We have to do the same for live environment.

Unfortunately there doesn't seen to be an option to increase connection timeout on Umbraco Cloud in this scenario and Azure has a harder limit than localhost.

I wonder if there is any option to trigger migration one at the time? or perhaps run one manually at the time on Umbraco Cloud as it sometimes seems to be an issue in projects on Umbraco Cloud with much content. But I guess it may also be an issue on traditional Azure.

Specifics

No response

Steps to reproduce

Run migration for a project with a lot on content on Umbraco Cloud (Azure) from latest v10 to v12.0.0 (or latest v12, but we used 12.0.0 to limit the number of migrations it needed to run).

Expected result / actual result

No response

github-actions[bot] commented 1 month ago

Hi there @bjarnef!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

bjarnef commented 1 month ago

While inspecting the umbracoKeyValue while the migration was in progress I only noticed it went from e.g. AddBlockGridPartialViews {3F5D492A-A3DB-43F9-A73E-9FEE3B180E6C} to ResetCache {539F2F83-FBA7-4C48-81A3-75081A56BB9D}

I could be wrong, but not sure if the value was updated for each step? If not could it run in sequence via a config for example, so it the is finished a migration but connection timeout, it doesn't have to start over with all steps when application recycle / run again.

bjarnef commented 1 month ago

Initially we also tried removing the Umbraco.Core.Upgrader.State+Umbraco.Core to run migration from initial state, which didn't seem to finish, but as we were on latest v10, we added {EF93F398-1385-4F07-808A-D3C518984442} but we got the error:

The migration plan does not support migrating from state "{EF93F398-1385-4F07-808A-D3C518984442}"

However this helped us after we set value to {56833770-3B7E-4FD5-A3B6-3416A26A7A3F} which ran the migration. https://our.umbraco.com/forum/using-umbraco-and-getting-started/113081-upgrade-from-1070-to-1100-unable-to-happen

Danielh21 commented 1 month ago

Hi Bjarne

I think I have a similar problem, I reported here: https://our.umbraco.com/forum/using-umbraco-and-getting-started/113921-issue-upgrading-the-database-when-upgrading-umbraco-from-12-to-13

However this is from version 12.1.1 to 13.2.2 I don't get anything from the logs, but when i click "view report" it shows an upgrade from 13.0.0 to 13.2.2 which is wrong.

However I have an issue in finding the GUID for my version [12.1.1][1] https://github.com/umbraco/Umbraco-CMS/blob/release-12.1.2/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs

Looking at the properties of the dll it suggest that it starts with "0230b25", but I'm not sure.

Where should I look for the GUID for 12.1.1?