Merging/migrating sms.db from iOS 10 to iOS 12
Preface: simply wiping-restoring a backup from the iOS 10 source device is not a preferred option due to the iOS 12 device being setup differently, and having a very intricately recreated photodata database that would be wiped/replaced with a backup restore.
I have an sms.db dating back to 2012 on an iPhone 5 which was until recently on iOS 6, had a forced upgrade to iOS10, I was surprised to find the sms database stayed intact and accessible by the new OS.
Thought this would make it easier to migrate the database to an iOS 12.1 device, but apparently not.
First I moved the original iOS10 sms.db to the SMS folder - it was marked as incompatible as below:
.incompatible10113 (iOS 10 client version)
string being added to the file extension
That was "fixed" (or I thought so) by editing the ClientVersion string directly in the db properties to 12005 (which is what I got the from the original iOS 12 db). I also moved the Attachments, Drafts and Parts folders to the SMS folder.
The OS now accepts the db (as in, it doesn't get deleted), however doesn't seem to be able to read it/use it.
The main sms.db file stays in place, a sms.db-shm file is created (standard 33kb), but the in-use write-ahead log of the db, sms.db-wal, stays at a low size. It gets written to when a new message is received, and Messages.app displays the new message only. Attempts to search in messages have shown some older entries (potentially cached somewhere other than /Library/SMS), which have since disappeared, and also wiped the newly received messages from view.
Would anyone know whether there is a new schema for sms.db in iOS12, and if so how to make the old db compatible? Alternatively, how would I go about merging those two sqlite databases? Thanks
iPhone X, iOS 12