I am writing an archival Feature for a SharePoint 2010 list using C#. I have it copying the list items and all version history over to the new site collection but the Modified By and Created By fields are out of whack because they are referring to users that do not exist in the new Site Collection. The Site Collections are on the same server but separate Web Applications and the users are AD based.
Is there a way that I can check if the user exists in the new Site Collection and if it does not to find the user in the source Site Collection and copy it over to the destination Site Collection?
The only other way that I can think of doing this is to make copy of the current Site Collection and restore it to the archival Site Collection. The problem that this brings up is that when new employees get added to the source Site Collection they will not be in the archival one and the problem exists again.
I have been Googling this topic to no avail so any assistance with this would be great!