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.45k stars 2.68k forks source link

DB migration failure #6588

Closed emeraldium closed 5 years ago

emeraldium commented 5 years ago

Hi all

we are trying to upgrade our 7.15.1 to 8.1.1 we get the following failure:

Error during installation

The database failed to upgrade. ERROR: The database configuration failed with the following message: An item with the same key has already been added. Please check log file for additional information (can be found in '/App_Data/Logs/')

See the log for full details (logs can typically be found in the App_Data\Logs folder).

when going to the log i can see the following: {"@t":"2019-09-24T14:05:03.4542856Z","@mt":"Installation step {Step} failed.","@l":"Error","@x":"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: An item with the same key has already been added.\n Please check log file for additional information (can be found in '/App_Data/Logs/')\r\n at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model)\r\n --- End of inner exception stack trace ---\r\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at Umbraco.Web.Install.Controllers.InstallApiController.

any idea?

thanks E

emeraldium commented 5 years ago

we also see this in the log

{"@t":"2019-10-02T07:02:08.2091160Z","@mt":"The database schema validation produced the following summary: {DbSchemaSummary}","DbSchemaSummary":"The following tables were found in the database, but are not in the current schema:\r\ncmsTask,cmsContent,cmsContentVersion,cmsDocument,cmsMedia,cmsDataType,cmsDataTypePreValues,umbracoMigration,umbracoDomains,cmsContentXml,cmsPreviewXml,cmsPropertyData,cmsTaskType,umbracoContent,umbracoContentVersion,umbracoMediaVersion,umbracoDocument,umbracoDataType,umbracoDomain,umbracoPropertyData,cmsContentNu,umbracoDocumentVersion,umbracoKeyValue,umbracoContentVersionCultureVariation,umbracoDocumentCultureVariation,umbracoContentSchedule\r\n \r\nThe following columns were found in the database, but are not in the current schema:\r\ncmsTask,closed,cmsTask,id,cmsTask,taskTypeId,cmsTask,nodeId,cmsTask,parentUserId,cmsTask,userId,cmsTask,DateTime,cmsTask,Comment,cmsTemplate,design,cmsContent,pk,cmsContent,nodeId,cmsContent,contentType,cmsContentVersion,id,cmsContentVersion,ContentId,cmsContentVersion,VersionId,cmsContentVersion,VersionDate,cmsDocument,nodeId,cmsDocument,published,cmsDocument,documentUser,cmsDocument,versionId,cmsDocument,text,cmsDocument,releaseDate,cmsDocument,expireDate,cmsDocument,updateDate,cmsDocument,templateId,cmsDocument,newest,cmsMedia,nodeId,cmsMedia,versionId,cmsMedia,mediaPath,cmsDataType,pk,cmsDataType,nodeId,cmsDataType,propertyEditorAlias,cmsDataType,dbType,cmsDataTypePreValues,id,cmsDataTypePreValues,datatypeNodeId,cmsDataTypePreValues,value,cmsDataTypePreValues,sortorder,cmsDataTypePreValues,alias,umbracoMigration,id,umbracoMigration,name,umbracoMigration,createDate,umbracoMigration,version,umbracoDomains,id,umbracoDomains,domainDefaultLanguage,umbracoDomains,domainRootStructureID,umbracoDomains,domainName,cmsMacro,macroScriptType,cmsMacro,macroScriptAssembly,cmsMacro,macroXSLT,cmsMacro,macroPython,cmsContentXml,nodeId,cmsContentXml,xml,cmsPreviewXml,nodeId,cmsPreviewXml,versionId,cmsPreviewXml,timestamp,cmsPreviewXml,xml,cmsPropertyData,id,cmsPropertyData,contentNodeId,cmsPropertyData,versionId,cmsPropertyData,propertytypeid,cmsPropertyData,dataInt,cmsPropertyData,dataDecimal,cmsPropertyData,dataDate,cmsPropertyData,dataNvarchar,cmsPropertyData,dataNtext,cmsTags,ParentId,cmsTaskType,id,cmsTaskType,alias,cmsContentType,isElement,cmsContentType,variations,umbracoContent,nodeId,umbracoContent,contentTypeId,umbracoContentVersion,id,umbracoContentVersion,nodeId,umbracoContentVersion,versionDate,umbracoContentVersion,userId,umbracoContentVersion,current,umbracoContentVersion,text,umbracoMediaVersion,id,umbracoMediaVersion,path,umbracoDocument,nodeId,umbracoDocument,published,umbracoDocument,edited,umbracoDataType,nodeId,umbracoDataType,propertyEditorAlias,umbracoDataType,dbType,umbracoDataType,config,umbracoLanguage,isDefaultVariantLang,umbracoLanguage,mandatory,umbracoLanguage,fallbackLanguageId,umbracoDomain,id,umbracoDomain,domainDefaultLanguage,umbracoDomain,domainRootStructureID,umbracoDomain,domainName,umbracoLog,entityType,umbracoLog,parameters,cmsMacro,macroSource,cmsMacro,macroType,cmsPropertyType,variations,umbracoPropertyData,id,umbracoPropertyData,versionId,umbracoPropertyData,propertyTypeId,umbracoPropertyData,languageId,umbracoPropertyData,segment,umbracoPropertyData,intValue,umbracoPropertyData,decimalValue,umbracoPropertyData,dateValue,umbracoPropertyData,varcharValue,umbracoPropertyData,textValue,cmsTags,languageId,umbracoRedirectUrl,culture,cmsContentNu,nodeId,cmsContentNu,published,cmsContentNu,data,cmsContentNu,rv,umbracoDocumentVersion,id,umbracoDocumentVersion,templateId,umbracoDocumentVersion,published,umbracoKeyValue,key,umbracoKeyValue,value,umbracoKeyValue,updated,umbracoContentVersionCultureVariation,id,umbracoContentVersionCultureVariation,versionId,umbracoContentVersionCultureVariation,languageId,umbracoContentVersionCultureVariation,name,umbracoContentVersionCultureVariation,date,umbracoContentVersionCultureVariation,availableUserId,umbracoDocumentCultureVariation,id,umbracoDocumentCultureVariation,nodeId,umbracoDocumentCultureVariation,languageId,umbracoDocumentCultureVariation,edited,umbracoDocumentCultureVariation,available,umbracoDocumentCultureVariation,published,umbracoDocumentCultureVariation,name,umbracoContentSchedule,id,umbracoContentSchedule,nodeId,umbracoContentSchedule,languageId,umbracoContentSchedule,date,umbracoContentSchedule,action\r\n \r\nThe following constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:\r\nFK_cmsContent_cmsContentType_nodeId,FK_cmsContent_umbracoNode_id,FK_cmsContentVersion_cmsContent_nodeId,FK_cmsContentXml_cmsContent_nodeId,FK_cmsDataType_umbracoNode_id,FK_cmsDataTypePreValues_cmsDataType_nodeId,FK_cmsDocument_cmsContent_nodeId,FK_cmsDocument_cmsTemplate_nodeId,FK_cmsDocument_umbracoNode_id,FK_cmsMedia_cmsContent_nodeId,FK_cmsMedia_umbracoNode_id,FK_cmsMember_cmsContent_nodeId,FK_cmsMember_umbracoNode_id,FK_cmsPreviewXml_cmsContent_nodeId,FK_cmsPreviewXml_cmsContentVersion_VersionId,FK_cmsPropertyData_cmsPropertyType_id,FK_cmsPropertyData_umbracoNode_id,FK_cmsPropertyType_cmsDataType_nodeId,FK_cmsTags_cmsTags,FK_cmsTask_cmsTaskType_id,FK_cmsTask_umbracoNode_id,FK_cmsTask_umbracoUser,FK_cmsTask_umbracoUser1,FK_umbracoDomains_umbracoNode_id,FK_umbracoNode_umbracoUser_id,FK_umbracoContent_umbracoNode_id,FK_umbracoContent_cmsContentType_NodeId,FK_umbracoContentVersion_umbracoContent_nodeId,FK_umbracoContentVersion_umbracoUser_id,FK_umbracoMediaVersion_umbracoContentVersion_id,FK_umbracoDocument_umbracoContent_nodeId,FK_umbracoDataType_umbracoNode_id,FK_umbracoLanguage_umbracoLanguage_id,FK_umbracoDomain_umbracoNode_id,FK_umbracoLog_umbracoUser_id,FK_cmsMember_umbracoContent_nodeId,FK_cmsPropertyType_umbracoDataType_nodeId,FK_umbracoPropertyData_umbracoContentVersion_id,FK_umbracoPropertyData_cmsPropertyType_id,FK_umbracoPropertyData_umbracoLanguage_id,FK_cmsTags_umbracoLanguage_id,FK_cmsContentNu_umbracoContent_nodeId,FK_umbracoDocumentVersion_umbracoContentVersion_id,FK_umbracoDocumentVersion_cmsTemplate_nodeId,FK_umbracoContentVersionCultureVariation_umbracoContentVersion_id,FK_umbracoContentVersionCultureVariation_umbracoLanguage_id,FK_umbracoContentVersionCultureVariation_umbracoUser_id,FK_umbracoDocumentCultureVariation_umbracoNode_id,FK_umbracoDocumentCultureVariation_umbracoLanguage_id,FK_umbracoContentSchedule_umbracoContent_nodeId,FK_umbracoContentSchedule_umbracoLanguage_id,PK_cmsContent,PK_cmsContentPreviewXml,PK_cmsContentVersion,PK_cmsContentXml,PK_cmsDataType,PK_cmsDataTypePreValues,PK_cmsDocument,PK_cmsMedia,PK_cmsPropertyData,PK_cmsTask,PK_cmsTaskType,PK_structure,PK_umbracoDomains,PK_umbracoMigration,PK_umbracoNode,PK_umbracoContent,PK_umbracoContentVersion,PK_umbracoMediaVersion,PK_umbracoDocument,PK_umbracoDataType,PK_umbracoDomain,PK_umbracoPropertyData,PK_cmsContentNu,PK_umbracoDocumentVersion,PK_umbracoKeyValue,PK_umbracoContentVersionCultureVariation,PK_umbracoDocumentCultureVariation,PK_umbracoContentSchedule\r\n \r\nThe following indexes were found in the database, but are not in the current schema:\r\nIX_cmsContent,IX_cmsContentVersion_ContentId,IX_cmsContentVersion_VersionId,IX_cmsDataType_nodeId,IX_cmsDocument,IX_cmsDocument_newest,IX_cmsDocument_published,IX_cmsMedia,IX_cmsPropertyData_1,IX_cmsPropertyData_2,IX_cmsPropertyData_3,IX_cmsTaskType_alias,IX_umbracoMigration,IX_umbracoNodeObjectType,IX_umbracoNodeParentId,IX_umbracoNodePath,IX_umbracoNodeTrashed,IX_umbracoNodeUniqueID,IX_umbracoNode_UniqueId,IX_umbracoNode_ParentId,IX_umbracoNode_Path,IX_umbracoNode_Trashed,IX_umbracoNode_ObjectType,IX_umbracoMediaVersion,IX_umbracoDocument_Published,IX_umbracoLanguage_fallbackLanguageId,IX_umbracoPropertyData_VersionId,IX_umbracoPropertyData_PropertyTypeId,IX_umbracoPropertyData_LanguageId,IX_umbracoPropertyData_Segment,IX_cmsTags_LanguageId,IX_umbracoUserLogin_lastValidatedUtc,IX_umbracoContentVersionCultureVariation_VersionId,IX_umbracoContentVersionCultureVariation_LanguageId,IX_umbracoDocumentCultureVariation_NodeId,IX_umbracoDocumentCultureVariation_LanguageId\r\n \r\n","SourceContext":"Umbraco.Core.Migrations.Install.DatabaseBuilder","ProcessId":5076,"ProcessName":"w3wp","ThreadId":7,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"VMWEBCMSLAB3","Log4NetLevel":"INFO ","HttpRequestNumber":9,"HttpRequestId":"a8e74b7c-3e64-4ec2-aa0c-e11d49a1aaba"}

nul800sebastiaan commented 5 years ago

There is a clue in this message: An item with the same key has already been added.

But there's nothing that shows exactly where this duplicate is coming from.

I would recommend setting debug="true" in your web.config and trying again. Open the F12 tools in your browser while the migration runs and when you see a request in the network tab failing, then it is returning an error message which might have more detail in it, have a look to see if you can copy anything from the response.

emeraldium commented 5 years ago

hi sebastiaan

F12 only error is: "installId: "34095cb8-8034-4afe-9c91-9db70696b869", instructions: {,…}} installId : "34095cb8-8034-4afe-9c91-9db70696b869" instructions : {,…} Upgrade : {currentVersion: "7.15.1", newVersion: "8.1.1", currentState: "unknown", newState: "5b1e0d93",…} currentState : "unknown" currentVersion : "7.15.1" newState : "5b1e0d93" newVersion : "8.1.1" reportUrl : "https://our.umbraco.com/contribute/releases/compare?from=7.15.1&to=8.1.1&notes=1""

emeraldium commented 5 years ago

in the upgarde log we can see the same logs as before: for example: "{"@t":"2019-10-06T11:02:01.9974347Z","@mt":"An error occurred during installation step {Step}","@l":"Error","@x":"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: An item with the same key has already been added.\n Please check log file for additional information (can be found in '/App_Data/Logs/')\r\n at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model)\r\n --- End of inner exception stack trace ---\r\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at Umbraco.Web.Install.Controllers.InstallApiController.d14.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Umbraco.Web.Install.Controllers.InstallApiController.d11.MoveNext()","Step":"DatabaseUpgrade","SourceContext":"Umbraco.Web.Install.Controllers.InstallApiController","ProcessId":6016,"ProcessName":"w3wp","ThreadId":17,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"VMWEBCMSLAB3","Log4NetLevel":"ERROR","HttpRequestNumber":9,"HttpRequestId":"da21fc1b-7465-4dd8-b552-c73d6f371894"}"

