title: Setting author field in SPListItem won't persist
body: <p>I am trying to copy an SPListItem (with file) from one site collection to another. I do this by creating the file like this:</p>
  
  <pre><code>var archiveFile = newsArchive.Lists[listName].RootFolder.Files.Add(originalItem.File.Name, originalItem.File.OpenBinary());
  var archiveItem = archiveFile.Item;
  </code></pre>
  
  <p>through a utility method I wrote i then set all field values of the new item to correspond with the original item like so</p>
  
  <pre><code>Utilities.PopulateListItemMetadata(....)
  </code></pre>
  
  <p>The thing is, this does not persist the Author field.</p>
  
  <p>I tried setting the Author field explicitely in every way imaginable, for instance like so:</p>
  
  <pre><code>string userName = originalItem.GetUser("Created by").LoginName;
  SPUser user = newsArchive.SiteUsers[userName];
  archiveItem["Author"] = user.ID + ";#" + user.LoginName;
  archiveItem.Update();
  </code></pre>
  
  <p>And like so</p>
  
  <pre><code>string userName = originalItem.GetUser("Created by").LoginName;
  SPUser user = newsArchive.SiteUsers[userName];
  archiveItem["Author"] = user;
  archiveItem.Update();
  </code></pre>
  
  <p>But as soon as the SPListItem.Update() method is called, the archiveItem["Author"] field has reverted to sharepoint\system. I'm a bit at a loss here, this should work..</p>
  
  <p><strong>P.S.</strong>   the SPListItem.GetUser method is an extension method</p>
  
  <p><strong>P.P.S.</strong> Code is being run from a timer job...</p>
  
  <p>Edit: Did some more digging by adding a new field to the content type and then setting that field to reflect the Author of the original item, but that is not set either. However, the web.EnsureUser(username) does return the correct user. Is this weird or what!?!</p>