Around a month ago I replaced my old Nokia 6300 cell phone with the Android-based Motorola Milestone (aka. Motorola Droid). While I could easily transfer all contacts by adding them to my GMail contacts list the text messages (aka. SMS) were stuck on the old phone without any official way to transfer them to the Milestone. Fortunately, there is a solution using Gammu, some Perl scripting and the Android SMS Backup & Restore application.
First, extract all text messages from your Nokia phone using Gammu’s “smsbackup” feature.
gammu backupsms <filename>
I won’t go into details how you need to configure Gammu to connect to your Nokia phone as it comes with an excellent man page.
Next, we will convert the backup file created by Gammu into the XML format understood by SMS Backup & Restore. For this purpose, I created a little Perl script (released under the GPL), which is available for download at:
http://thilo.ginkel.com/archive/sms-gammu2android-0.1.tar.gz
Extract the script to a directory of your choice and perform the conversion by feeding the Gammu SMS backup to the script on STDIN and redirecting the conversion result from STDOUT into a new file:
./sms-gammu2android < <filename> > sms-nokia.xml
where <filename> refers to the file you instructed Gammu to store the SMS backup in.
Next, you will need to copy the conversion result stored in sms-nokia.xml to the SMSBackupRestore directory on the SD card of your Android phone.
After that, install SMS Backup & Restore from the Android Market. You can easily do so by scanning the QR Code next to this paragraph with your phone. If you do not have a QR Code scanner on your phone, just open this post in the web browser on your phone and click on the QR Code or search for “sms backup restore” in the Android market.
Finally, fire up SMS Backup & Restore and import the converted text messages by selecting “Restore SMS Messages” from the main screen.
Done.
Please note: At the moment, conversations imported that way will show an incorrect time stamp until you have opened them once in Android’s “Messaging” application.
Tags: English
As S60v3+ phones are not supported by gammu, I wrote http://42.pl/MsgExport2SMSBackupRestore.pys
Nice, thanks for sharing this!
I don’t have programming skill: can you help me? I’ve exported sms from S60v3 in a txt file, I’ve the file MsgExport2SMSBackupRestore.pys and I’ve installed Python 3.1 on Windows: what to do now?
Thanks
Well, instead of running the script standalone, you will have to explicitly run it using the python executable:
Open a command prompt, make sure python is in the path and sms.txt is your SMS export located in the current directory. Then, run:
python MsgExport2SMSBackupRestore.pys < sms.txt > sms.xmlThanks for the help, but running the command I have this error:
File “MsgExport2SMSBackupRestore.pys”, line 39
print ‘ <sms protocol="0"',
Syntax Error: invalid syntax
Using Python 2.6 instead of 3.0 should solve the issue…
I’ve fixed the script to work with python3 too.
Sorry to be so basic, but how so I export my SMS as a .txt file? I can export as a .csv but don’t know about the .txt!! Thanks.
[...] from Nokia to Android Dec 26 tips Thilo-Alexander Ginkel at “cat /dev/braindump” has written an article describing a process to convert SMS messages from Nokia Phones to a format which can be used to [...]
[...] This post was mentioned on Twitter by Jaap-Jan Frans. Jaap-Jan Frans said: @sjaakhummel overschrijven en opnieuw invoeren? :-p Je kan backuppen en dan terugzetten. zie http://bit.ly/d36SVA en http://bit.ly/36cnl [...]
Hello Piotr.
I try your python program to convert the messages.
Everything is ok but under the conversation some sms was lost.
Can you say something for this failure ?
Thanks
Hi,
Once the transfer is done, will it show the sender’s names?
This is kind of critical to me and is stopping me and sticking with Nokia (I cant believe they forget there are big finger users out there in the world!) and swapping to others.
Thanks in advance.
Yes, it will show the senders’ names if they are in your contacts list.
Hi,
This seems like a really great job. Unfortunately, I haven’t been successful yet,
I have a 6300, but I cannot connect neither via bluetooth nor USB. Since yo uhad the same phone, could you please share the connection settings?
Thanks !!
HI Thilo u said this:
\Well, instead of running the script standalone, you will have to explicitly run it using the python executable:
Open a command prompt, make sure python is in the path and sms.txt is your SMS export located in the current directory. Then, run:
python MsgExport2SMSBackupRestore.pys sms.xml\
But i dont have a clue how to run or get python in path.
whatever i do it says incorrect syntax or something.
please give me a step to step guide or i can sent you my txt file and you convert pls??
ANYONE ELSE ALSO PLEASE HELP!!!!!!!!!!
Thanks
Hi, thanks for the post. I am almost there.
I cannot get gammu to work with Micro USB cable on Nokia 6700 Classic, but have Noki that can extract from NBU file to vmg files.
I am a developer and can probably write a utility to convert vmg files to xml files for the SMSBackupRestore android application.
I am just wondering what format the date is in, and how to convert a normal date time value to it.
Thanks.
Please can you include a gammu extracted sample file for comparison?
Hi and tanks for this post.
I’m stuck at the point of running sms-gammu2android because the link http://thilo.ginkel.com/archive/sms-gammu2android-0.1.tar.gz is dead.
Could you please help?
Thank you.
Thanks for bringing the link back up again.
The script worked for me, but the XML files didn’t contain the date and time before I replaced the following line in sms-gammu2android:
if (/^Sent = (.*)/) {
with
if (/^DateTime = (.*)/) {
Regarding the gammu file format change: Which gammu version are you using?
Had the same issue. Solved it also with swapping “Sent = ” and “DateTime = “.
Gammu version is 1.28.0
Thanks for pointing this process out. Great to get this done with Opensource-Tools and no hassels!
Thanks for sharing this. Tried various shareware apps to transfer SMS between HTC Magic and HTC Desire HD however kept on running into problems.
This ‘SMS Backup & Restore’ app worked superbly.
There is Gammu and then there is Wammu. From what I understand Gammu is command line only, while Wammu is a GUI version of Gammu. Which one are you guys using? And what version?
I want to transfer my messages (SMS) from a Nokia N73 to a HTC Desire. I have read about the method Vindo Mishra used on hit blog at http://vinodmishra.com/2009/09/how-to-import-smss-from-nokia-to-htc-android-devices/. I have also read the method described at http://www.simail.si/nokia2androidsms/. Since I don’t want to root the phone I have decided to try this method by Alexander Ginkel. But I am stuck.
1. Do I need Gammu or Wammu?
2. What version of Gammu or Wammu?
3. Is “smsbackup” an internal function of Gammu or the name of some script you made for it that I need to use?
4. How do I configure Gammu if my N73 is connected via USB using a CA-53 cable?
I’m not a total novice but I feel like I would really appreciate a step by step instruction on this one. Just tell me what to install, what files to download, in what path to place them and what commands to run. When I get the proper XML file I can do the rest with SMS Backup & Restore.
Thanks in advance!
I’ve added your script to contrib folder to Gammu so that users can find it there easily.
@Samir: It does not matter if you use Gammu or Wammu, the output will be same. Wammu is just user interface on top of Gammu.
I also tried wammu, but everytime when i connect my N95, start Wammu and perform the connection test, Wammu crashes. I use Win7 x86, Wammu 0.35.
I tried every possibility, like compatibility mode, start as Administrator, as soon as i start the connection test -> Crash
Hi, I have tried running your python script. Im not sure what \STDIN\ or \STDOUT\ is but I tried running the script and apparently it has a syntax error
use Date::Parse;
use HTML::Entities;
It highlights \Date\ as the error.
I would love to use this, and I have 0 experience in python. If you could please walk me through this, I would be very great full.
This simple procedure worked for me on Nokia E65 to Android on HTC legend. No programming etc needed!
http://www.simail.si/nokia2androidsms/
[...] [...]
Hello.
I am using wammu 0.33(based on gammu 1.27.92) and your python script misses the date and other stuff in the created xml file!
Can you upgrade your script?
Thanks
Thanks a lot! I struggled with this problem for a while and tried hundred of programs – and your script solved it!
@Manaf: as suggested by Stig Inge (comment 2010/06/27) you have to replace
if (/^Sent = (.*)/) {
with
if (/^DateTime = (.*)/) {
at the beginning of the script.
Worked fine for me.
Hey!
I saved all the messeges from nokia and installed the ‘sms backup and restore” application on my galaxy s. Meanwhile I gathered quite a few important messeges on the new phone and I wanted to ask if the ‘restore’ option means that the existing sms (from the same contacts) will be deleted?
Thanks in advance :*
i have backup messages from nokia n97 into .nbu file, now i would like to transfer it to samsujng andriod mobile. kindly help me.
Nice tips. And I have an app called VeryAndroid SMS Backup. It supports sms from nokia to android transfer also.
Hi,
The link: http://thilo.ginkel.com/archive/sms-gammu2android-0.1.tar.gz
Is dead again. I know its in gammu now but I am a script novice so I am using wammu.
Please re-up the link so I can get the file?
Thank you so much!
Steve
Hi Steve,
thanks for pointing out this issue and sorry for the link breakage (caused by an incomplete web server migration). The link should be working again.
Regards,
Thilo
[...] to do the migration, and it worked perfectly. For non-Windows users, there’s a tutorial on http://blog.ginkel.com/2009/12/transferring-sms-from-nokia-to-android/ using gammu, but I haven’t tried that [...]
Hi.. I have all my msgs in the Inbox (Received & Sent) as I have >10000 msgs & i can only keep 999 in the Sentbox. Please tell me how i can copy them. Thanks!
[...] are a couple methods floating around the web, but none were suitable. This one uses Gammu to retrieve the SMSes from the Nokia, and then a script to convert them to an XML format [...]
thanks a lot, exactly what i was looking for. maybe mention the fix /Sent/DateTime/ in the post?