When migrating content from a prototype MOSS intranet to the new production environment I hoped to be able to move documents across using the windows explorer view of document libraries provided by SharePoint 2007. Unfortunately for most of the items this resulted in a helpful little warning stating “An error occurred copying some or all of the selected files.” (I also tried using Windows XP and this gave me a ‘delayed write error’). After further investigation I found even uploading these files one by one through the ‘Add new…’ option in the UI also gave me an error. This time a little more helpful:
Invalid look-up value
A look-up field contains invalid data. Please check the value and try again. at Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile…
After further investigation I found that the problem was that in the prototype version of the site we had created lookup columns that had different values than in the new production site. For example we had a ‘origin’ column, that only allowed a single item in the prototype, but multiple values in the production environment.
As there was only a handful of documents I got around this by manually removing the offending custom properties (which can be done by right-clicking on a document in windows explorer and selecting properties) as shown below:
Unfortunately there was also a large number of pages that needed to be migrated that had the same problem. Instead of updating these one by one I created a console application that would push the content in the old pages into one of the new page templates (you could also do this for the word documents by programmatically updating the document properties).
Hopefully this helps anyone else that comes across the same problem. Let me know if you find any better ways of doing this.