How to fix broken iCloud sidebar alias after Sierra Migration
Was posting a question when fixed myself, so here it is to help you guys.
Problem:
I had a MacBook Air with Sierra, Documents and Desktop on my iCloud. I had two folders (call them 'folder1' and 'folder2') from iCloud in my sidebar favorites that I created by dragging the folders to the sidebar. Easy and they worked fine.
I bought a new MacBook Pro with Sierra and did the Migration Assistant to move my user and preferences. Everything worked fine, including iCloud, except the two favorites for 'folder1' and 'folder2' were broken. When I clicked them, I got an error that said the destination no longer existed. I could not delete them by
1. right click,
2. nor by command+click and dragging them off the sidebar,
3. nor by deleting ~/Library/Preferences/com.apple.sidebarlists.plist,
4. nor by deleting ~/Library/Preferences/com.apple.finder.plist.
The broken favorites/aliases remained non-functional and in the sidebar.
Solution:
Move ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.iCloudItems.sfl to your desktop or the Trash. Reboot. Add iCloud to the favorites again through Finder > Preferences > Sidebar > check iCloud. Drag new favorites to sidebar from iCloud.
Discussion:
It looks like Sierra stores iCloud favorites/aliases in a different file than com.apple.sidebarlists.plist. The file is
~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.iCloudItems.sfl
You can rename the extension to .plist and open it with Xcode to see that it's a plist. Inside mine, my broken favorites/aliases pointed to a folder location that OS X El Capitan stored iCloud documents before Sierra. Specifically,
file:///Users/Name/Library/Mobile%20Documents/com~apple~CloudDocs/folder1/
file:///Users/Name/Library/Mobile%20Documents/com~apple~CloudDocs/folder2/
However, with Sierra, the new folder locations are more natural,
file:///Users/Name/Documents/folder1
file:///Users/Name/Documents/folder2
and those old folders no longer exist. That's why the aliases were broken.
If anyone with more in-depth knowledge of Sierra could comment if removing this file is dangerous, please do so. My computer and iCloud have been working fine since I did it, but you never know.
MacBook Pro (13-inch, Late 2016, 4 TBT3), macOS Sierra (10.12.1), null