I was recently installed SharePoint 2013 and had it staged under a different hostname so that I could just migrate IP’s and create CNAME DNS records for minimal downtime. However I found that once I had everything swapped to the new server the profile photos wouldn’t work anymore and I kept getting error messages when running the User Profile Sync. The errors that showed up in the event log were from SharePoint Foundation and FIMSynchonizationService
Error: 8311 “An operating failed because the following certificate has validation errors. SSL policy error have been encountered. Error code ‘0x2’ ” – I found this issue to be related to the sync using the old URL but the web site in IIS had a different (correct) SSL certificate. Once I realized what was happening I deleted a CNAME DNS record I had “mysite2” and started getting the next error”
Error 6801: “The remote name could not be resolved: ‘mysite2.xxxxx.com’ – This is because I removed the CNAME DNS record.
You need to use the trust tool Update-SPProfilePhotoStore and tell it of the change in Uri’s.
Update-SPProfilePhotoStore –MySiteHostLocation “https://mysite.xxxx.com/mysite/” -OldBaseUri "https://mysite2.xxxx.com/mysite/User Photos/Profile Pictures/" -NewBaseUri "https://mysite.xxxx.com/mysite/MySite/User Photos/Profile Pictures/"