Schlagwort-Archive: Import

Why OptimizeOrgImport is not always an optimization

Update Rollup 8 introduced an improved organization import process which speeds up the organization import.

You have to enable the optimized import process by adding the DWORD key OptimizeOrgImport with value 1 to the registry hive of Dynamics CRM (see the detailed description

Recently, I had a problem during an import of an organization which failed with following error

Message: Exception during import of organization (Name=’‘, Id=3e58a0cc-c277-df11-b2c1-0050569473db):
System.Data.SqlClient.SqlException: A row with a duplicate key cannot be added to the object ‘dbo.SystemUserOrganizations’-object with unique index ‘SystemUserOrganizations_CrmUserId’

The organization which I tried to import was a backup of an organization which was created in the same deployment. The import runs successful on every other deployment. With help of the Microsoft Support, we identified the cause of the issue: the OptimizeOrgImport key.

The knowledgebase article for OptimizeOrgImport contains following passage:

When you use the registry entry OptimizeOrgImport and have the value of this entry set to 1, you cannot import the same organization database more than one time.
If you want to import the same organization database more than one time, you must do one of the following things:

  • Set OptimizeOrgImport = 0 and use the normal import process.
  • Delete the organization, and then import the organization again.

This passage is a little bit misleading, as the optimized import process fails already at the first time, if the organization was created in the same deployment. In order to import a backup of an organization into the originating deployment, you have to deactivate OptimizeOrgImport.

Common errors on organization import

When you import organizations into an existing environment, there is the possibility that the import could fail. This post should help you to solve the most common issues.

With large organizations, the most likely problem is that the import process runs into a timeout when it updates the user mapping. Update Rollup 8 contains a fix for this problem which has to be enabled manually. See

Another common issue is that the import fails with the following error

ExecuteNonQuery requires an open and available Connection. The connection’s current state is closed.

This error is likely caused by an issue in the .NET 2 Framework. See this article of the EMEA CRM Support team for a description

Another cause of this issue are reports which could not be published to the report server by any reason. For example, reports which are spiced up with custom assemblies cannot be published without the referenced assemblies. The import will fail when it tries to publish such a report. In this case enable the tracing, which generates a trace file for the mmc-console. With help of this file you can identify the report which is making problems. To solve the issue, you can either delete it directly from the database (unsupported) or you delete it prior to the backup of the originating system. After the successful import, you can import the problematic report again.

See this thread in the CRM Deployment forum for further description