fredag 25 januari 2013

CRM 4.0 upgrade quits with error Attachment file size is too big.

I recently had an assignment to upgrade a CRM 4.0 to CRM 2011 which at first looked like a very straight forward upgrade since there were close to none customizations done to the system. That quickly changed when I started the upgrade process which halted with the error message "Attachment file size is too big". It seems no one encountered this problem since there wereno relevant examples of how to deal with it.

What seemed like a very straight forward migration upgrade soon turned into something of a stand still. I had installed the new server which went very good and the old database backup was restored to the new SQL server. It was a 16 GB database but there were no customizations to talk about.
I was rather pussled when the upgrade returned an error about Attachment size to big, I hadn't seen that before, nor had my colleague Gustaf Westerlund, and I didn't recall anything about it in the installation material either. The error message in the trace looked like this:

12:34:29| Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Action Microsoft.Crm.Tools.Admin.UpgradeNewSolutionAwareEntities failed.
Microsoft.Crm.CrmException: Attachment file size is too big.
at Microsoft.Crm.ObjectModel.AttachmentServiceBase.ValidateAttachmentFileSize(Int32 base64dataSize, ExecutionContext context)
at Microsoft.Crm.ObjectModel.AttachmentServiceBase.Update(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.MailMergeTemplateService.Update(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SolutionsUpgrade.SolutionAwareEntityUpgradeBase.Upgrade(ExecutionContext context)
at Microsoft.Crm.Tools.Admin.UpgradeNewSolutionAwareEntities.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

I turned to the safest place to find answers, the INTERNET.

Normally when I search for information about CRM I get a ton of links pointing in all types of directions. This time there were two pages total, not a good sign. It would be clear that almost none of them handled my particular problem, most of them pointed out that you need to set the attachment size in the settings of the organization which wasn't an option.
Or so I thought.

Since we wanted to rule out the customer's server I moved the database backup to one of our development servers which gave the same result. The next move was to import the database to a CRM4 server in our development environment, perhaps it would help to get a higher UR of CRM 4. The import to our development CRM 4 server went smooth, no problems at all. This made me very hopeful but that hope went right out the window when I made a new backup of the imported organization and restored it on the CRM 2011 server, still problems with too large attachments.

It didn't help to edit the web.config to increase attachment file size either. However, that I was able to import the organization to our CRM 4 server made me a bit hopeful. It was possible to import the organization to a CRM 4 server but not to upgrade it to a CRM 2011, how was this possible?

After snooping around in settings and general places of the CRM 4 organization I saw that the attachment file size set in CRM 4 was 0, which in the picture below is set to 5 MB (I don't have any english CRM 4.0 available at the moment, sorry). This might mean that it has no max file size in CRM 4 since it obviously had file attached to emails however the setting seems to have a different meaning in CRM 2011. I set the max file size to 36 MB and took a new backup of the organization database, moved it to the CRM 2011 server and did an import.

Bingo. The upgrade went smooth and I had an upgraded organization that I was able to log in to. I find it a bit odd that this haven't happened to anyone blogging before me though

Please let me know if this has helped you, it would be nice to know I'm not alone :)

Rickard Norström
Developer at CRM-Konsulterna  

2 kommentarer:

  1. Hey thanks for updating me on CRM 4.0 upgrade to CRM 2011 which pointed out the error in CRM 4.0. This was really helpful for me. 
    CRM Development