System.IO.FileFormatException: Expected length to be 16, not 4.

Problems when upgrading Sitecore to 8.1 update 1

Posted by Michael Sundstrøm on 2016-02-29
Tags sitecore, wtf

A word of warning! If you use the contacts database in Sitecore 8 you might run into some serious issues when upgrading to Sitecore 8.1 Update 1.

It seems that the datatype of the GeoIp has changed length from 4 to 16 characters. The 8.1 code does not handle the backward compatibility at all :(

I started a ticket with Sitecore Helpdesk on this issue, and was asked to run this little tool on the MongoDB Analytics database.

https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/Sitecore_81/Sitecore_Experience_Platform_81_Initial_Release.aspx

That seemed to solve the problems. 

Thanks to Alexander Vasilenko and Ivan Sheyenko from Sitecore Helpdesk for helping solve this issue.