I know this question has been asked and answered numerous times already, but I am still running into a problem. I used Backup-SPSite and Restore-SPSite to migrate a site from one SP 2010 farm to another. The site contains a managed metadata column, and the managed metadata DB from the source server was backed up and restored on the target.
Now when I edit the metadata of one of the items that contains the managed metadata column, the terms are all red. If I click in the managed metadata field and then click back out again, the items all turn black. The trouble is, I don't want to have to do this for every item, and I also don't want the Modified Date to change for every item.
I did find this script, which is supposed to solve exactly this problem: http://mymemorysucks.wordpress.com/2011/01/07/invalid-terms-in-managed-metadata-field/
Despite the fact that several people report this script working for them in the comments, when I run it I get an exception on the call to $item.Update(). The exception states:
Exception calling "Update" with "1" argument(s): "The URL 'Lists/XXX/YYY.doc" is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
The file is definitely there, and the account running the script does have permissions to edit it. Also, all documents are checked in, and check-out is NOT required to edit a document. What could be causing the issue?