emeraldium commented 5 years ago

and another:

"{"@t":"2019-10-06T11:02:01.9974347Z","@mt":"An error occurred during installation step {Step}","@l":"Error","@x":"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: An item with the same key has already been added.\n Please check log file for additional information (can be found in '/App_Data/Logs/')\r\n at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model)\r\n --- End of inner exception stack trace ---\r\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at Umbraco.Web.Install.Controllers.InstallApiController.d14.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Umbraco.Web.Install.Controllers.InstallApiController.d11.MoveNext()","Step":"DatabaseUpgrade","SourceContext":"Umbraco.Web.Install.Controllers.InstallApiController","ProcessId":6016,"ProcessName":"w3wp","ThreadId":17,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"VMWEBCMSLAB3","Log4NetLevel":"ERROR","HttpRequestNumber":9,"HttpRequestId":"da21fc1b-7465-4dd8-b552-c73d6f371894"}"

stevemegson commented 5 years ago

There's usually another line a few lines before that which gives more detail about the exception. Does "An item with the same key has already been added" show up anywhere else in the log?

Alternatively, could you look for lines starting "Execute {MigrationType}","MigrationType":"...? The last of those lines will tell us which step of the migration is failing.

emeraldium commented 5 years ago

Hi Steve

i can see 3 entry's with "An item with the same key has already been added". but no one with explanation on what failing.

