yaffs-mmssmsdb-calls-extractor.zip from here. Firefox Browser Firefox addon of SQLite manager : link. Excel macro to convert .db contacts to .csv : link. Software for csv to vcard conversion (Windows) : link. CSV to vcard conversion (online) : link. SMS Backup & Restore android app : link. Call Log Backup and Restore app : link.
I know there is Titanium backup app which can restore contact, sms etc from nandroid backups, but You need a paid version of the app.
First we need to extract the data partition of nandroid
- Rename the data.ext4.win to data.ext4.tar.gz . If Your files are like data.ext4.win000, data.ext4.win001, then rename each of them to data.ext4.tar.gz in separate folders.
- On windows, now You can directly extract them using WinRaR or 7zip application, although You don’t need to extract it entirely.
- On linux, You can do so using the following command. It is recommended to store the file in a separate folder as the file gets extracted directly.
tar –xf data.ext4.tar.gz
- Now we need to find two files contacts2.db and mmssms.db . The contacts2.db files is for contacts as well as the call logs and the mmssms.db is for messages. The contacts2.db is constant across most ROM’s and OEM firmware apps. The mmssms.db file may vary as per app and ROM’s. So what You need to do is look for a .db file inside the SMS app You have been using with the firmware/ROM.
We will restore the SMS and Call logs first.
Currently it is limited to Windows OS only.
- Extract the contents of yaffs-mmssmsdb-calls-extractor.zip to a folder.
- Copy the mmssms.db file and contacts2.db file to the above folder.
- Now open a command prompt at location of the above folder. This can be done by opening the folder, right clicking using shift key pressed in blank space. You get the “Open command window here” option.
- In it type:
extract -s mmssms.db
- It will ask You to enter a name for the output .xml file, You can press enter to let it give a default name. This will convert Your sms to a .xml file .
- Then type:
extract –c contacts2.db
- It will also ask You to enter a name for the output .xml file, You can press enter to let it give a default name. This will convert Your call logs to a .xml file .
- Copy both of these files to Your newly formatted phone and then use the two before mentioned apps (Call Log backup& Restore and SMS Backup & Restore) to restore Your SMS and call logs.
Now retrieving contacts. It is a bit lengthy, but simple process.
- Start firefox browser. In it, after You have installed the addon do following to enable the addon
- Go to options (3 horizontal lines).
- Select “Customize” and drag the “SQLite Manager” to the blue bordered box.
- Now open options and select SQLite Manager. In it select Database>Connect Database. In the opened dialog box, select All Files(*.*). Then select Your contacts2.db .
- From the left side tree structure in the SQLite Manager window, right click on “data” and select “Export Table”.
- Now in right side part of the window, You will get CSV tab and SQL tab. Under CSV tab, simply press OK button without changing any other options.
- It will ask You to save Your .csv file. Save it.
- Now if You try to open this file directly, You will notice that file is not properly arranged.
- To arrange it properly, open the convert-contacts2.db-data-to-vcard-vcf.xlsm file. If You don’t know how to enable Macros, then do the following:
- It will show You a warning “Security Warning Macros have been disabled. Options..”
- Press the Options button. Select “Enable this content” and press ok.
- Now Press the office button present at left top corner. In it select “Excel Options”.
- Select Customize tab from left side. Then from “Choose commands from:” drop down menu, select Macros.
- Now add convertDatatoContacts and writeContactstovCard to right pane from left pane by selecting them and pressing add. Press OK button.
- Now as You can see two white square icons have been added at top right corner next to save undo redo options.
- Select the first white square icon. Select “Enable Macros” button. Now select Your .csv file in the opened dialog box.
- Now the file must have opened in a separate excel. The format should be 4 rows with they being First Name, Last Name, Phone 1 and Phone 2.
- Then select Save As>Excel Workbook>Save Type as CSV(Comma delimited).csv . Press ok and yes on the two warnings generated.
- At the left bottom, right click on “contacts” sheet and press delete. Save and close the file.
- Run CSV to vCard software and open the above saved .csv file. Here You can save all contacts as single vCard file or separate files.
- In the “Properties” section on the window, in front of “Phone 1” and “Phone 2” select “Mobile Phone” from options. Press “Convert” button.
- Alternative to above two steps, You can also convert .csv to vcard using the website.
- Now a .vcf file will be created where the .csv file was stored.
- Now simply copy the .vcf file to phone and import using the phone contacts app!
Credits and sources:
[TOOL] yaffs extractor, mmssms.db & contacts2.db converter