SQL error when importing customization.xml

Today I was deploying from a development environment to a test environment and part of this is moving the customizations made within the CRM GUI. I simply exported the customizations.xml and tried to import it to the test system. Only to get a very angry “SQL Error”. Hmm… not very nice to see those, that usually means that somethings gone really bad, and you usually wish you hade just taken a complete backup of CRM.

Well, things only got worse when I tried to access CRM with the common url, I got a really nasty error saying that some custom attribute wasn’t at all like some other custom attribute. No dah, my worst fears just got real and I could only face the fact that the CRM meta database had somehow become corrupt. Really bad, testing was supposed to begin today, so really bad timing (and timeplan).

So, what to do? Since I couldn’t access CRM I couldn’t get to the import cusomtizations page, so I had a look in the SDK for the direct URL to the import customizations page (it is under sitemap customizations). I tried to reimport the customizations file from my development server, only to find that CRM now found the xml “malformed” in this file. After some testing, I found that it acctually found all customizations files to be malformed, not only the first one. So, something really sinister is at hand. Time to log into the SQL-Server.

The first message that faced me was that one of the drives had to litte disk space… I had a look and found that the main data disk had only 2 MB free. So, this was probably it. First, there probably hadn’t been space enough for commiting all the changes that were in the new customization file and then there hadn’t been space enough to upload the new customizations file. The error message of mal-formed xml had just been an erroneous error message.

So, I freed some space on the disk and just to be sure, I re-installed CRM entirely (it was just a test environment after all) and imported the customization file, and all went well!

Well, there was acctually one thing, when I imported the customization file I got an error saying that at some row XXX in the file there was something wrong. At the specific row, was a tag for setting “displayInApplication” or something like that for the entity “Bulk Operation”. I tried to remove the tag and import it, which worked. I later remembered that I hadn’t installed Update Rollup 2, which I later confirmed was the cause of this error. I had exported from a CRM 3 UR2 system and imported into a standard CRM 3, hence the error. So, I would suggest not removing the tag but instead updateing your CRM :).

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG

New programming example of bulk import

As many of you might be aware, there are several ways to import data into CRM, mainly:
1. Using the standard import web-GUI. It can only import to a few entities like account, lead, campaign response.
2. Using the free Migration Framework. It is a bit tricky to get it going but it can handle all system entities and relations and custom attributes, but not custom entities. Skills of SQL is more or less mandatory.
3. third party products – My favorite being Import Studio Manager 2006 professional from the Danish company Crmextensions. It supports custom entities, custom fields and relations. It uses standard ODBC to connect to a datasource and the mapping and setup can be saved for future use. Very useful for frequent imports/syncs. There are also other products, like Scribe. I havn’t had the need to test them since Import Studio Manager 2006 has had all the features I needed.
4. Developing your own import program to do the gritty stuff. Without comparisson the most flexible solution but also the most timeconsuming and demanding, since it requires good skills of a .NET language like VB, C# or J#.

What Microsoft has just released is a sample of how to create you own bulk import program (using alt 4), which simplifies this a bit. Please have a look at it:

I havn’t tried it, but I would still suggest using third party products instead.

Gustaf Westerlund
CRM and SharePoint Consultant

Humandata AB