hackappcom / iloot

OpenSource tool for iCloud backup extraction
https://hackapp.com/
637 stars 201 forks source link

First snapshot containing files is not always Snapshot 1 #29

Closed dibas closed 4 years ago

dibas commented 9 years ago

Just as the title says. I was wondering why I got a 20MB backup folder when trying to download a backup 3G in size, turns out snapshot 1 was empty. I modified the code to iterate through every snapshot and tell me how many files it contains, apparently snapshot 202(!) was the "base" snapshot for me, so I just adjusted line 422 to snapshot_list = [202, mbsbackup.Snapshot.SnapshotID - 1, mbsbackup.Snapshot.SnapshotID] 202 should be obviously your "base" snapshot. It's now working perfectly fine for me, so I thought I'd drop by to make you aware of this issue. As I couldn't find anyone else having the same issue here, it's apparently pretty rare, but still, some people may run into the same issue sometime, this is how I fixed it for myself. It takes quite some time to check each snapshot for files, but maybe someone else has got a better idea(like only iterating through every snapshot when the first one doesn't contain any files) to solve this.

mca-gif commented 9 years ago

What is the highest snapshot ID in your backup? It sounds like Snapshot ID 1 is still your first backup, but that backup just didn't have very much in the way of files. What should happen is that with each successive backup to iCloud, the snapshot 202 data will eventually be moved to 1 and you'll have snapshots 203, 204 live.

There is also the case that a backup was in progress, which iloot currently does not account for when calculating snapshot ranges. You can always use the --snapshot option to adjust which snapshot you download.

Either way, what model phone are you using? When you setup this phone for the first time did you restore it from an iCloud backup, iTunes backup, or no backup at all? Again, what is your maximum snapshot ID? And in a few days, try the stock code out again and see if your 202 snapshot has migrated to 1, and let us know.

dibas commented 9 years ago

Snapshot 617 was the highest one shown in iloot (The only snapshots containing data were 202, 616 and 617, that's how I came to the conclusion 202 being the base snapshot containing most of the files). I'm not sure about how iCloud backups work at all in detail, I just needed to download my backup before overwriting it with a cleanly restored iPad. The backup was definitely not in progress, the last one was a day ago and finished just finely. I knew about the --snapshot option, but it didn't help me with getting to know which snapshot contained my files as I would have already needed to know it beforehand.

The device in question is an iPad2,2. I'm pretty certain it was set up as a new device, although it was backupping to iCloud before being restored, so I could imagine that all the snapshots from the old backup where emptied(with snapshot 201 being the latest?) when the newly set up device tried to backup to iCloud. Please correct me if I'm wrong in my thought process about snapshots and iCloud backups in general, I don't know nearly as much about them as I'd like to to participate in fixing this issue.

Anyway, the iPad (again, set up as a new device, no backup) is backing up to iCloud right now, so I'll try using iloot in a few days again and report back.