see log attached

thanks UmbracoTraceLog.VMWEBCMSLAB3.20191010.json.zip

stevemegson commented 5 years ago

Ah, I've actually seen this before but didn't recognise it from the error message. DataTypeMigration tries to convert the configuration for each data type to a dictionary, but older databases which have been upgraded don't necessarily have unique alias values.

The real solution is to have the migration deal with blank aliases properly, but this SQL worked for me to make the database match what the migration expects to see:

UPDATE cmsDataTypePreValues
SET alias = newAlias
FROM cmsDataTypePreValues
JOIN (SELECT id, newAlias = row_number() over (partition by datatypenodeid order by sortorder) - 1 FROM cmsDataTypePreValues where alias='' or alias is null) aliases
ON aliases.id = cmsDataTypePreValues.id
emeraldium commented 4 years ago

hi stevemegson

sorry for the delay in the answer (but i was out on holiday) i have tried to run the query you wrote but still get the same error (see error log attached). thanks error_log_u8.txt

thanks E

stevemegson commented 4 years ago

Hmm, you must have duplicate rows with real aliases, rather than just having rows with blank aliases. Try this query:

select datatypenodeid, alias,
count(*) as [rows],
count(distinct cast([value] as nvarchar(max))) as [values]
from cmsdatatypeprevalues
group by datatypenodeid, alias
having count(*) > 1

