web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error converting CRM 2011 to CRM 2013 during upgrade

(0) ShareShare
ReportReport
Posted on by

Trying to import an organization from CRM 2011 to CRM 2013 and we are receiving the following error.

CRM 2011 has rollup 18 and CRM 2013 has SP1 and rollup 5 installed. The SQL server is 2008 R2 SP3. I am not sure what does “Ambiguous column name” mean here.

  

20:08:42|   Info| Setting organization state.  New state = Failed

20:08:43|  Error| Upgrade Organization with Id=d020c31b-3454-48e1-94ed-049677f29729 failed with Exception:

System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Ambiguous column name 'EntityId'.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()

   at Microsoft.Crm.Setup.DiffBuilder.RetrieveAttributeMoveData(ISqlExecutionContext sqlContext, String selectQuery, Boolean selectIsIdentityColumn)

   at Microsoft.Crm.Setup.DiffBuilder.MoveInheritedEntityDataToNewColumns()

   --- 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 System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

   at Microsoft.Crm.Setup.Database.DllMethodAction.Execute(Guid organizationId)

   at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)

   at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)

   at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase)

   at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)

   at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

   --- End of inner exception stack trace ---

   at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

   at Microsoft.Crm.Setup.Shared.Installer.Install(IDictionary stateSaver)

   at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)

   at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)

   at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()

   at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    I think the issue that you are having might be due to you upgrading from CRM 2011 directly to CRM 2013 SP1. The recommended path is first upgrade to CRM 2013, and then to SP1. Saying that, it might be that you would be able to go directly, but I can't confirm it.

    Hope this helps.

  • Community Member Profile Picture
    on at

    Aric, thanks for your quick response. It seems Rollup 5 can be uninstalled. but SP1 can't be uninstalled from control panel. I read similar errors, which were caused by not applying SP1. That's why I thought I should install SP1 first before importing.

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Try seeing if you get the same errors after uninstalling SP1.

    If you are still getting these errors (and don't get a different response from the forum), you might have to create a new 2013 environment (temporarily), import the 2011 database and import the organization to 2013, and then backup the newly created 2013 database, import to your 2013 SP1 environment.

    I know it's a lot of work, but I am not sure if you have another alternative.

    You can also try MS Support see if they have any other resolution for you.

    Hope this helps and good luck.

  • SergeyT Profile Picture
    310 on at

    You can try to trace problematic SQL query. It may give you hint on how to fix it.

  • Community Member Profile Picture
    on at

    Thanks for your advice and direction. Can you tell me in details how to start a SQL query? I am not an SQL expert.

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    You can run SQL Profiler Trace on the SQL Server during installation, however as you mention that you are not a SQL expert, it might be hard to find what you are looking for.

    Do you have an IT staff/consultant that could help you with going over the SQL Profile logs?

    You might also try and open an incident with Microsoft to troubleshoot.

    Sorry I don't have a better answer.

  • Community Member Profile Picture
    on at

    I uninstalled CRM 2013 and re-installed it without SP1 because I can't uninstall SP1 and tried to import the database again from CRM 2011. It was a brand new CRM 2013 test environment. This time I got a different error.

    It seems stored procedure was failed with installation. I appreciate any advice.

    ------------------------------------------------------

    22:30:48| Error| An error occurred when trying import and upgrade organization database DELLV2.InfoCubic_MSCRM:
    Microsoft.Crm.CrmException: Upgrade Organization with Id=d020c31b-3454-48e1-94ed-049677f29729 failed with Exception:

    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Crm.CrmException: Error installing sp with name=p_GrantInheritedAccess
    Incorrect syntax near 'MERGE'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the SET COMPATIBILITY_LEVEL option of ALTER DATABASE.

    Incorrect syntax near the keyword 'AS'. ---> System.Data.SqlClient.SqlException: Incorrect syntax near 'MERGE'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the SET COMPATIBILITY_LEVEL option of ALTER DATABASE.

    Incorrect syntax near the keyword 'AS'.

    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout)

    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)

    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

    at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)

    at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)

    at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)

    at Microsoft.Crm.Metadata.SqlHelper.ExecuteBatches(IDbTransaction transaction, IDbCommand sqlCommand)

    at Microsoft.Crm.Setup.StoredProcedureService.InstallStoredProcedureInternal(StoredProcedureData spData, SqlExecutionContext sqlContext)

    --- End of inner exception stack trace ---

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Hi moonwalker,

    Do you have System Admin access on the SQL Server database?

    Can you check if you can set the compatibility level of the current database to a higher level as is suggested by the message using the SET COMPATIBILITY_LEVEL option of ALTER DATABASE.

    See below link:

    docs.microsoft.com/.../alter-database-transact-sql-compatibility-level

    What version of SQL Server was CRM before, and did you upgrade SQL Server?

    Let me know.

  • Community Member Profile Picture
    on at

    The SQL server of CRM 2011 is 2008 R2 SP3 and the SQL server of 2013 CRM is 2012 SP1. I will set the compatibility level to 100 and post the result here. Thank you again for your direction.

  • Community Member Profile Picture
    on at

    After I raised COMPATIBILITY_LEVEL to 100, which is 2008 R2, I was able to restore and import the database successfully from the deployment manager. As a quick summary, you are right. You can't upgrade CRM from 2011 to 2013 SP1 directly and you have to upgrade it first and then apply SP1. I guess this rule applies when upgrading to 2015 and 16 as well. Again, thanks for your help and time!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans