Importing an organisation from Dynamics CRM v8 to v9 can be a bit troublesome. You might face strange errors like the ones below. Fortunately, in this article, I compiled a list of possible issues and their solutions.

SQL Assembly Error

First issue you might face is a SQL assembly error. It looks something similar to this:

Error| Upgrade Organization with Id=xyz failed with Exception: System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction ---> Microsoft.Crm.CrmException: Error in Action: Bin\Microsoft.Crm.DataUpgrade.dll:TrackCustomDatabaseObjects on attempt 3. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=xx.0.0.0, Culture=neutral, PublicKeyToken=uvw' or one of its dependencies. The system cannot find the file specified.    at Microsoft.Crm.DataUpgrade.DatabaseObjectChangeTracker.GenerateScriptForIndex(String tableName, String indexName, ISqlExecutionContext sqlContext)    at Microsoft.Crm.DataUpgrade.DatabaseObjectChangeTracker.InsertObjectTrackerTableInput(List`1 inputData, String tableName, ISqlExecutionContext sqlContext)    at Microsoft.Crm.DataUpgrade.DatabaseChangeTracker.TrackCustomDatabaseObjects()    --- End of inner exception stack trace ---  An error occurred when trying import and upgrade organization database CRMSERVER.CRMDEV_MSCRM: Microsoft.Crm.CrmException: Upgrade Organization with Id=xyz failed with Exception: System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction ---> Microsoft.Crm.CrmException: Error in Action: Bin\Microsoft.Crm.DataUpgrade.dll:TrackCustomDatabaseObjects on attempt 3. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=xx.0.0.0, Culture=neutral, PublicKeyToken=uvw' or one of its dependencies. The system cannot find the file specified.

The solution is to install the following four packages:

  • System CLR Types x86: link
  • System CLR Types x64: link
  • Shared Management Objects x86: link
  • Shared Management Objects x64: link

Marketing Solution Error

After fixing the issue above, you might get something similar to the following:

Info| Failed to install msdynce_MarketingSalesException: Microsoft.Crm.PackageDeployment.PackageDeployerException: Package msdynce_MarketingSales failed to install on attempt 1. System.AggregateException: One or more errors occurred. ---> Microsoft.Crm.MultiTenantPackageDeployment.PackageDeployerImportException: PackageDeployerWrapper: Import Failed status encountered. Details: Failed to load solution Marketing Sales Patch, version: xx. See the log file.    at Microsoft.Crm.MultiTenantPackageDeployment.PdExecutor.Process(PackageDeploymentInputArgs input, JobOutput`1 output, CancellationToken ct)    at System.Threading.Tasks.Task.Execute()    --- End of inner exception stack trace --- ---> (Inner Exception #0) Microsoft.Crm.MultiTenantPackageDeployment.PackageDeployerImportException: PackageDeployerWrapper: Import Failed status encountered. Details: Failed to load solution Marketing Sales Patch, version: xx. See the log file.    at Microsoft.Crm.MultiTenantPackageDeployment.PdExecutor.Process(PackageDeploymentInputArgs input, JobOutput`1 output, CancellationToken ct)    at System.Threading.Tasks.Task.Execute()<--- 

The workaround is to edit the ImportConfig.xml file at:

C:\Program Files\Dynamics 365\Setup\Serviceability\Latest\Actions_Org\Install\Packages\CRMApps\PkgCache_9_0_000y_xx\msdynce_MarketingSales\msdynce_MarketingSales

Open the file and comment the following line:

<configsolutionfile solutionpackagefilename="msdynce_MarketingSalesPatch_managed.cab" publishworkflowsandactivateplugins="true" />

Full-text Indexing Errors

You might faced this error only when importing the same DB after the above failed attempts. Importing on a clean restored DB did not produce that error for me.

Cannot drop index 'cndx_PrimaryKey_ColumnMapping' because it enforces the full-text key for table or indexed view 'ColumnMappingBase'.

To resolve the issue, delete the full text indexing from the following tables:

  • ColumnMappingBase
  • PrivilegeBase
  • ImportEntityMappingBase
  • ImportMapBase
  • WebWizardBase
  • TransformationParameterMappingBase

To remove a full-text index: in Object Explorer, right-click the table, select Delete Full-Text Index.

Important Note

The above issues are not the only ones you might face, of course. Hence, to avoid hair-pulling moments, after every failed attempt, you must import again on a clean restored DB; otherwise, you will face strange errors that are hard to resolve.

In addition, workarounds can cause unpredictable issues; you must retest your whole solution to make sure it works as expected.

References

The post Import a Dynamics Organisation v8 to a v9 Installation appeared first on Yagasoft.