Hopefully everything has 1 in the values column, in which case you can just delete the duplicate rows because they have the same value anyway. If not, you'd have to work out which values are actually being used by the data type and delete the others.

emeraldium commented 4 years ago

Hi Steve

after running the query i got the following rersult: image

what exactly we need to delete?

thanks E

stevemegson commented 4 years ago

You just need to delete one from each pair of duplicate rows. You should find two rows with datatypenodeid 1692 and alias '4', and two with datatypenodeid 1692 and alias 'multiple'. Since they apparently have the same thing in the value column, it shouldn't matter which row you delete from each pair.

emeraldium commented 4 years ago

but from which tables we need to delete this rows?

thanks

stevemegson commented 4 years ago

Sorry, I thought I'd mentioned the table. They're in cmsDataTypePreValues.

emeraldium commented 4 years ago

ok it worked now we getting new error: "The database failed to upgrade. ERROR: The database configuration failed with the following message: Unexpected character encountered while parsing value: מ. Path '', line 0, position 0. Please check log file for additional information (can be found in '/App_Data/Logs/')"

see log attached error_log_u8.txt

stevemegson commented 4 years ago

That's the ConvertRelatedLinksToMultiUrlPicker migration getting invalid data that it can't convert. The real solution is probably to get the migration to quietly ignore any data that it can't convert, but this query should find the problem data:

