MacOS – What happens to files restoring from case-sensitive to case-insensitive

macostime-machine

If I have IMPORTANT-RESOURCE.jpg and important-resource.jpg on a case-sensitive file system, I do a Time Machine backup, then wipe boot volume, and create a case-insensitive volume, then restore from Time Machine, what will happen to the duplicate file?

Best Answer

Time Machine by defaults formats the backup disk as case-sensitive, even when the original source disk is case-insensitive. This means that in any case, the file names are preserved when backing up.

If you when restore files from a backup made from a case-sensitive file system to a disk with a case-insensitive file system, Time Machine detects conflicts. The first of the two (or more) conflicting files will be copied over as normal. For the rest of the conflicted files, you'll get a popup stating that the destination disk already contains a file of that name. The popup allows you to either keep only the first file, keep only the second file - or keep both, where it automatically renames the second file to include "copy" in the name.

In general I would say that you should never do this with a complete system backup. Always restore a case-sensitive backup to a case-sensitive file system. If you have a limited number of files and expect a low number of conflicts, it could be done ofcourse - but it probably more work than justified.

In fact by default, if you wipe the volume completely and let Time Machine do a full restore, it will create a file system with the same case-sensitivity setting as the original source volume. I.e. if the backup was created from a case-sensitive disk, it will format the volume as case-sensitive during restore.

You can change by altering the com.apple.backupd.VolumeIsCaseSensitive"extended attribute on the top folder matching the name of your source volume. below your computer name in Backups.backupdb.