[Q] How to extract SMS from ROM backups? - General Questions and Answers

Hi all,
well, the heading says it all - I need to extract the text messages stored in my several ROM backups and maybe integrate them with my current ROM if possible. The backups were done with 4EXTrecovery
So far I found the info that these text messages are stored in /data/data/com.android.providers.telephony/databases/mmssms.db - but how do I get to those inside the backups? Anyone here know a way to combine several of these files into one?
Any help greatly appreciated

i'm interresting too wait for any anwsers !

This question has been asked and answered many times, you can do a search to find many possible solutions.
If you have root and are comfortable playing around with the files, the file you listed is a simple sqlite database. You can extract it and merge it on a PC using an sqlite manager application. (Be sure not to duplicate any repeated messages!) Copy the merged file back to /data/data/com.android.providers.telephony/databases/ and you're done!

superatrain said:
This question has been asked and answered many times, you can do a search to find many possible solutions.
If you have root and are comfortable playing around with the files, the file you listed is a simple sqlite database. You can extract it and merge it on a PC using an sqlite manager application. (Be sure not to duplicate any repeated messages!) Copy the merged file back to /data/data/com.android.providers.telephony/databases/ and you're done!
Click to expand...
Click to collapse
I'm glad I found this reply, but I got stuck at the stage where sqlitemanager asks me for a password as the data.yaffs2.img file is encrypted. My backup was performed using CWM backup and I figured that I'll find the "com.android.providers.telephony/databases/" under there but as I already said, I can't open the data.yaffs2.img to access "com.android.providers.telephony/databases/".
Please help

I too was wondering the same thing, that's awesome! I will give it a try...
Sent from my Galaxy Nexus using xda premium

Related

expand a nandroid img file

for those who do not know how to do this yet, follow directions given here.
Just took this info from the web. None of this except for the guide is written by me.
I am not responsible for anything please do not contact me if a green sludge starts attacking your neighborhood eating one person at a time.
************************************************************
************************************************************
************************************************************
http://code.google.com/p/unyaffs/downloads/list
made for linux, but if you know a bit of c, you can probably change it to work with windows, maybe I will do that if I have some time this week.
********OR********
http://jiggawatt.org/badc0de/android/unyaffs-x86-win.zip
or http://www.4shared.com/get/fgryPnPx/unyaffs-windows.html
for windows..... instructions below apply for both
if not included in the zips above, cygwin1.dll and unyaffs.exe are included as an attachment of this reply.
open up a command line, in windows vista/7 just press start and then type cmd press enter and change the directory to the folder with the unyaffs and the img in it. in xp press start>run>cmd... then the same
the usage is: unyaffs /path/to/img
example:
(if unyaffs.exe and system.img are both in c:\temp)
"c:\temp> unyaffs /temp/system.img"
note: the '/' is the way linux determines the pathname of a file and since it is built using cygwin(a file allowing for windows) it is preferrable that the path to the actual file is in unix POSIX format ie: / instead of \ between folders and files.
*********WARNING************
this will extract to directory that unyaffs binary is in.
That's so weird -- I was gonna post the same thing tonight. Thx for writing this up. It's odd that more people don't talk or ask about this tool!
I remember reading this stuff back when I got my G1, and tonight I was trolling the themes and apps section cause I couldnt sleep. (which I rarely look at)
I was baffled that this wasnt common knowledge. I figured if there was no threads about it that people just knew how and didnt have any problems with it. My mistake lol...
enjoy.
can you please explain what is it? what it does? thanks
ericizzy1 said:
can you please explain what is it? what it does? thanks
Click to expand...
Click to collapse
Umm, it expands nandroid img files not sure how else to explain it. Clockworkmod backups are in the img file format. This process allows you to extract those files to get stuff out of them
Sent from my SPH-D700 using XDA App
When you create a backup in Clockwork recovery, it leaves you with a folder like this:
2010-11-18.08.52.49
As you can prob figure out, I made that backup on 11/18 at 8:52am
Inside that folder are .img files, such as: data.img and system.img
Those files basically contain your data (like apps you've installed from market) and system (..system apps that might've come with the phone).
In the orig post, he's explaining how to extract the files from these large .img files.
To give an example, I had a couple of corrupted clockwork backups, and wanted to ONLY pull out some database files (like text messages and call logs) which were not corrupted. Even tho the backup was messed up, I could still extract the files I needed by using the method above, then copied them manually to my phone.
decalex said:
When you create a backup in Clockwork recovery, it leaves you with a folder like this:
2010-11-18.08.52.49
As you can prob figure out, I made that backup on 11/18 at 8:52am
Inside that folder are .img files, such as: data.img and system.img
Those files basically contain your data (like apps you've installed from market) and system (..system apps that might've come with the phone).
In the orig post, he's explaining how to extract the files from these large .img files.
To give an example, I had a couple of corrupted clockwork backups, and wanted to ONLY pull out some database files (like text messages and call logs) which were not corrupted. Even tho the backup was messed up, I could still extract the files I needed by using the method above, then copied them manually to my phone.
Click to expand...
Click to collapse
thx
Sent from my SPH-D700 using XDA App
smeyerhuky said:
Umm, it expands nandroid img files not sure how else to explain it. Clockworkmod backups are in the img file format. This process allows you to extract those files to get stuff out of them
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
Right, like if you wanted a file or a few files from clockworkmod img backup, then this process would give you an extended file system, other than what you would normally use to extract the img files. Just trying to understand this so, please correct me if im wrong.... I've been trying to get more knowledge of this, so im still learning.
I prolly sound like a complete idiot, lol...
Sweet! Thanks for this man. I'd been looking for how to do this for some time and kept ending up learning about emulation or some other tangential topic. This is the basic functionality I was looking for. Thanks for posting!
Np. I'm working on writing some stuff on top of the source code that should allow you to browse and pull just one our more file
Its been a but since I looked theory source code so it might take a while... Maybe in between semesters?
Sent from my SPH-D700 using XDA App
Dode you saved my as** thx big thx
Great, now how can I re-compress back to .img after I've made the changes that I want?
EDIT: Nevermind. I just made a zip of the new system folder and flashed it in CWM.
This worked great for me.
Thanks,
Bud
Man, I do not know how to thank you. I was able to recover some important stuff off of my cwm recovery backup. THANKS!!