select contentnodeid, versionid, propertytypeid, dataNtext
from cmspropertydata
inner join cmspropertytype on cmspropertytype.id = cmsPropertyData.propertytypeid
inner join cmsdatatype on cmsdatatype.nodeId = cmsPropertyType.dataTypeId
where cmsDataType.propertyEditorAlias in ('Umbraco.RelatedLinks','Umbraco.RelatedLinks2')
and datantext is not null and cast(datantext as nvarchar(max)) != ''
and cast(datantext as nvarchar(max)) not like '![%' escape '!'

You can probably safely delete the offending rows from cmsPropertyData since the invalid data won't be doing anything helpful in the V7 site either, but you'd need to see how many rows there are and what the data looks like.

emeraldium commented 4 years ago

we are talking abut 601 rows with lots of links and pointers, i do not really think we can delete all these rows. can you recommend on a different method? thanks E

stevemegson commented 4 years ago

What does datantext look like for those rows? You could get through the migration by changing the affected property type(s) to some other editor like Textarea, but that doesn't help you use the data in V8 after the migration.

emeraldium commented 4 years ago

Hi Steve

one example is: "[ { "caption": "לכל ההודעות", "link": "##mymail", "newWindow": true, "edit": false, "isInternal": false, "type": "external", "title": "לכל ההודעות" } ]"

emeraldium commented 4 years ago

and another with an url link:

"[ { "caption": "רוצה לעדכן את אמצעי התשלום בקלות דרך האתר?", "link": "https://www.012mobile.co.il/selfservice/PaymentUpdate#/login#31983", "newWindow": true, "edit": true, "isInternal": false, "type": "external", "title": "רוצה לעדכן את אמצעי התשלום בקלות דרך האתר?" } ]"

stevemegson commented 4 years ago

Ah, that query isn't doing what I wanted, I forgot that [ is a wildcard character for LIKE. It's returning all the related links values rather than just the invalid ones. I've edited the query above, it should now give you just the problem rows.

emeraldium commented 4 years ago

ok

now i get only 1 line, should i delete it? change it? it is on cmsPropertyData table right?

thanks

stevemegson commented 4 years ago

Yes, deleting that row from cmsPropertyData should fix the problem.

emeraldium commented 4 years ago

how does all the rows we deleted (i know in the previous it was double so no effect). but the last row i deleted would it corrupt the DB migration?

emeraldium commented 4 years ago

and the same error again:

"The database failed to upgrade. ERROR: The database configuration failed with the following message: Unexpected character encountered while parsing value: מ. Path '', line 0, position 0. " error_log_u8.txt

stevemegson commented 4 years ago

That's strange, maybe you've somehow got a Related Links property that's storing data in the dataNvarchar column rather than dataNText. Does this query return anything?

select contentnodeid, versionid, propertytypeid, dataNvarchar
from cmspropertydata
inner join cmspropertytype on cmspropertytype.id = cmsPropertyData.propertytypeid
inner join cmsdatatype on cmsdatatype.nodeId = cmsPropertyType.dataTypeId
where cmsDataType.propertyEditorAlias in ('Umbraco.RelatedLinks','Umbraco.RelatedLinks2')
and datanvarchar is not null and datanvarchar != ''
and datanvarchar not like '![%' escape '!'
emeraldium commented 4 years ago

got 7 rows see jpeg 1

