I am sure most are aware of the handy tool available in the CRM SDK for some time now for moving configuration data between environments or tenants called the Data Migration Utility.
While using this recently as part of our build and deployment strategy I noticed that a field which was clearly specified in the data schema file was simply not being exported to the data file.
On further investigation this field specifically was a Two Options field (Boolean) set to display as a checkbox on the forms and in the case of a few records, was unchecked or false. Or so I thought. The catch with the checkbox option for Two Options fields is that a NULL value will appear as unchecked, tricking you into thinking that it is a false or no value.
In my case this was the cause for the Data Migration Utility not exporting this field to the data file. The field was indeed NULL and the Data Migration Utility ignores NULL value fields when exporting to the data file. This makes perfect sense as to why they would do this but I could not find this documented anywhere in the CRM SDK.
The solution going forward is to ensure that all NULL value Two Options fields are manually set to No. One could do this through a console application or simply through the import wizard native to CRM.