Where is the db of contacts in SGS2?

Hello
someone can tell me, where exactly the contacts are saved in the file-system of an Samsung Galaxy S2 with 2.3.5?
I have a rooted phone and I am trying to get an address out of a nandroid backup done some weeks ago.
So I unpacked the data.img with unyaffs and now I have all the subfolders of the /data/ directory but I don't know now, how to access my contacts and where they are.
Which file is it?
Is it a sqlite database?
Ok, I could restore the nandroid backup (done with CWM Manager v2.0) but this takes a long time, just to find a phone number (and address).
frank
Took some time digging around but I found it. Here you go - /data/data/com.android.providers.contacts/databases/contacts2.db
Sent from my Desire HD using xda premium
sashank said:
...
/data/data/com.android.providers.contacts/databases/contacts2.db
Click to expand...
Click to collapse
Good heaven! That is great, tnahk you!
I digged and digged and found notting!
+++!
I could open the db with SQLite Manager (the Firefox Add-On or other apps will do it) and export it as a SQL-File (database / export database), now I could search with a text editor through the whole database, as I don't know the structure.

[TOOL] yaffs extractor, mmssms.db & contacts2.db converter

Some time ago I sold my old android phone and forgot to make a backup of SMS messages and call logs, but kept a complete image backup made by clockworkmod recovery (system.img, data.img, etc.). I wanted to import my SMS messages and call logs to a new phone, but without a reasonable backup this seemed to be impossible. Some quick search over the internet showed that a question about extracting/importing SMS messages from mmssms.db is not so uncommon, but there are no tools to do this. So I wrote one, and decided to share
Sources are available at github.com abbot/android-restore-tools.
It requires Python 2.6 and above to run.
I've also made compiled binaries for windows, attached to this post.
[Binaries last updated on 12.04.2011]
Thanks for the tools. Nice work.
Sent from my GT-I8150 using XDA
Hello,
I'm trying to use your tool to extract SMS from a nandroid backup.
I'm using the data.yaffs2.img file from the backup.
When I choose #2 for mmssms.db and then "s" to extract SMS I get the following error:
Failed to extract messages: file is encrypted or is not a database
DatabaseError('file is encrypted or is not a database',)
Warning: failed to remove temporary file...
What does this mean, and is there a solution?
Hi,
This may be caused by two things: either my tool can't properly read/extract the image file, or it can't read the database.
Please try to extract the image (extract -x data.yaffs2.img). If this does not produce any errors, find the mmssms.db file in the extracted data, it will probably be in data/com.android.providers.telephony/databases/mmssms.db. Then try to run extract -s mmssms.db. Please post if you get any errors doing these steps.
There was an error while extracting the image...it got through partway, but then failed at some bluetooth directory with colons in the path.
So I used a different tool to extract it, which went successfully.
Then I ran extract -s mmssms.db which came with the same error.
I'm pretty sure there isn't some weird encryption since I opened it up with Notepad ++ and I could read bits and pieces of conversations.
Anything else to try?
This might be caused by an older sqlite3 version bundled with binaries. I have updated the binaries in the first message to a newer version, could you download it and try again, extract -s mmssms.db?
Different error this time:
Failed to extract messages: no such column: failure_cause
OperationalError('no such column: failure_cause',)
Warning: failed to remove temporary file...
FYI the first thing at the top of the file when I open in Notepad++ is SQLite format 3 and this is from an HTC device running Android 4.x does that help at all?
This is much better and now makes sense: android 4.0 usually has sqlite 3.7.x, previous binary build of this tool had sqlite 3.6.21, and that was the reason for the 'file is encrypted or is not a database' error.
Now it looks like mmssms.db format in Android 4.0 has changed a little bit. I will have a look on these changes and update the app accordingly. Hope it will not take too much time
abbot2 said:
This is much better and now makes sense: android 4.0 usually has sqlite 3.7.x, previous binary build of this tool had sqlite 3.6.21, and that was the reason for the 'file is encrypted or is not a database' error.
Now it looks like mmssms.db format in Android 4.0 has changed a little bit. I will have a look on these changes and update the app accordingly. Hope it will not take too much time
Click to expand...
Click to collapse
That would be awesome, perhaps keep the old version available for other folks too though
If you can get this working I'll be sure to send a couple bucks your way. Thanks!
I have updated the extractor again, did some limited testing with android 4.0.3 on the emulator - seems to work. This database has a number of fields removed on android 4 compared to android 2, however everything required for xml dump is still there - just had to remove some unused stuff. Download the new version and try again.
Regarding the older versions, no reason to keep them - new one works fine with old database formats.
Awesome works perfectly! Send me a PM where to donate.
Sent from my GT-I9000 using xda premium
Thanks! It really works perfectly. Any plans to include MMS?
Sorry for the noobish question but I'm not familiar with Python.
Installed newest version of Python and also got the extracted mmssms.db and contacts2.db (used Nandriod Browser to extract them), which command lines do I need/what do I have to do? :s
€dit: Downloaded the zip from github and got as far as opening mmssms2xml.py which gives me an error when opening the mmssms.db
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "D:\Downloads\abbot-android-restore-tools-bc8584d\abbot-android-restore-t
ools-bc8584d\mmssms2xml.py", line 99, in open_file
self.messages = read_messages(filename)
File "D:\Downloads\abbot-android-restore-tools-bc8584d\abbot-android-restore-t
ools-bc8584d\mmssms2xml.py", line 33, in read_messages
c.execute("SELECT _id, thread_id, address, person, date, protocol, read, pri
ority, status, type, callback_number, reply_path_present, subject, body, service
_center, failure_cause, locked, error_code, stack_type, seen, sort_index FROM sm
s ORDER BY date DESC")
OperationalError: no such column: priority
Click to expand...
Click to collapse
€dit2: No problems with contacts2.db?!
€dit3: Well..this should be the last, found this explanation of rani2001 over here (http://forum.xda-developers.com/showpost.php?p=25173166&postcount=7). That did it for me!
Dude you just made my day
Can you please compile a new windows version with the latest files from github?
Or give us a manual how to use the .py files.
I think this will help many of us.
Thank you very much.
BTW: Your tool worked perfectly with my mmssms.db but failed with contacts2.db. Maybe the new files requested above will help me.
Got all my sms back thanks to you.
Amazing script, Thanks for sharing and explaining and updating.
60% There
I was just wondering if there was anything special I had to do to merge my old SMS list and the ones from the new list. I didn't see an option there for it and I don't want to just paste it in there and load it. Many thanks ahead of time
Hi I want to extract the data.yaffs2.img from my HTC Desire nandroid backup but get the error message:
> extract.exe -s data.yaffs2.img
Failed to extract messages: file is encrypted or is not a database
Any ideas?
I tried this tool yesterday evening and I'm truly grateful for your work!
I was ready to spend the whole night to work with these damn tables when I found your work. Many thanks! :highfive:
Where is the file stored after i run it? This is what I got.
Code:
C:\Users\Damastah>C:\Users\Damastah\Downloads\yaffs-mmssmsdb-calls-extractor\ext
ract.exe -s D:\S3_recovery\mmssms.db
Read 1782 messages
Save as (empty=sms-20130330111807.xml): y

[Q] joining TWRP backup files

I recently did a backup using TWRP (v.2.8.1.0) and now have multiple files (data.ext4.win000, data.ext4.win001, data.ext4.win002 etc).
Can anyone please help by proving information on how to easily merge these files together in Windows 7?
Ultimately I would like to be able to view these using 7-zip.
Thanks!
toggly said:
I recently did a backup using TWRP (v.2.8.1.0) and now have multiple files (data.ext4.win000, data.ext4.win001, data.ext4.win002 etc).
Can anyone please help by proving information on how to easily merge these files together in Windows 7?
Ultimately I would like to be able to view these using 7-zip.
Thanks!
Click to expand...
Click to collapse
That's normal. You don't want to merge them. They're all in a folder that is the backup
Sent from my Nexus 9 using XDA Free mobile app
Those files are separate archives, open then like any other tar.gz
GR0S said:
Those files are separate archives, open then like any other tar.gz
Click to expand...
Click to collapse
I get an invalid archive error when I try to open the data backups though I don't on any of the other backup files (cache.ext4.win, system.ext4.win etc).
I'm pretty sure they need to be concatenated together though I am not sure if this is easily to accomplish in Windows 7. Here is an other post with a similar problem that was solved using the Ubuntu.
On ubuntu I've just appended .tar to file name and it works.
You should try merging files with total commander and renaming to .tar
GR0S said:
On ubuntu I've just appended .tar to file name and it works.
You should try merging files with total commander and renaming to .tar
Click to expand...
Click to collapse
Gave that a shot but it didn't work
Should work just copying and pasting them into the same folder. TWRP treats the backup for a partition to be separate and complete from another. I've mixed and matched restoring partitions from different backups and it's worked. You'll have to use your judgment as to whether the restored partitions will play nice with each other.
EDIT - A workaround is to restore the partitions that you want and then back them up into a new archive.

How to open backed up Whatsapp chat DB.crypt8

I accidentally deleted some important conversations from my Whatsapp on my Galaxy note 4 and iam trying to find out if its possible to restore them. I went to my root folder to whatsapp/databases and inside there are encrypted files, each one of several kb,of my conversations for example: msgstore.db.crypt8. I even sent these files to my email to have them available in the future. So my question is if its possible to open there files somehow? Thanks.
bobesko said:
I accidentally deleted some important conversations from my Whatsapp on my Galaxy note 4 and iam trying to find out if its possible to restore them. I went to my root folder to whatsapp/databases and inside there are encrypted files, each one of several kb,of my conversations for example: msgstore.db.crypt8. I even sent these files to my email to have them available in the future. So my question is if its possible to open there files somehow? Thanks.
Click to expand...
Click to collapse
Yes, but you first need to extract the key. See: WhatsApp Key/DB Extractor
Hi, can we decrypt a db.crypt8 file without a key?

Categories

Resources