Wednesday, July 9, 2008

User security information cannot be properly imported without setting UserInfoDateTime option to ImportAll.

I setup a Content Deployment between my staging and production publishing sites, and got this warning.

For the Content Deployment path, I said All to Security Information. I want to deploy security information (such as ACLs, roles, and membership). This is part of our requirements.

Also, unchecked Deploy user names, following
http://technet.microsoft.com/en-us/library/cc263468.aspx.
It reads “… to protect the identities of your authors, disable the Deploy user names setting when you configure the content deployment path.”

Then, it turned out that the above mentioned error, or warning comes from this.

I think I was luckly to find
http://msdn.microsoft.com/en-us/library/aa981161.aspx.
The title does not sound relevent, but in the code sample, you see:

// Retain author name during import; change if needed
importSettings.UserInfoDateTime = SPImportUserInfoDateTimeOption.ImportAll;

Why in order to “Retain author name during import”, we need to set UserInfoDateTimeOption to All… Do not ask me…

So I check the Deploy user names, then voila, the warning is gone.