Restore Select Files from Time Machine and Fix Permissions Issues – How to Guide

aclitermpermissionrestoretime-machine

I like doing things from the command line (eg copying only 24 select files by wildcard from my time machine backups) and Time Machine's extra permissions and protections catch me out every time.

Information on how to work around all the permissions is out there, but you have to know what you're looking for and find solutions to about 3 different problems.

So how do you restore those files with correct permissions?

Best Answer

  1. Full Disk Access

You're stuck at the following:

sudo ls /Volumes/BrainDump-Chris/Backups.backupdb/MyMac/Latest/Macintosh\ HD/Users/me
Operation not permitted

You need to give iTerm2 (or whatever terminal emulator you use) Full Disk Access permission.

  1. Fixing File Permissions

Ok, now you've copied over some files, but you can't modify them. This is because extended permissions with explicit denies were also copied over.

You'll need to remove those extended permissions as described at backdrift. You might also want to remove extended attributes as described in this answer

sudo chmod -NR <your restored files and folders>
sudo xattr -rc <your restored files and folders>