Lesson Learned: Import Failed and Publish Failed

Our team encounter issues with import and publish because we have a single 6MB unmanaged solution.  A 6MB CRM solution is considering a very big solution.  Depends on the hardware, it took us more than an hour to import and then another hour to publish (Apparently we didn’t have hardware that are beefy enough for the job).  I just want to write down the things that we did to resolve the issues just in case I run into it again.  This is also for people who are running into the issues.

Break the solution into smaller solutions :   Since we have a 6MB unmanaged solution, we need to break it into smaller packages so the import and publish can be faster.  At this moment, we are breaking our solution into smaller unmanaged solutions.  So how should we break the big solution?   After learning from our colleagues and friends, we split our solution into 5 smaller solutions.  Here’s what we did:

  1. Customization
    • Data Model
    • Form and Views
    • Web Resources
    • Global Option Sets
    • Site Map
    • Application Ribbon
  2. Plugins
  3. Processes
  4. Reports and Dashboards
  5. Security Roles (Note: It’s recommended to split our security roles into its own solution because when importing security roles, a lot of calculations are happening in the background, so importing security roles with other components could slow down the import quite a bit)

We are going to package our solution into managed solution.  The recommendation we received is to break the solution into smaller managed solutions.  Because managed solution is smaller because it only contains the delta customizations.  The table below will shows the customizations included in the file when you package the solution.

Component

Export

Import Behavior

Entity

Delta

Delta

Attributes

Delta

Delta

Forms

Delta

Delta

Views

Full

Overwritten

Charts

Full

Overwritten

Web Resources

Full

Isolated

Reports

Full

Overwritten

Processes

Full

Overwritten

Global Option Sets

Delta

Delta

Security Roles

Full

Overwritten

Field Security Profile

Full

Overwritten

Site Map

Full

Overwritten

Application Ribbon

Delta

Delta

Change the timeout value: Out of the box CRM timeout values are too short for a big solution, it’ll timeout/hang.  Below are the things that you can do.  Thanks Alok from our team for the detail step by step instructions.

Registry Settings

  1. Click Start, click Run, type regedit, and then click OK.

  2. Locate the following registry subkey:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM

  3. Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.

  4. Rename the DWORD value to the following value:

    OLEDBTimeout

  5. Right-click the DWORD value, and then click Modify.

  6. In the Edit DWORD Value dialog box, type 86400 in the Value data box, click Decimal in the Base option, and then click OK.

    Note: According to the requirement of the computer that is running SQL server and the number of customization files, the value can be larger than 86400. The value of 86400 is equivalent to 24 hours.

  7. Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.

  8. Rename the DWORD value to the following value:

    ExtendedTimeout

  9. Right-click the DWORD value, and then click Modify.

  10. In the Edit DWORD Value dialog box, type 1000000 in the Value data box, and then click OK.

    Notes

    • In the Value data box, you can type a value that is larger than 1,000,000. However, do not type a value that is larger than 2,147,483,647. This is hexadecimal 0x7FFFFFFF.
    • If this key already exists, notice the current value. After you have completed the import or the upgrade for Microsoft Dynamics CRM, set the value of this key back to the original value or delete the key if it did not previously exist. The default OLEDB timeout value is 30 seconds.

Web.Config File

  1. Navigate to the CRMWeb directory. Usually this directory is located in [Drive]:\Program Files\Microsoft Dynamics CRM\CRMWeb

  2. Right-click the Web.config file, click Open With, and then click Notepad.

  3. In Notepad, locate the following line.

    <httpRuntime maxRequestLength="8192"/>

  4. Change change maxRequestLength="20000".

  5. Save and then close the Web.config file.

MSCRM_CONFIG Settings

  1. Execute the following on the MSCRM_CONFIG DB on the MSCRM SQL Server.
 USE MSCRM_CONFIG

GO

UPDATE DeploymentProperties SET IntColumn=9000 WHERE ColumnName='SqlCommandTimeout'

Do an IIS Reset after you complete all of the steps above.

I hope this helps you in your CRM project. Smile