Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pavan Kumar 11 posts 92 karma points notactivated
    Sep 23, 2019 @ 15:38
    Pavan Kumar
    0

    Umbraco 8 upgrade taking long time

    Hello,

    While upgrading Umbraco from 7.15.2 to Umbraco 8.1.4, we are facing issues with long migration time and timeouts.

    Our situation is

    • cmsContentVersion table has ~940K rows
    • cmsPropertyData table has ~10 million rows.

    When we were following the recommended steps for migration to Umbraco8, we were getting timeout errors. We then updated the timeout settings and after more than 12 hours its still running. This is resulting in hug DB size increase too.

    When we looked into the migration code, we found out where its taking time. Please take a look at below screenshot:

    enter image description here

    Looks like its loading all the >940K records from "cmsContentVersion" in memory and updating records into "cmsPropertyData". We think because it runs in a transaction, it is also resulting in big increse in DB size.

    Is there any better way to accomplish this step? (may be doing this in stored procedure?)

    Thoughts?

    Thanks

    Pavan

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Sep 23, 2019 @ 15:47
    Shaishav Karnani from digitallymedia.com
    0

    Hi Pavan,

    You can delete Version History and this should clear lot of your unused records.

    This link will help you to reduce the records. https://our.umbraco.com/forum/core/general/74365-remove-audit-trail-and-version-history

    Hope this helps to solve your issue.

    Cheers,

    Shaishav

  • Pavan Kumar 11 posts 92 karma points notactivated
    Sep 27, 2019 @ 10:33
    Pavan Kumar
    0

    Hi Shaishav,

    There was not much difference after running the script in the given link to clean the audit trail and version history. It has only come down by few thousands.

  • Steve Megson 151 posts 1024 karma points MVP c-trib
    Sep 25, 2019 @ 06:49
    Steve Megson
    1

    I'm working on some changes to improve the speed of upgrades. If you'd be interested in testing them, there's a modified version of Umbraco.Core.dll from 8.1.4 here.

    If it works for you, I'd appreciate a copy of the log file from the upgrade so that I can see where there's still room for improvement.

  • Pavan Kumar 11 posts 92 karma points notactivated
    Sep 27, 2019 @ 10:52
    Pavan Kumar
    0

    Hi Steve Megson,

    I have tried running the modified Umbraco.Core.dll for migration. The log file is updated only for the first 5 minutes and last log statement is 'ALTER TABLE [cmsPropertyData] ADD [versionId2] INTEGER NULL'. It keeps running and had to stop it after more than 12 hrs.

    Is it by any chance going into the foreach loop? enter image description here

    Is it a configuration setting to say that it is not a compact server?

  • Steve Megson 151 posts 1024 karma points MVP c-trib
    Sep 27, 2019 @ 11:28
    Steve Megson
    1

    How odd. The IsSqlCe test is based on the connection string's providerName, so that shouldn't be an issue. Can you check what it's actually running with something like

    SELECT sqltext.TEXT, req.session_id, req.status, req.start_time, req.command, req.cpu_time, req.total_elapsed_time
    FROM sys.dm_exec_requests req
    CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext 
    

    The query it should be running for SQL Server is still fairly unpleasant and slow, but it shouldn't be taking hours.

  • Pavan Kumar 11 posts 92 karma points notactivated
    Sep 30, 2019 @ 10:02
    Pavan Kumar
    0
    UPDATE cmsPropertyData SET versionId2=cmsContentVersion.id FROM cmsContentVersion INNER JOIN cmsPropertyData ON cmsContentVersion.versionId = cmsPropertyData.versionId
    

    It shows that the above query is running

  • Steve Megson 151 posts 1024 karma points MVP c-trib
    Sep 30, 2019 @ 13:15
    Steve Megson
    0

    Reassuring that it's not using the SQL CE version, though strange that it's taking so long. My test database has 8.5 million rows in cmsPropertyData and only takes a couple of minutes to run that query.

    You could do the change of the versionId column manually before starting the migration, and the migration should then quietly skip that bit. That might let you experiment with indexes to speed it up.

    This SQL should be what the migration runs, though you might need to drop an index or two first:

    ALTER TABLE cmsPropertyData ADD [versionId2] [int] NULL
    
    UPDATE cmsPropertyData SET versionId2=cmsContentVersion.id FROM cmsContentVersion INNER JOIN cmsPropertyData ON cmsContentVersion.versionId = cmsPropertyData.versionId
    
    ALTER TABLE cmsPropertyData DROP COLUMN [versionId]
    
    sp_rename 'cmsPropertyData.versionId2', 'versionId', 'COLUMN'
    
  • Pavan Kumar 11 posts 92 karma points notactivated
    Oct 03, 2019 @ 13:54
    Pavan Kumar
    0

    It finishes the given query in SSMS very fast, like in 3 mins. But this keeps running for hours from the application. As a workaround, i'm running the alter, update and rename query from SSMS before migration and then start Umbraco migration, now it is not getting stuck at the update query. I will let you know once the whole migration process is done. Thanks.

  • Pavan Kumar 11 posts 92 karma points notactivated
    Oct 04, 2019 @ 12:42
    Pavan Kumar
    0

    Hi Steve Megson,

    We are now getting an error in PostMigrations.

    {"@t":"2019-10-03T14:21:55.0051163Z","@mt":"Database configuration failed","@l":"Error","@x":"System.NotSupportedException: Surrogate pairs are not supported.\r\n   at Umbraco.Core.Strings.DefaultShortStringHelper.CleanCodeString(String text, CleanStringType caseType, Char separator, String culture, Config config)\r\n   at Umbraco.Core.Strings.DefaultShortStringHelper.CleanString(String text, CleanStringType stringType, String culture, Nullable`1 separator)\r\n   at Umbraco.Core.Strings.DefaultShortStringHelper.CleanStringForUrlSegment(String text, String culture)\r\n   at Umbraco.Core.StringExtensions.ToUrlSegment(String text, String culture)\r\n   at Umbraco.Core.Strings.DefaultUrlSegmentProvider.GetUrlSegment(IContentBase content, String culture)\r\n   at Umbraco.Core.Strings.ContentBaseExtensions.<>c__DisplayClass0_0.<GetUrlSegment>b__0(IUrlSegmentProvider p)\r\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)\r\n   at Umbraco.Core.Strings.ContentBaseExtensions.GetUrlSegment(IContentBase content, IEnumerable`1 urlSegmentProviders, String culture)\r\n   at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.GetDto(IContentBase content, Boolean published) in d:\\a\\1\\s\\src\\Umbraco.Web\\PublishedCache\\NuCache\\PublishedSnapshotService.cs:line 1356\r\n   at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.<RebuildMemberDbCacheLocked>b__82_1(IMember m) in d:\\a\\1\\s\\src\\Umbraco.Web\\PublishedCache\\NuCache\\PublishedSnapshotService.cs:line 1581\r\n   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()\r\n   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)\r\n   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)\r\n   at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.RebuildMemberDbCacheLocked(IScope scope, Int32 groupSize, IEnumerable`1 contentTypeIds) in d:\\a\\1\\s\\src\\Umbraco.Web\\PublishedCache\\NuCache\\PublishedSnapshotService.cs:line 1542\r\n   at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.Rebuild() in d:\\a\\1\\s\\src\\Umbraco.Web\\PublishedCache\\NuCache\\PublishedSnapshotService.cs:line 1393\r\n   at Umbraco.Web.Migrations.PostMigrations.PublishedSnapshotRebuilder.Rebuild() in d:\\a\\1\\s\\src\\Umbraco.Web\\Migrations\\PostMigrations\\PublishedSnapshotRebuilder.cs:line 27\r\n   at Umbraco.Core.Migrations.PostMigrations.RebuildPublishedSnapshot.Migrate()\r\n   at Umbraco.Core.Migrations.MigrationPlan.Execute(IScope scope, String fromState, IMigrationBuilder migrationBuilder, ILogger logger)\r\n   at Umbraco.Core.Migrations.Upgrade.Upgrader.Execute(IScopeProvider scopeProvider, IMigrationBuilder migrationBuilder, IKeyValueService keyValueService, ILogger logger)\r\n   at Umbraco.Core.Migrations.Install.DatabaseBuilder.UpgradeSchemaAndData(MigrationPlan plan)","SourceContext":"Umbraco.Core.Migrations.Install.DatabaseBuilder","ProcessId":14792,"ProcessName":"iisexpress","ThreadId":7,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"SLBLR-LT-209","Log4NetLevel":"ERROR","HttpRequestNumber":7,"HttpRequestId":"c6965a3d-c7ee-4be3-83ae-84250fb34d59"}
    

    Could you please share your source code repository or the branch name, so that we could debug and find out the error ?

  • Steve Megson 151 posts 1024 karma points MVP c-trib
    Oct 04, 2019 @ 13:39
    Steve Megson
    1

    Here's my repository: https://github.com/stevemegson/Umbraco-CMS/tree/v8/migration-performance

    It looks like you're back into unmodified code with that error, though. The cache is trying to generate clean versions of member names in the same way that document names get cleaned to generate URLs (I don't think we ever use a URL for a member anywhere, but the cache doesn't know that). I'd guess that the most likely reason for surrogate pairs in a member name is someone including emoji.

  • Roger Jarl 22 posts 115 karma points
    Nov 06, 2019 @ 12:27
    Roger Jarl
    0

    Thanks Steve for the hint about emojis. I also got the "Surrogate pairs are not supported" error. I removed the emojis from content, and then I successfully upgraded from Umbraco 7 to 8.

  • Pavan Kumar 11 posts 92 karma points notactivated
    Nov 06, 2019 @ 14:45
    Pavan Kumar
    0

    Thanks Steve. We were able to locate the emoji in UmbracoNode table and finished with the migration. Will your performance changes be pushed to the main Umbraco repository and be part of any upcoming release ?

  • tgtrajeev 4 posts 24 karma points
    Aug 28, 2021 @ 18:59
    tgtrajeev
    0

    hi Steve, We are facing this error. can you tell us how to find imojis and remove? Appreciate your help. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade. ERROR: The database configuration failed with the following message: Surrogate pairs are not supported. Please check log file for additional information (can be found in '/AppData/Logs/') at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model) in d:\a\1\s\src\Umbraco.Web\Install\InstallSteps\DatabaseUpgradeStep.cs:line 47 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Umbraco.Web.Install.Controllers.InstallApiController.14.MoveNext() in d:\a\1\s\src\Umbraco.Web\Install\Controllers\InstallApiController.cs:line 236 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Umbraco.Web.Install.Controllers.InstallApiController.

  • tgtrajeev 4 posts 24 karma points
    Aug 28, 2021 @ 19:00
    tgtrajeev
    0

    how did you find the imoji and removed. Please advise. We are also finding same issue.

  • Ben McKean 272 posts 549 karma points
    Sep 03, 2021 @ 15:49
    Ben McKean
    0

    This worked for me, had to go through a few tables:

    SELECT TOP (200) id, contentNodeId, versionId, propertytypeid, dataInt, dataDecimal, dataDate, dataNvarchar, dataNtext
    FROM  cmsPropertyData
    WHERE (CAST(dataNtext AS VARCHAR(80)) <> CAST(dataNtext AS NVARCHAR(80)))
    
  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Sep 26, 2022 @ 14:30
    Jesper Ordrup
    0

    Its still slow when upgrading to 8.5.5

    I was worried that the upgrade was in an errorstate. This is a great tip. I can see it actually does something.

    The two active queries where one is cycling between suspended and running makes me think that the migration script is using query and subquery - which will result in a huge amount of updates :-)

    enter image description here

  • Cimplex 113 posts 576 karma points
    Nov 05, 2019 @ 15:21
    Cimplex
    0

    Hi Steve, Were you able to upgrade your Umbraco installation to v8?

    I was stuck at the version migrations aswell and I ran your SQL Script to edit the version and it looks that worked but now it get stuck at

    {"@t":"2019-11-05T15:08:14.3468145Z","@mt":"SQL [{ContextIndex}]: {Sql}","ContextIndex":6954,"Sql":"ALTER TABLE [cmsContentVersion] DROP COLUMN [ContentId];","SourceContext":"Umbraco.Core.Migrations.Expressions.Delete.Expressions.DeleteColumnExpression","ProcessId":15604,"ProcessName":"w3wp","ThreadId":26,"AppDomainId":3,"AppDomainAppId":"LMW3SVC42ROOT","MachineName":"ZEUS","Log4NetLevel":"INFO ","HttpRequestNumber":7,"HttpRequestId":"d01d1728-323f-4174-ae95-d106fec35c4a"}
    {"@t":"2019-11-05T15:14:49.5133218Z","@mt":"SQL [{ContextIndex}]: {Sql}","ContextIndex":6955,"Sql":"CREATE TABLE [umbracoDocumentVersion] ([id] INTEGER NOT NULL,[templateId] INTEGER NULL,[published] BIT NOT NULL)","SourceContext":"Umbraco.Core.Migrations.Expressions.Execute.Expressions.ExecuteSqlStatementExpression","ProcessId":15604,"ProcessName":"w3wp","ThreadId":37,"AppDomainId":3,"AppDomainAppId":"LMW3SVC42ROOT","MachineName":"ZEUS","Log4NetLevel":"INFO ","HttpRequestNumber":6,"HttpRequestId":"96ebe6a2-a2de-4c79-af41-7a4575c44697"}
    

    Any ideas?

    // Herman

  • Pagggy 28 posts 71 karma points
    Jul 18, 2020 @ 10:39
    Pagggy
    0

    Hi Cimplex, I am struck on the same step. Did you find any solution? Thanks

  • Chris Mahoney 242 posts 454 karma points
    May 17, 2023 @ 02:36
    Chris Mahoney
    0

    I'm stuck there too. Given that it was three years ago, do you remember whether you figured it out?

    Edit: Cancel that; not stuck after all. After ~15 minutes it proceeded to the next step.

  • Chris Scarry 22 posts 92 karma points
    May 17, 2023 @ 13:39
    Chris Scarry
    0

    Hey Chris,

    Do you mind telling me which version you were upgrading from? I'm looking to upgrade my v7 installation. I would like to upgrade it all the way up to 10 or 11. I know I looked into upgrading from v7 to v8 awhile back and you had to use the ProWorks migration tool, not sure if that is still a requirement or not. Any advice would be greatly appreciated!

  • Chris Mahoney 242 posts 454 karma points
    May 17, 2023 @ 20:05
    Chris Mahoney
    0

    I'm starting from 7.15.10, and eventually I'll be heading all the way up to 10.5.1 but I'm doing it via 8.5.5.

    The latest version of the ProWorks tool requires 8.14 so I tried that first, but couldn't even get as far as the migration step because 8.14 rejected my password (8.5.5 was happy with it). It remains to be seen whether I have the same issue once I jump up to 10 :)

  • Chris Scarry 22 posts 92 karma points
    May 17, 2023 @ 20:22
    Chris Scarry
    0

    Did you have to use the ProWorks migration tool with going to V8.5.5? I know there was some talk about not having to use that on one of the later versions of V8 because Umbraco implemented something similar into their installer. Do you know if this is the case or not?

  • Chris Mahoney 242 posts 454 karma points
    May 17, 2023 @ 20:23
    Chris Mahoney
    0

    You can go to 8.5.5 without ProWorks. The impression I got is that only 8.6 and later need it.

    I couldn't find any documentation saying that it was ever "fixed" in later versions; I think the advice was always "go via 8.5.5 or use ProWorks", but I might be mistaken.

  • Chris Scarry 22 posts 92 karma points
    May 17, 2023 @ 20:30
    Chris Scarry
    0

    Ahh yeah maybe thats what it was. Anyways, thanks for the replies! Are you jumping from v8.5.5 to the latest v8 and then to the latest v9, then lastly to the latest v10?

  • Chris Mahoney 242 posts 454 karma points
    May 17, 2023 @ 20:32
    Chris Mahoney
    0

    On a different site I was able to go directly from 8.5.5 to the latest 10 (which I think was 10.3.2 at the time). I expect to be able to do the same here.

  • Chris Scarry 22 posts 92 karma points
    May 17, 2023 @ 20:35
    Chris Scarry
    0

    Oh wow, that would save a lot of time! Just for reference, how much code was broken by jumping all the way from v7 to v10? Are you fixing the broken code in v8.5.5 and then doing the upgrade to v10?

  • Chris Mahoney 242 posts 454 karma points
    May 17, 2023 @ 20:43
    Chris Mahoney
    0

    The only thing you need to do in 8.5.5 is point it to the database and let it upgrade it. Once the database is at the 8.5.5 level, you can go straight to 10. There's no need to touch any code in 8.5.5.

    As for how much will break with a typical site, I can't really say. The site I previously upgraded was built by a third party and had some very "interesting" code. I suspect that the one I'm doing now will be quite a bit easier :)

  • Chris Scarry 22 posts 92 karma points
    May 17, 2023 @ 20:50
    Chris Scarry
    0

    Oh that would be great. I thought there would be a lot of breaking changes with the way Umbraco handles certain things. My site too was built by a third party agency and sometimes I still cringe about the way they did certain things.

    As for the upgrade, you just update the Umbraco nuget packages and let it do its thing? Should I save any particular files like the web.config and restore that before I try to do the db upgrade?

    Sorry for all the questions but I have never done an upgrade before so I want to make sure I don't royally mess anything up.

  • Chris Mahoney 242 posts 454 karma points
    May 17, 2023 @ 20:55
    Chris Mahoney
    0

    Neither of my existing U7 sites used NuGet. I created a new U10 project (using the commands listed here) and set the connection string to the 8.5.5 database.

    As for "royally messing things up"... you're working on a copy of the database, right? :)

  • Chris Scarry 22 posts 92 karma points
    May 18, 2023 @ 12:40
    Chris Scarry
    0

    Oh interesting, I may try that method. Thanks for sharing the link!

    Oh yeah I'll be using a copy of the db and also have source control so I guess I'm just overly nervous doing big upgrades like this lol

  • Chris Scarry 22 posts 92 karma points
    May 18, 2023 @ 15:00
    Chris Scarry
    0

    I got some questions with the new project method. What are the exact steps you do when doing the upgrade this way?

    1. You create the new project and then point the connection string to the database so it does the upgrade.
    2. Then once the database is upgraded, you go back into your existing site code and then change the connection string there and umbraco version and all is well?

    Also, what version of .Net are your sites on? Mine is still .NET Framework (I know, I know...migration to newer .NET is next on the list!). Will I run into any issues upgrading versions of Umbraco while being on the older .NET Framework?

  • Chris Mahoney 242 posts 454 karma points
    May 18, 2023 @ 20:28
    Chris Mahoney
    0

    You need to move to a newer .Net; Umbraco 10 requires .Net 6 and I think Umbraco 11 requires .Net 7. You're basically following the same steps as the 7 to 8 upgrade (i.e. bringing everything into a new project, which will have Umbraco 10 LTS or 11 and be running under .Net 6 or 7).

  • Chris Scarry 22 posts 92 karma points
    May 19, 2023 @ 14:33
    Chris Scarry
    0

    Yeah my plan was to get to probably the latest v8 and then upgrade my project to .NET 6 then go to v10. Thanks for that link and all the advice!

  • Tom C 87 posts 222 karma points
    Feb 03, 2020 @ 13:51
    Tom C
    0

    I have same problem using 8.5.3 .. the forloop query takes hours and then timeouts. To the point tho "The query it should be running for SQL Server is still fairly unpleasant and slow, but it shouldn't be taking hours." - Personally from experience running loops where you send the query to the server from code each time, I would expect it to take hours, it's not a great way of doing it!

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Mar 14, 2021 @ 02:25
    Shaishav Karnani from digitallymedia.com
    0

    Hi Steve,

    We have quite a big site that is being migrated from v7 to v8. We are migrating to v8.4.2

    Our process is taking very long time and stuck at the above SQL statement. Please can you suggest how to fix it?

    Cheers,

    Shaishav

  • Tom C 87 posts 222 karma points
    Mar 14, 2021 @ 13:06
    Tom C
    0

    I think this has been fixed in one of the latest versions - I've actually manage to upgrade mine in the last few weeks finally. Why would you upgrade to 8.4.2. .. go for the latest version and should be good.

Please Sign in or register to post replies

Write your reply to:

Draft