Backing up iCloud, iCloud recovery and document versions

While in theory you shouldn’t need to back up files stored in iCloud, in practice you’ll want to retain access to those that get deleted by mistake, and to older versions. Another good reason for wanting local backups of everything you put into iCloud storage is to provide emergency access should your Mac lose its connection to iCloud.

Time Machine

Unless you add iCloud Drive to the list of excluded items in Time Machine, its contents will be backed up by Time Machine so long as there are local copies of those files and folders, and your backup includes the Library in your Home folder. Any items that have been evicted and replaced locally by stub files can’t be backed up without downloading them first. The reason for this is that files whose data only exists in iCloud Drive can’t be copied to local backup storage immediately; rather than defer their copying until they can be downloaded, Time Machine simply ignores all evicted items.

This is significant if you have enabled Optimise Mac Storage, the more so if you have put your Desktop & Documents Folders into iCloud Drive, when many older items may be automatically evicted by macOS, even if your Data volume has plenty of free space. Although items shouldn’t have changed while they’ve been evicted, their last local occurrence may be in a backup made months ago. If you remove old backups, this could leave you without a copy of an evicted item in local storage.

iCloud Recovery

Apple provides through its iCloud.com web interface a valuable file and data recovery service outlined here. This lets you recover any file deleted from iCloud Drive and some data shared using CloudKit over the last 30 days. To access these, log on to iCloud.com using your Apple ID and password. Open the menu at the top right to select Data Recovery.

icloudrecovery1

This offers services for which your iCloud account has access to older data, including Restore Files from iCloud Drive.

icloudrecovery2

Available files are those that have been deleted in the last 30 days.

icloudrecovery3

When files are restored, they only contain their last-saved version, so there’s no facility to recover an older version of that item, unlike in Time Machine and other local incremental backups.

Versions

Documents edited in or moved to iCloud Drive can benefit from the standard macOS version system depending the app used to edit them. This can save older versions of documents locally, whether or not they’re backed up. Unfortunately, versioning behaviour with iCloud Drive is particularly complex, and it’s all too easy for a document to lose access to all its prior versions if you’re not careful.

The underlying rule is that the version system treats iCloud Drive as local storage as far as versions go, and keeps old versions in its hidden store on the Data volume. However, if any document with versions is copied or duplicated within the same volume, or copied to another volume, then its previous versions aren’t carried over to that copy. The implications are perhaps simplest to understand by working through an example.

Open an app that creates and maintains versions, such as Pages or my own free RTF editor DelightEd. Create a new document and save it to your local Documents folder. Type in a line or two of text and save it again to create another version automatically. Repeat that a few times. If you inspect that saved document with my free version utility Revisionist, you’ll see its several versions.

In the Finder, drag that document and drop it onto a folder in your iCloud Drive. As this is a move within the same volume, your document will be moved to iCloud Drive rather than copied to it. Check its versions when it’s in iCloud Drive and you’ll see that they’re unchanged, the same as it had when it was only stored locally. If you were to do this from a different volume, such as on an external disk, the file will then be copied, and that copy will lose those versions.

Now, on that same Mac, open the document from iCloud Drive and edit it some more, saving it to create more versions. Revisionist confirms that those versions remain with that file. This is because the document’s versions are being saved to the hidden store on your Data volume. This holds good even when the document is evicted from iCloud Drive and downloaded again: its versions are retained locally.

Versions are local and fragile

Open that same document in iCloud Drive using a different Mac, though, and none of those prior versions are available from there, because they’re stored locally on the original Mac. You can then add further versions on that second Mac, which will be accessible from there, but invisible on the original Mac. The only version accessible to both Macs and other devices accessing iCloud Drive is the current one. This is illustrated by two screenshots made on different Macs accessing the same file in iCloud Drive.

icloudversions1

The Mac used to create the first six and the current version shows them all.

icloudversions2

The other Mac shows the four versions it created between the last two seen on the first Mac. Editing one document on two systems results in different versions being saved and available on each, and macOS makes no attempt to synchronise those versions.

If you then move the document back to the Documents folder on the first Mac, that preserves only the versions saved on that Mac; any added by the second Mac are lost immediately that document comes out of iCloud Drive. All prior versions of a document are lost when it’s restored from a backup or using iCloud Recovery.

Apple has included a mechanism for resolving conflicts arising in versions on different iCloud clients, described here.

Summary

  • Time Machine and other backup utilities only back up files that are currently downloaded in iCloud Drive; those that are evicted aren’t backed up.
  • Optimise Mac Storage, particularly with Desktop & Documents Folders included in iCloud Drive, thus omits all evicted items from local backups.
  • iCloud Recovery using iCloud.com can restore the last saved version of documents deleted from iCloud Drive in the last 30 days, and can restore some CloudKit data.
  • Apps that use the macOS version system keep local copies of old versions of documents when they’re in iCloud Drive.
  • Prior versions of documents are only accessible on the Mac that created them, and are readily lost altogether.
  • Documents restored from backup or iCloud Recovery lose all their prior versions.