Just to be sure... did you try to perform the manual upgrade or automatic via KIM?
It seems that there is an inconsistence in the DB. Could you please check the CMS_UIElement table and search for any records that have the same ElementResourceID - duplicates? If possible, I would recommend to remove the duplicates form the DB and then try to repeat the operation.
Best regards, Martin