Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Time Machine: restore files changed since a given date

I have two MacBooks A and B with the same content. MacBook B was restored from the backup of Macbook A. Now, MacBook B has been updated: some files have changed (presentations, spreadsheets, documents ...); some have been created, renamed, deleted ...


I now need to bring MacBook A back at the same state as MacBook B. I can do that with a full restore of a backup of MacBook B, but that is a bit of an overkill (and takes a long time too: both have 500GB SSDs).


I was wondering if Time Machine could be used to update MacBook A: is there a way to find out which files have changed (or have been created) since a given date ?


Thanks for any ideas ...

MacBook Pro, macOS High Sierra (10.13.6)

Posted on Sep 2, 2018 7:58 AM

Reply
Question marked as Best answer

So here is how I did it to get the changes from MacBook B onto MacBook A:

  1. Backup MacBook B (via Time Machine).
  2. Disconnect the Time Machine backup disk from MacBook B and connect it to MacBook A
  3. Use rsync to apply the changes to MacBook A


The code I used is this:

#!/bin/bash -x ORIGIN="/Volumes/TIME_MACHINE_BACKUP/Backups.backupdb/Albert’s MacBook Pro/Latest/Macintosh HD/Users/albert/Documents" DESTINATION="/Users/albert" echo $ORIGIN echo $DESTINATION rsync -vrt --stats --progress --delete "$ORIGIN" "$DESTINATION" --exclude .com.apple.backupd.*


Some notes:

  • I only synced the ~/Documents folder. That is because I did not make any changes outside that: no installations in particular. And all data like mail, calendar, reminders, notes ... are automatically refreshed (via cloud etc).
  • The --delete option tells rsync to remove those files not on the backup (i.e. those files I had deleted or renamed)
  • I exclude files *.com.apple.backupd.* because somehow the backup had some of those from a very early date (last year). Maybe the result of a failed backup ?
  • If anyone wants to use that technique, make sure to first run the rsync command in "dry run" mode, using the --dry-run option. That makes rsync perform all checks - but not actually execute the copies or deletions. Check the output of the rsync command to confirm that it does what you expect.


So, while this did not use the Time Machine software to apply the changes, I was able to use the Time Machine backup for that purpose. Using rsync was easy for me because I use it routinely to sync data sets between my Mac and memory sticks or cloud stores.

Posted on Sep 18, 2018 6:56 AM

Similar questions

4 replies

Sep 4, 2018 8:04 AM in response to leroydouglas

Yes, it is an interesting workflow ... I did not want to explain the reason. But here it is: MacBook A is the one I use for my day to day work. Unfortunately, the screen is cracked ... so I gave it in for repair, and that will take a week or so. Meanwhile, I have two weeks of business trips coming up. So I restored its content (via its Time machine backup) onto Macbook B: an older but still serviceable MacBook, that I will take along on my trip.


When I am back home, my original MacBook (MacBook A) should have been fixed. The trick now is to apply the changes I made during my trip (presentations, spreadsheets, text documents, code, ...) onto MacBook A. The natural solution is to go via the same backup/restore approach. I know that works, but it is a bit long (there are some 500GB of data to copy). When I did the first restore above, it took some 7 hours. It may take less to restore MacBook A because it has a faster USB ...


Still I was wondering if Time Machine can help me find what files I have changed ... to only copy those over. Looks like it does not. The alternative is to use a sync mechanism. I can do that. I routinely use rsync for that (I think both of the tools you suggest are really GUIs over rsync).


Thanks anyway

Question marked as Best answer

Sep 18, 2018 6:56 AM in response to agodfrin

So here is how I did it to get the changes from MacBook B onto MacBook A:

  1. Backup MacBook B (via Time Machine).
  2. Disconnect the Time Machine backup disk from MacBook B and connect it to MacBook A
  3. Use rsync to apply the changes to MacBook A


The code I used is this:

#!/bin/bash -x ORIGIN="/Volumes/TIME_MACHINE_BACKUP/Backups.backupdb/Albert’s MacBook Pro/Latest/Macintosh HD/Users/albert/Documents" DESTINATION="/Users/albert" echo $ORIGIN echo $DESTINATION rsync -vrt --stats --progress --delete "$ORIGIN" "$DESTINATION" --exclude .com.apple.backupd.*


Some notes:

  • I only synced the ~/Documents folder. That is because I did not make any changes outside that: no installations in particular. And all data like mail, calendar, reminders, notes ... are automatically refreshed (via cloud etc).
  • The --delete option tells rsync to remove those files not on the backup (i.e. those files I had deleted or renamed)
  • I exclude files *.com.apple.backupd.* because somehow the backup had some of those from a very early date (last year). Maybe the result of a failed backup ?
  • If anyone wants to use that technique, make sure to first run the rsync command in "dry run" mode, using the --dry-run option. That makes rsync perform all checks - but not actually execute the copies or deletions. Check the output of the rsync command to confirm that it does what you expect.


So, while this did not use the Time Machine software to apply the changes, I was able to use the Time Machine backup for that purpose. Using rsync was easy for me because I use it routinely to sync data sets between my Mac and memory sticks or cloud stores.

Time Machine: restore files changed since a given date

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.