Switch to full style
General discussions, chit-chat
Post a reply

Restoring SMS-database on Android 5

September 28th, 2020, 8:48

So, my very old phone died last year. Not until today I had the time to desolder the NAND-chip to check it. The culprit was a read/write error, causing the phone lock itself when it tried to boot. I have salvaged all my files now. For SMS/MMS, I use the app "SMS Backup & Restore" but this requires a working SMS-database so I cannot pull the info out of the .db-file (and the attached MMS-files). So I bought an exact same phone for peanuts and installed the exact same firmware on it, copied /data/data/com.android.provider.telephony/* from the dead to the new one and expected this to work, so I could run the SMS Backup-app again.

Alas, it does not. Everytime I boot the new phone now I get the message as seen on the photo. Somehow the old database make the new phone go havoc but I don't know why. Everything is exacly the same so I don't know why it would complain.

So, anyway: does anyone know how I can put back the mmssms.db into /data/data/com.android.providers.telephony/ so I can make a clean backup of everything?
Attachments
IMG_20200928_144558.jpg

Re: Restoring SMS-database on Android 5

September 29th, 2020, 18:23

I don't think you can put the database back onto the new phone by just copying it. I am sure it is tied to the phone with metadata of some kind which probably prevents it from booting. You can parse the database with a tool and recover the data to an XLS or CSV file and possibly import it that way. The database is more than likely SQL Lite.

Re: Restoring SMS-database on Android 5

September 30th, 2020, 6:36

I managed to solve it. Long story shot: you can put the db-file there and it will fetch everything from it.

However, in my case, the db-file contained errors (due to the error corruption, I assume). That's why everything went nuts. I managed to run an adb-shell, open the db in sqlite, use ".dump" and then ".read" it back. That way, all the dead records went away, and the phone could import the db-file without any hassle.

Unfortunately I lost the latest 300 SMS due to the corruption, but I can live with that. Atleast I learned something new.

Re: Restoring SMS-database on Android 5

September 30th, 2020, 11:02

bos wrote:I managed to solve it. Long story shot: you can put the db-file there and it will fetch everything from it.

However, in my case, the db-file contained errors (due to the error corruption, I assume). That's why everything went nuts. I managed to run an adb-shell, open the db in sqlite, use ".dump" and then ".read" it back. That way, all the dead records went away, and the phone could import the db-file without any hassle.

Unfortunately I lost the latest 300 SMS due to the corruption, but I can live with that. Atleast I learned something new.

Well done. Thanks for sharing.
Post a reply