Transferring Text Messages (SMS) from Nokia to Android

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:

21 Responses to “Transferring Text Messages (SMS) from Nokia to Android”

  1. Piotr says:

    As S60v3+ phones are not supported by gammu, I wrote http://42.pl/MsgExport2SMSBackupRestore.pys

  2. Nice, thanks for sharing this!

  3. Andrea says:

    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

  4. 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.xml

  5. Andrea says:

    Thanks for the help, but running the command I have this error:
    File “MsgExport2SMSBackupRestore.pys”, line 39
    print ‘ <sms protocol="0"',
    Syntax Error: invalid syntax

  6. Thilo-Alexander Ginkel says:

    Using Python 2.6 instead of 3.0 should solve the issue…

  7. Piotr says:

    I’ve fixed the script to work with python3 too.

  8. Nav says:

    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.

  9. [...] 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 [...]

  10. [...] 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 [...]

  11. Gyula says:

    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

  12. Eddie Teo says:

    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.

  13. Yes, it will show the senders’ names if they are in your contacts list.

  14. Saad says:

    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 !!

  15. AQ says:

    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

  16. Frits says:

    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.

  17. Frits says:

    Please can you include a gammu extracted sample file for comparison?

  18. Stig Inge says:

    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.

  19. Stig Inge says:

    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 = (.*)/) {

  20. Regarding the gammu file format change: Which gammu version are you using?

  21. Volker says:

    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!

Leave a Reply