Friday, May 29, 2009

FatalError: Unable to cast object of type 'ImportUser' to type 'ImportGroup'.

When importing a web, library, listitem, etc. using STSADM, you get the below error message:

FatalError: Unable to cast object of type 'ImportUser' to type 'ImportGroup'. at Microsoft.SharePoint.Deployment.ImportObjectManager.AddGroup(Int32 id, String name, String description, Int32 owner, Boolean ownerIsUser, String requestToJoinLeaveEmailSetting, Int32 flags, Int32[] members, Boolean bResolve) at Microsoft.SharePoint.Deployment.GroupsImport.ProcessComplexElement(ImportStreamingContext context, XmlReader xr, SqlSession session) at Microsoft.SharePoint.Deployment.SqlBatchImport.Run() at Microsoft.SharePoint.Deployment.SPImport.DeserializeUserGroupMap() at Microsoft.SharePoint.Deployment.SPImport.Run()


This happens when the import process is importing all of the site collection users and groups.


The problem is that there is an account or group that it is trying to import that was not successfully exported.



To troubleshoot it, look at the last account that was imported before the error message occurred. Then navigate to the export location and open the usergroup.xml file (in case you did not include the -nofilecompression parameter, either re-run the export or look at this post where I explain how to open and recreate the cab file). Find the last account that was successfully imported, and the next account should be the one that is causing the problem. In my case it was a SharePoint group.

You'll see an entry such as this: Group Id="107" Name="Prop-EquipBreakLibrary-Readers" Description="" Owner="105" OwnerIsUser="false" RequestToJoinLeaveEmailSetting="" OnlyAllowMembersViewMembership="true" Member UserId="40" /Group

Delete it, save the xml file, and rerun the import.

No comments:

Post a Comment