Mac – How to bring back a Time Machine backup to only the latest file versions

time-machine

I have an external disk of 2TB which is fully loaded with all versions of my backup files, saved by TimeMachine. I want to bring that back to a collection of backup files containing only the latest version of each; all older versions of all 'involved' files (files which have been altered by the system or by me) may be deleted.

It's not a solution to make a new backup of my current system, because the 2TB was produced using OSX El Capitan and I did a clean install of Sierra on the same hardware.

How can I compress the TM backup of 2TB to in fact the size of my previous (El Capitan) system?

Btw, main goal of this all is to save (external) disk space.

Best Answer

Start by mounting your Time Machine backup disk. Then open Terminal.app and issue the command:

tmutil listbackups

It should give you a list with dates and time for all the backups stored on your drive.

To delete one of these backups, copy the line outputted by the listbackups command and append it to this command:

sudo tmutil delete

So it will look like this for example:

sudo tmutil delete '/Volumes/MyDisk/Backups.backupdb/MyMac/2016-11-24-003000'

Make sure to delete only the older backups leaving the newest or some newer backups on the drive.

The last step is to compact the sparse bundle to release the now freed space for other purposes:

sudo hdiutil compact /Volumes/MyDisk/MyBackup.sparsebundle

(remember to edit the path to match your setup)

It will output status while compacting the bundle, and eventually tell you how many GB it freed.