If you’re an avid user of macOS or iOS, it’s safe to bet that some of your workflows revolve around iCloud. Whether it’s some Xcode project or a Keynote presentation, it’s likely that some, if not most, of your data resides in iCloud. The significance of this data could not be overstated and thus it makes sense to consider some sort of backup for it to ensure that you’re not caught off guard if something disastrous happens at Apple’s data centers.
Before you proceed to perform the backup of iCloud Data, let’s first examine the way in which Apple stores it on macOS. Most of us are familiar with the iCloud Drive folder in the left side-bar of Finder:
There are two problems with this folder:
- This folder is self-contained and is not accessible from anywhere except for the Finder's sidebar. In other words, you can't just copy it from the enclosing folder the way you can with the Downloads folder, for instance. This obviously limits your ability to back it up in the traditional way and requires some alternative.
- This folder does not display hidden iCloud data like preferences of your Twitter client or documents of your iOS apps. Therefore, selecting all folders and copying them to a different directory will be insufficient, as hidden data will not be copied along.
The first issue stems from the fact that the iCloud Drive folder is nothing but an alias for another folder buried deep down in macOS. This folder is located at ~/Library/Mobile Documents. However, if you try to locate it, you'll see that this folder cannot be opened like any other folder. It seems that Apple wants us to access iCloud Drive data exclusively from the Finder's sidebar and not from its actual location.
That's not a problem though; you can just copy this folder and paste it on your Desktop to examine its contents. If you do that, you'll notice that this folder does not contain the iCloud photo library. That's because the iCloud photo library is located in a different directory at ~/Library/Pictures/Photos Library.photoslibrary.
Alright, by now we have two directories: one is the location of the iCloud data and the other is the location of the iCloud photo library. We're almost ready for backup; although, one final issue needs to be addressed before we proceed to backup.