Upgrading from v10 to v13
d
Is there documentation or any good articles for Upgrading from v10 to v13? Do I need to go through 11 and 12 first? I have already run into this error going from 10 to 11:
Copy code
Error during installation
The database failed to upgrade. ERROR: The database configuration failed with the following message: The migration plan does not support migrating from state "{83AF7945-DADE-4A02-9041-F3F6EBFAC319}".
d
Hi Dean! I managed to update a website straight from v10 to v13. I don't know if there are any docs, but it's my understanding that you should always update to the latest minor first before moving to the next major
d
Thank you - that's promising. Good call I will upgrade to the latest minor of 10
k
It's absolutely required to upgrade to the latest current before upgrading. Also, if you use other things that also need upgrading, like Umbraco Forms, check that they can also upgrade from 10 to 13. For us, Umbraco itself has always upgraded without problems, but Forms has been trickier.
a
Interesting, I've always upgraded to each successive version (10 > 11 > 12 > 13). I've had no problems doing this, but I've never tried a direct 10 > 13 upgrade. Are such direct upgrades (ex. 10 > 13) "ok"? Is it possible that updates from 11, 12 may not carry over correctly in such a scenerio?
d
I don't expect any trouble from a direct upgrade. Especially now that Umbraco uses migrations, Umbraco simply does each step internally. That's how I understand it at least.
j
Pretty sure Umbraco routinely cleans up migrations from older versions, so a v13 site may not have the 9->10 migrations anymore. Unsure how often and how far back they do it though, but I'd probably not go outside the LTS -> LTS versions for a direct upgrade.
s
> It's absolutely required to upgrade to the latest current before upgrading. It's not! 😅 > Pretty sure Umbraco routinely cleans up migrations from older versions, so a v13 site may not have the 9->10 migrations anymore. Good thing he's already on v10, but yes, think we remove the migrations from anything before the LTS in the next LTS. So v10 has v9 -> v10 migrations. v13 has v10 -> v13 migrations (but not the v9 ones) and v16 will have the v13 -> v16 migration but not anything before v13. The error suggests that your're on a version lower than 10.5?
Copy code
csharp
// To 10.5.0 / 11.2.0
        To<V_10_5_0.AddPrimaryKeyConstrainToContentVersionCleanupDtos>("{83AF7945-DADE-4A02-9041-F3F6EBFAC319}");
d
I have made a new test site and took the following steps: 1. Install .Net 8 (alredy installed) 2. Upgraded Umbraco to 10.8.3 3. In reposnse to an error added via nuget 4. I am now back where I started with:
Copy code
Error during installation
The database failed to upgrade. ERROR: The database configuration failed with the following message: The migration plan does not support migrating from state "{EF93F398-1385-4F07-808A-D3C518984442}". Please check log file for additional information (can be found in '~/umbraco/Logs')
This is before attempting to upgrade to v13
s
That's the next migration:
Copy code
csharp
// to 10.7.0
To<MigrateTagsFromNVarcharToNText>("{EF93F398-1385-4F07-808A-D3C518984442}");
> Upgraded Umbraco to 10.8.3 From? > In reposnse to an error added via nuget
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0-preview4.23342.2" />
Why install preview builds?
Are you sharing this db with someone else? Usually things happen when someone has ran the upgrader and someone else is running an older verion against the now upgraded database.
I am not sure what the problem is, people seem to take unusual upgrade paths that can't be described properly. So in a case like this, I would go in and reset the migrations to pretend it was still on v10.0.0, which according to https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs#L57 is
{B7E0D53C-2B0E-418B-AB07-2DDE486E225F}
, so you would find that in the
umbracoKeyValue
table where the key is
Umbraco.Core.Upgrader.State+Umbraco.Core
(see first screenshot) I believe each migration first tests if it is a necessary operation and then does the operation, that way, each migration is being executed if it had not been before (this seems to happen sometimes for reasons unknown). I'd upgrade straight to v13.0.0, don't forget to update the solution to .net 8 first (each csproj file should have
<TargetFramework>net8.0</TargetFramework>
in it at the top). See second screenshot. https://cdn.discordapp.com/attachments/1191645056877219961/1192072799364337664/image.png?ex=65a7bf4f&is=65954a4f&hm=08bb8ca2fdd1e2436eba0b9f4227e29e069495f92c7a62a39054655ce9779c0a& https://cdn.discordapp.com/attachments/1191645056877219961/1192072799704068096/image.png?ex=65a7bf4f&is=65954a4f&hm=97c831557606fe40742e0df5fee2a3f5417956db68e92bcbd728204829f0a582&
Ps. If at all possible I would love to see a zip file of your whole solution plus a backup of the database. As I said before, it's unknown how people get into a state where this message happens, maybe we can find something the help prevent this.
d
Thanks Seb - I have a few more things to try It was from Umbraco 10.6.1 - I was taking the advice to upgrade the minor before attempting v13
You could run
Copy code
dotnet new umbootstrap
and you will get the exact site I am upgrading
s
I get a different error that I can't get around at the moment
Copy code
Error during installation
The database failed to upgrade. ERROR: The database configuration failed with the following message: The process cannot access the file 'E:\Dev\Temp\testupgrade\umbraco\Data\TEMP\NuCache\NuCache.Content.db' because it is being used by another process. Please check log file for additional information (can be found in 'LoggingSettings.Directory')

See the log for full details (logs can typically be found in the umbraco\Logs folder).
But the db upgrade seems fine. I tried straight from 10 to 13 (on umbootstrap). https://cdn.discordapp.com/attachments/1191645056877219961/1192092053920808960/image.png?ex=65a7d13d&is=65955c3d&hm=712cc9174d3ee97269df40a7d68cafc5164e9c32d69b97702109297b34965ec8&
j
I've had that problem on every site I upgraded to 13. If you stop the site and delete the temp folder then run again it goes away
s
Yep, then it runs smoothly. Seems like a bug though, shouldn't be necessary to delete that manually!
But yeah, no other problems, went from 10.6.1 straight to 13. Steps: -
dotnet new install Umbraco.Community.Templates.UmBootstrap::0.1.9
-
dotnet new umbootstrap
- run the website, see it working - stop the website - update csproj file to have the latest references (see below) - delete
umbraco\Data\TEMP\NuCache\*.*
- run the website again - run the upgrade wizard - done
Copy code
xml
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Our.Umbraco.UmbNav.Web" Version="3.0.0" />
    <PackageReference Include="System.Drawing.Common" Version="8.0.0" />
    <PackageReference Include="Umbraco.Cms" Version="13.0.3" />
  </ItemGroup>

  <ItemGroup>
    <!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
    <PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
    <PackageReference Include="Umbraco.Community.BlockPreview" Version="1.8.0" />
    <PackageReference Include="uSync" Version="13.0.0" />

etc. ---- the rest is unchanged
So updated is
TargetFramework
and most
PackageReference
(not
Microsoft.ICU.ICU4C.Runtime
).v
d
Thank you all - "delete umbraco\Data\TEMP\NuCache\*.* " seemed to the step I was missing . Hopefully UmBootstrap will be v13 going forward.
s
I am 99.999% sure the NuCache error might be fixed here, I'll test again when 13.1 RC is out later this week. https://github.com/umbraco/Umbraco-CMS/pull/14940
s
we had the problem of nucache lock too, adding unattended upgrade to the appsettings helped fix that for us (instead of having to remove the temp folder)
s
Good news! v13.1.0 has fixed the NuCache locking problem! vsilvar is to thank for that one! 🎉 🎉 🎉
d
Fantastic! Time to upgrade UmBootstrap core in that case
96 Views