I'm trying to update an on-premise Dynamics CRM deployment from 2013 to 2015. The current version only has some minor customizations. However, when I try to upgrade I get the following error while the upgrader is in the DiffBuilder pass 0 stage:
01:15:37| Error| Installer Complete: OrganizationUpgrader - Error encountered
01:15:38| Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Error.ActionFailed Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction
InnerException:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The parameterized query '(@attributeId uniqueidentifier,@entityId uniqueidentifier,@previ' expects the parameter '@newTableName', which was not supplied.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
By using the profiler I identified the query causing the issue:
INSERT INTO InheritingAttributesForUpgrade
(AttributeId, EntityId, PreviousTableName, NewTableName, PreviousColumnName, NewColumnName, ChangeTableColumnNameInMetadata)
VALUES (@attributeId, @entityId, @previousTableName, @newTableName, @previousColumnName, @newColumnName, @changeTableColumnNameInMetadata),
@attributeId='315959A2-C539-E411-9417-2A03ABE53CF6',
@entityId='BCEB9F02-968E-4363-BEB0-AD7ECDEF4908',
@previousColumnName=N'new_SupportLevel',
@previousTableName=N'IncidentResolutionExtensionBase',
@newTableName=default,
@newColumnName=N'new_SupportLevel',
@changeTableColumnNameInMetadata=0
So, the problem seems to be the default
value passed to the @newTableName field, since this is a parameterized query.
After that, the organization state is set to failed and the CRM is no longer functional, while at the same time the Deployment wizard stops working and complains about a missing addin. How can I find out whether this is due to the customizations I have done on the DB schema or it is an issue with the 2015 version updater/installer?