stevemegson commented 4 years ago

Yeah, the migration won't like those rows, and they can't be doing anything useful in V7 either. They can be deleted from cmsPropertyData.

emeraldium commented 4 years ago

Hi Steve upgrade completed successfully :) first of all many thanks for all your help. can you please explain the last procedure we made? what exactly did we look for? why the upgrade fail? why did we deleted the specific lines in the DB tables?

i will need to explain all to my manager.

again you are the man, many thanks for you help and patiance E

stevemegson commented 4 years ago

No problem. For that last step, there's a migration step which converts any properties using V7's Related Links editor to use V8's Multi URL Picker, which does the same job but stores data in a different format. The migration assumes that everything stored in those properties is valid JSON in the format that the Related Links editor stores (like the examples you posted above), but you had a few values stored which were just text. They're probably just left over from old versions of that one document 2039, perhaps created while the document type was originally being set up, and not being used by your current V7 site at all. But they needed to be deleted so that the migration wouldn't try to convert them.

AnandAsir commented 4 years ago

{"@t":"2020-05-13T18:19:34.6664008Z","@mt":"An error occurred during installation step {Step}","@l":"Error","@x":"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: Invalid property identifier character: {. Path '', line 1, position 1.\n Please check log file for additional information (can be found in '/App_Data/Logs/')\r\n at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model) in d:\a\1\s\src\Umbraco.Web\Install\InstallSteps\DatabaseUpgradeStep.cs:line 47\r\n --- End of inner exception stack trace ---\r\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at Umbraco.Web.Install.Controllers.InstallApiController.d14.MoveNext() in d:\a\1\s\src\Umbraco.Web\Install\Controllers\InstallApiController.cs:line 236\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at Umbraco.Web.Install.Controllers.InstallApiController.d11.MoveNext() in d:\a\1\s\src\Umbraco.Web\Install\Controllers\InstallApiController.cs:line 104","Step":"DatabaseUpgrade","SourceContext":"Umbraco.Web.Install.Controllers.InstallApiController","ProcessId":12508,"ProcessName":"iisexpress","ThreadId":9,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"xxx-xx-19-201-x","Log4NetLevel":"ERROR","HttpRequestNumber":7,"HttpRequestId":"23657524-40de-48d8-a26d-e5c2524d8928"}

Trying to upgrade from 7.15.2 to 8.6.1 Did anyone faced this issue please help me

yasirisitan commented 2 years ago

@stevemegson, we need help to upgrade 7.15.3 to the latest (i.e. 9.5.0) could you please support us in a professional manner?

vishban07 commented 1 year ago

Hi @stevemegson,

Need your help. I am doing DB migration from Umbraco 7.15.6 to 8.5.5 I am facing almost same kind of issue. in log file below action taking so long time around 3 hr {"@t":"2023-08-16T13:03:16.8617195Z","@mt":"SQL [{ContextIndex}]: {Sql}","ContextIndex":17477,"Sql":"ALTER TABLE [cmsPropertyData] ADD [versionId2] INTEGER NULL","SourceContext":"Umbraco.Core.Migrations.Expressions.Common.Expressions.CreateColumnExpression","ProcessId":18464,"ProcessName":"iisexpress","ThreadId":12,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"INDPRFTCTRL0342","Log4NetLevel":"INFO ","HttpRequestNumber":7,"HttpRequestId":"22d2339b-42d4-4d42-b1d8-dada5514598f"}

I just followed the query you mentioned, it gives me no records. So nothing deleted yet. select contentnodeid, versionid, propertytypeid, dataNtext from cmspropertydata inner join cmspropertytype on cmspropertytype.id = cmsPropertyData.propertytypeid inner join cmsdatatype on cmsdatatype.nodeId = cmsPropertyType.dataTypeId where cmsDataType.propertyEditorAlias in ('Umbraco.RelatedLinks','Umbraco.RelatedLinks2') and datantext is not null and cast(datantext as nvarchar(max)) != '' and cast(datantext as nvarchar(max)) not like '![%' escape '!'

After long time I am getting error message on back office and log is : The database failed to upgrade. ERROR: The database configuration failed with the following message: Invalid property identifier character: {. Path '', line 1, position 1. Please check log file for additional information (can be found in '/App_Data/Logs/')

How can I resolve my issue?

Your help will be appreciated.

Great Thanks, Bishwajit