MaxiHuHe04/iTunes-Backup-Explorer

Unable to access SMS db (malformed)

Closed this issue · 2 comments

zzph commented

Hi,

Awesome work on this project- thank you.

When I try to open /HomeDomain/Library/SMS/sms.db, it tells me "database disk image is malformed".

So I tried:
sqlite3 sms.db > .tables > ERROR: database disk image is malformed

I tried to take a dump to remove any issues- sqlite3 sms.db ".dump" | sqlite3 new.db but kept getting no such table errors such as
main.chat_handle_join.

Any ideas on how to fix this issue?

Hi!
It seems like the sms.db file often makes problems. I don't know why. In my backups, they work just fine and I haven't found any other corrupted files yet. That makes it hard to debug. I could imagine that the database wasn't saved in a consistent state before the backup.
Have you tried the .recover command instead of .dump like recommended in #1? Apparently, .clone has also worked for others: mvt-project/mvt#25 (comment).

zzph commented

Brilliant- that's the solve, using .recover.

So that's:

sqlite3 sms.db ".recover" | sqlite3 new.db

Again, thanks so much for the great work on this project