Windows Mobile to Android SMS Converter

Download button(aka PIM Backup to SMS Backup & Restore Converter, or pim2smsbr)

The Windows Mobile to Android SMS Converter tool is a small script that converts the SMS content of PIM Backup files to an XML format compatible with SMS Backup & Restore, with the result that you can quite easily migrate all your SMS messages from your old Windows 6 mobile phone to your shiny new Android. See the blog post for more of an introduction.

Process

To migrate your messages, follow the steps below:

  1. Backup the SMS messages on your phone using PIM Backup
    • Ensure the “Binary backup” option in PIM Backup is unchecked when exporting your messages, or else this converter will not work.
  2. Copy your backup file (something like “PIMBackup_20110701.pib” by default) to your computer
  3. Ensure Python 2.x (note: NOT Python 3.x) is installed on your computer
  4. Download WinMo to Android SMS Converter tool (pim2smsbr.py) to your computer
  5. Through your command prompt or terminal, execute the command python pim2smsbr.py backup_file [output_file], where:
    • backup_file refers to the name of your PIM Backup file, something like PIMBackup_20110701.pib (if you created it on the date of this post), and
    • [output_file] is an optional argument that allows you to specify a filename for the output (or you can omit it, and it will output alongside the input file).
  6. Install SMS Backup & Restore on your Android device (free from Android Market)
  7. Copy the XML output file (from step 5) to the SMSBackupRestore folder on your Android’s SD card
  8. Run SMS Backup & Restore, choose Restore, and select the output file you just copied

And you’re done! Your SMS messages should be restored to your Android phone within a minute or so, and constructed into conversation threads with your existing contacts.

Finally, you can check out the source code on Bitbucket if you’d like to contribute. This software is provided under the Simplified BSD License. That means it’s free, and I’m not responsible if something goes wrong. I’m happy to provide whatever support I reasonably can, however!

If you have any questions or comments, please let me know in the comments below. If you can’t get it working and would like to send me your backup to convert, email it as an attachment to piemaster21 [at] gmail [dot] com, and I’ll reply with the converted result.


NOTE: This program will only convert your SMS messages, not emails, since they should be easy to recover. If you need to migrate other content let me know, but you probably don’t since there are usually easier ways (particularly with Google Sync).

FURTHER NOTE: This tool will only work with a text-based backup (i.e. “Binary backup” must be unchecked). If you still have your WinMo phone, you can always use PIM Backup to restore the binary backup and then re-export as a plain-text backup. If you do not still have your phone however, all is not lost: you can still install a WinMo emulator on your Windows PC, download PIM Backup to your PC, open it in the emulator, and do the restore/backup there. To do this:

  1. Follow the steps in the linked article to install and run an emulator
  2. Download PIM Backup to your computer and place it in the same directory as your binary backup file
  3. Go to File > Configure, set the “Shared folder” field to the location on your hard drive that contains PIM Backup and the binary backup file, and click OK
  4. In the emulator, go to Start > All Programs > More > More > File Explorer, scroll down and select Storage Card, then navigate to and select PPCPimBackup.exe
  5. In PIM Backup, choose the Restore action and Browse to your PIM Backup file (this may be very fiddly with the directional keys since the scrolling seems to be bugged)
  6. Press Next a couple of times to restore your backup to the emulator
  7. Once restored, follow a similar process to back up all your emulator data to a text-based backup file
  8. Finally, take this output and go to Step 2 in the conversion process

81 thoughts on “Windows Mobile to Android SMS Converter

  1. Pingback: Migrating Windows Mobile to Android

  2. Pingback: Import/Export/Move SMS Messages from Windows Mobile to Android - Android Stuff

  3. Thanks for making this. It helped me move my WinMo contacts to my new android. Some notes:
    - Dates aren’t working because timestamps should be in milliseconds instead seconds. Multiplying all times by 1000 fixed it.
    - IPM.SMStext comparison should be case insensitive as some entries had capital T
    - Had to strip some weird/unicode characters off the csm file because for whatever reason sms_reader only likes ASCII

    • G’day LL, glad you found it helpful!

      Thanks very much also for the bug reports! I’ve fixed each of them, pushed the changes and uploaded a new version, so hopefully that will help others.

      With the weird characters, I’m blindly decoding from UTF-16, because that’s how the .csm file appears to be encoded. Encodings are a pain. I didn’t have any problems with my messages, but I’ve added a check to skip any lines that can’t be decoded (rather than crash) and inform the user that they might like to correct the problem(s) manually.

        • Hi David,
          That’s right. My script is quite basic, and merely converts one output format into another input format. For PIMBackup, you should only need to download the correct version from http://www.dotfred.net/, extract the ZIP file to your phone, and run the EXE file on the phone (through whatever file explorer you have). If that doesn’t work, I don’t know what will.

  4. Hi, It doesn’t work on my PC (W7). It only wrote (I convert from WM6.1 (Ipaq514)) :-(

    C:\Python27>python pim2smsbr.py PIM.pib
    PIM Backup to SMS Backup & Restore Converter
    Written by Oliver Lade (piemaster21@gmail.com)
    More information at http://piemaster.net/tools/winmo-android-sms-converter/
    Questions and comments very welcome!

    – Reading input from ‘PIM.pib’…
    Traceback (most recent call last):
    File “pim2smsbr.py”, line 191, in
    convert(args.source[0], args.out)
    File “pim2smsbr.py”, line 78, in convert
    sms_reader = get_reader(source)
    File “pim2smsbr.py”, line 62, in get_reader
    if not csv_file:
    UnboundLocalError: local variable ‘csv_file’ referenced before assignment¨

    • Hi Milan,

      I can see how that error might occur, but I still don’t think it should. Can you check the contents of your .pib file (rename it to .zip and open it) and see if there’s a .csm file in there? There should be, but I suspect there’s not.

      This may be because you didn’t check the SMSes box when backing up, or perhaps because you used an older version of PIM Backup, or backed up in binary mode or something like that. Try and download my script again (I’ve updated it) and let me know if any of the above sound familiar.

  5. Hey Pie21

    Unfortunatly I’ve some troubles with your converter… :(
    The converter seems to start properly, but unfortunatly it doesn’t work.
    I only get Warnings like the followings:

    WARNING (line 2119): Line incorrectly formed, skipping…
    WARNING (line 2123): Failed to decode line, skipping…

    And in the end I get the following:

    Traceback (most recent call last):
    File “pim2smsbr.py”, line 192, in
    convert(args.source[0], args.out)
    File “pim2smsbr.py”, line 98, in convert
    row = sms_reader.next()
    _csv.Error: new-line character seen in unquoted field – do you need to open the file in universal-newline mode?

    I’m trying to transfer my messages from an Xperia X1. May this be a reason, why it doesn’t work?

    With best regards,
    Merik

    • Hi Merik,
      I’m guessing many or all of your messages are not in the standard ASCII character set, and hence the script is having trouble decoding them. All my messages are in boring old English, so it’s hard to test all different encodings as output from PIM Backup.

      If you could Contact me with your backup file – or even just a line or two from it – I’ll try to work it out for you, but otherwise it’s very hard to diagnose.

  6. Pingback: Anonymous

  7. Hi,

    I got this problem :

    F:\>pim2smsbr.py msgs_20110802.csm
    PIM Backup to SMS Backup & Restore Converter
    Written by Oliver Lade (piemaster21@gmail.com)
    More information at http://piemaster.net/tools/winmo-android-sms-converter/
    Questions and comments very welcome!

    – Reading input from ‘msgs_20110802.csm’…
    Traceback (most recent call last):
    File “F:\pim2smsbr.py”, line 192, in
    convert(args.source[0], args.out)
    File “F:\pim2smsbr.py”, line 79, in convert
    sms_reader = get_reader(source)
    File “F:\pim2smsbr.py”, line 68, in get_reader
    sms_text = csv_file.read().decode(‘utf-16′).split(os.linesep)
    File “C:\Python27\lib\encodings\utf_16.py”, line 16, in decode return codecs.utf_16_decode(input, errors, True)
    UnicodeDecodeError: ‘utf16′ codec can’t decode byte 0x0a in position 787826: truncated data

    Any idea please ?

    • And when using the PIB file, I got many many errors (like Meric)

      and

      —————————————-
      – Processing of 1818 messages complete!

      WARNING: 1590 warnings generated.
      You may like to review the contents of the given lines
      in the source file and correct them manually.
      (If source is .pib, change to .zip and extract .csm file)

      – Writing output to ‘sms.xml’…
      – Output written
      – Conversion complete! (0.46 secs)

      thanks

  8. Hi Pie21
    Really pleased that I have my messages on my Android. Only one small problem all messages I have sent are together in one conversation, not in conversation with the recipient. Any ideas why?
    Recipient and recipient no. are in the csm file.

    • Hi Darren,
      Good to hear that it worked, not so much that it didn’t very well. I’m not sure why conversations get built into one thread like that – it hasn’t happened during my testing.

      May I ask what version of the script you used? I don’t explicitly number them as perhaps I should, but I uploaded a new version about a week ago which I think may have fixed your problem. If you downloaded it a while ago, try doing the conversion + restore process again.

  9. Hey man, I get the following error:

    ******************************************
    C:\V2>python pim2smsbr.py PIMBackup_20110817.pib qwe
    File “pim2smsbr.py”, line 60
    print “ERROR: Unknown input file type ‘%s’, please use the original .pib or
    .csm backup file.” % ext

    ^
    SyntaxError: invalid syntax

    C:\V2>python pim2smsbr.py PIMBackup_20110817.pib
    File “pim2smsbr.py”, line 60
    print “ERROR: Unknown input file type ‘%s’, please use the original .pib or
    .csm backup file.” % ext

    ^
    SyntaxError: invalid syntax

    C:\V2>python pim2smsbr.py
    File “pim2smsbr.py”, line 60
    print “ERROR: Unknown input file type ‘%s’, please use the original .pib or
    .csm backup file.” % ext

    ^
    SyntaxError: invalid syntax

    ******************************************

    Am I running it wrong somehow?

    I’ve got python in PATH and I’m on Windows 7.. How do I point it to the backup file? Seems like no matter what I type after the .py file I get the same error.

    Any ideas?

    Any help is deepy appretiated! Got about 20 000 sms:s that I simply NEED in my life haha

    • Hi Christian,
      That’s a very strange error. It seems to be a problem with the script, not how you’re running it, but I can’t reproduce it. Indeed, in the third case it should throw a different error regarding arguments.

      There is nothing wrong with the syntax of that line… I’m not really sure what to try, except for downloading the script again and ensuring you have the latest 2.x version of Python. Sorry :/.

      If you keep having problems, feel free to contact me with your .pib file and I can convert it for you and send the results back. Both luckily and unluckily, I don’t seem to get the same errors as everyone else.

  10. Ok I’ve solved it.

    Your script seems incompatible with “python-3.2.1.amd64.msi” while on the other hand it works great using “python-2.7.2.amd64.msi”. Might be something that have changed in between the releases, might be my computer.

    It runs fine now though, however I get a couple of warnings:

    *********************************************
    – Processing of 5505 messages complete!

    WARNING: 18764 warnings generated.
    You may like to review the contents of the given lines
    in the source file and correct them manually.
    (If source is .pib, change to .zip and extract .csm file)

    – Writing output to ‘PIMBackup_20110817.xml’…
    – Output written
    – Conversion complete! (10.11 secs)
    *********************************************

    I’m guessing this has something to do with me beeing Swedish and using åäö in my text messages? Is there an easy work around to export åäö too?

    • Correct: Python 2.x code is generally incompatible with Python 3.x. Sad but true.

      18,000 warnings is more than a couple :). I don’t even know how you CAN get more warnings than there are messages, but there you go. It’s almost certainly having trouble decoding your non-ASCII characters, which is possible to fix. Strangely, when people have these problems and send me their file to try to convert, I don’t have the problems and it works fine. This is good because I can send the result back, but bad because it doesn’t help solve the underlying problem.

      That said, if you’d like to contact me with your .pib backup file, I’d be happy to see what I can do about it. By the sounds of it I won’t be able to understand anything personal anyway :P.

    • Hi Tuan,
      “Using Python” is as simple as installing it, then opening your command prompt and typing python pim2smsbr.py backup_file, but replace backup_file with the location of your backup file. See this informative post for more detailed instructions. The PIB file should then be converted automatically.

      I’ll write up some clearer instructions soon, but hopefully that gets you through.

  11. getting the same error as Christian but using python 2.72amd64 as suggested
    “ERROR: Unknown input file type ‘%s’, please use the original .pib or
    .csm backup file.” % ext

    any ideas ?

  12. Hi,
    I get this error message: Can you help?
    ————————————————————-
    C:\Python27>Python pim2smsbr.py PIMBackup_20111130.pib
    PIM Backup to SMS Backup & Restore Converter
    Written by Oliver Lade (piemaster21@gmail.com)
    More information at http://piemaster.net/tools/winmo-android-sms-converter/
    Questions and comments very welcome!

    – Reading input from ‘PIMBackup_20111130.pib’…
    Traceback (most recent call last):
    File “pim2smsbr.py”, line 207, in
    convert(args.source[0], args.out)
    File “pim2smsbr.py”, line 78, in convert
    sms_reader = get_reader(source)
    File “pim2smsbr.py”, line 68, in get_reader
    sms_text = csv_file.read().decode(‘utf-16′).split(os.linesep)
    File “C:\Python27\lib\encodings\utf_16.py”, line 16, in decode
    return codecs.utf_16_decode(input, errors, True)
    UnicodeDecodeError: ‘utf16′ codec can’t decode bytes in position 23156-23157: illegal UTF-16 surrogate

  13. Dear Mr. Pie21,
    I’ve tried all the things you said to convert pib file to XML but I couldn’t do it… would you please change it for me?… I just need to know how to send you the file.
    I’ll be much appreciated.
    I hope you’ll reply soon…
    Best Regards.

    • G’day Nezar,
      I’m happy to do what I can to help you out now that I think I’ve fixed a few of the problems. You can send your .PIB file to me by email (promise I won’t read it!) if you like and I’ll reply with the XML. Alternatively, leave a post about whatever problem you’re having in the forums and hopefully I can fix it for everyone all at once.

  14. Hello Mr. Pie,

    Thanks for your efforts to help us all, I don’t get any error msg, I’ve installed python 2.x and when i run the command
    “python pim2smsbr.py C:\Documents and Settings\administrator\Desktop\PIMBackup_20111221.pib [SMSBACKUP],”
    the black window flashes and goes, nothing happens, the output file is not there. How do i get the output file which i named as SMSBACKUP in xml format.
    Thanks & Best Regards
    Sumit

  15. Hello!

    Firstly, I just want to start by saying thanks for addressing this big problem area of converting WinMo SMS messages to a format for Android. I’ve spent hours and hours looking into this area and this is the best fix I’ve found … but sadly my conversion is failing at the last hurdle. But I’ve got faith – its nearly there!

    Got Python all running ok, but hit errors on conversion. Been ok turning the pib into a zip and editing native csm file in Excel before carefully putting back into same file format via Notepad, so no probs there.

    I thought this problem might be down to non-standard text, so I made sure it was converted to ASCII. Then I tried Unicode. Still no luck. Then got “field limit” errors, so I tried trimming down the huge file (13,000 texts!) but even with only 1,000 still hitting errors. Then I thought that might be secondary to some odd messages where texts with carriage returns had split across lines, so took care to delete these messages in the raw csm file opened in Excel. Still no luck.

    Finally, after many hours, I have to admit defeat!

    I get two variations of error messages. These are:

    c:\Python27>python pim2smsbr.py PIMBackup_20111225.p

    —————————————-
    PIM Backup to SMS Backup & Restore Converter
    Written by Oliver Lade (piemaster21@gmail.com)
    More information at http://piemaster.net/tools/winm
    Questions and comments very welcome!
    —————————————-

    – Reading input from ‘PIMBackup_20111225.pib’…
    – Processing SMS messages
    —————————————-
    – Working…
    Traceback (most recent call last):
    File “pim2smsbr.py”, line 249, in
    convert(args.source[0], args.out)
    File “pim2smsbr.py”, line 105, in convert
    row = sms_reader.next()
    _csv.Error: field larger than field limit (131072)

    c:\Python27>python pim2smsbr.py PIMBackup_20111225.pib

    —————————————-
    PIM Backup to SMS Backup & Restore Converter
    Written by Oliver Lade (piemaster21@gmail.com)
    More information at http://piemaster.net/tools/winmo-android-sms-converter/
    Questions and comments very welcome!
    —————————————-

    – Reading input from ‘PIMBackup_20111225.pib’…
    Traceback (most recent call last):
    File “pim2smsbr.py”, line 249, in
    convert(args.source[0], args.out)
    File “pim2smsbr.py”, line 86, in convert
    sms_reader = get_reader(source)
    File “pim2smsbr.py”, line 76, in get_reader
    lines = csv_file.read().decode(‘utf-16′).encode(‘utf-8′).splitlines()
    File “c:\Python27\lib\encodings\utf_16.py”, line 16, in decode
    return codecs.utf_16_decode(input, errors, True)
    UnicodeDecodeError: ‘utf16′ codec can’t decode byte 0x0a in position 2944716: tr
    uncated data

    Any help or suggestions you’re able to offer would be very welcome!

    Merry Christmas!

    • Hi Ed,

      Merry Christmas to you too, and hopefully we can fix this as a present. Sounds like the converter is hitting some non-standard character and freaking itself out. If you could send me your PIB or CSM file, or even just the offending message (if you can isolate it), then I can dig into it and try to handle the error. I’m no expert at understanding encoding, so I need some concrete test cases to understand what’s breaking.

  16. thank you VERY much.
    worked perfectly for me :)

    I moved 145 conversations and ~6000 sms from my xperia x1 to my xperia arc s in about 4 minutes.

    best regards from germany!

    • Hi Chris! That’s really great to hear! The only people who really comment on this are those for whom it doesn’t work, so it’s easy to get the impression that it doesn’t work for anyone, especially Germans with their indecipherable characters. This is good news though. Thanks for letting me know :D.

  17. i used the “export SMS” while my PPC was still working, now i have a SMS.XML file that i can view ok but my problem is that the date for all sms messages is a format like this”1193098459000″ which makes no sense at all to me. its very important that i can convert this format to a readable text. any idea how i can do that.
    Thank you

      • I used SMS exporter and no i don’t have access to an android phone, i would like to know how you converted the date? and if there a script or utility to do that..
        much appreciated

        • My script converts output from PIM Backup to XML for an Android device. If neither of these apply to you, then neither does this tool. In Python (where YOUR_TIME is the variable in which your time to convert is stored) you can use:

          import time
          print time.ctime(YOUR_TIME / 1000)

          You can apply this to a list or a whole document if you like, but it will depend on a number of factors. Perhaps ask over at StackOverflow, or provide some more details.

  18. dear sir i dont have that knowledge regarding this python stuff and all .thou i tried enf number of time doing it i dint get the output file,I am a doctor from india,no technical knowledge regarding this,if i send the back up file to you will you help me out sending the output file ,i cant tell u how much use it would be for me ,please sir,waiting for your reply

  19. I’ve successfully got the .pib file. The problem is when I run your program I got the following:

    WARNING : Sent message destination not found, leaving empty…
    WARNING : Sent message destination not found, leaving empty…
    WARNING : Sent message destination not found, leaving empty…
    ……
    …..
    ….
    WARNING : Sent message destination not found, leaving empty…

    Traceback :
    convert
    File “pim2smsbr.py” line 129 in convert>>
    items.append(process(row, line_num))
    File “pim2smsbr.py”, line 180, in process
    item['date'] = int<time.mktime<time.strptime>>*1000
    ValueError: year out of range

    Please help me out.
    thank you
    File “pim2smsbr.py

    • Hi Lex,
      I’m not quite sure what the problem is there; it’s not one I’ve seen before. The WARNINGs are common for some people (might be a quirk of certain phones or something), but the error looks like there’s an incorrectly-formatted timestamp somewhere in your messages. If you send me the file I can have a look and sort it out, but otherwise I’ll have to leave it to you to track it down.

  20. hi i have tried to convert my windows mobile (HTC HD2) for transfer to my new android phone. i have backed up as required with the BIn unticked. but whenn i try to python the file in command prompt it tells me it is not a recognised command. Can you tell me how and where i need to write this please. Sorry i am not that offay with the more technical aspects of computing. I would very much appreciate yur help please. Thank you.

    • Hi Faheem,
      Sounds like your system can’t find Python. If you installed it, you may also need to add its directory to your system’s PATH. It’s pretty easy, and should hopefully make it work. Follow these instructions, which basically says find your system’s environment variables and add “;C:\Python27″ (with no quotes, but including the semicolon) to the end and try again.

      If after all that it still doesn’t work, feel free to send it to me and I’ll send back the output.

  21. hello,
    thank you for the quick reply, but i couldn’t access the link for instructions either on IE or Google chrome. and the command still didn’t work. i typed in C:>Python27 filename then enter but didnt recognise command. if i saved the python download in my documents and just installed it does it install on C: and not another location??

    Can you help me again please?

    thank you in advance

    Regards

    Faheem

    • Hi again,
      Sorry, the site seems to have just gone down… how strange. Anyway, instead of typing “python” you can use the full path of C:\Python27\python.exe, and then type the full path to your PIM file (easiest if you copy it to top of your C drive), e.g. C:\filename.pib. That should work without setting up your system path.

      Alternatively, you can copy your .pib file into C:\Python27, then in the command prompt type the following commands (the output should appear in C:\Python27\filename.xml):
      cd C:\Python27
      python.exe filename

      By default Python installs to C:\Python27 (assuming version 2.7), no matter where you install from. Let me know how it goes!

  22. Hi.
    Thanks for your app-converter!

    I suppose that there is not much many WM devices any more, but I hope it can help to someone.
    The script has 2 main errors on conversion:
    Case 1: When the contact has numbers in his name, like “John Do3″, the conversion saves his phone number as “3″
    Case 2: When the message has a company name (and no number), message appears as “None”.

    To avoid both cases, I have removed these 3 lines (better, place a # before each one):
    ‘# Match a string of digits with an optional plus
    match = re.search(‘[^+\d]*(\+*[\d]+)\D*’, row[2])
    item['address'] = match.group(1) if match else None’

    With these:
    ‘ if row[2][0] == ‘”‘:
    match = re.search(‘(?<=\)’, row[2])
    item['address'] = match.group(0)
    else:
    item['address'] = row[2]‘

    IzK

    • Thanks IzK! I wouldn’t have picked up on those. I’ll merge those changes in after these exams or over.

      There’s much more I could do to clean things up too; ideally I’d like to make it a web service so people don’t have to struggle with installing Python. Comments like these help!

  23. Thanks for this. Worked a charm. 2 things tha tI struggled with careful that you don’t back emails along with your SMS and I found it easier to copy all the required files into the Python folder. DO NOT type “python” in the Windows Run or Search box. Rather type CMD then go to the Python folder then run the script as describe and you will save many frustrating hours.

  24. Sooo I’m going a bit insane here and contemplating destroying my desktop at this late/early hour. I’m no pro with commands but even reading down and trying the different variations of the command including relocating the pib file I still get nothing more than “SyntaxError: invalid syntax”

    Any chance someone can save me from my lack of skill?

    • Hi Aleida, are you typing the command into the command prompt or the Python interpreter? If you type it into the Python interpreter (i.e. if you see three arrows, like >>>), then you will get a syntax error, because it will be expecting Python code. However the command prompt, you should see something like C:\Users\Aleida>_ and then it will be expecting a Windows command, such as cd or dir or pytohn, with some other inputs following the command. Thus “python pim2smsbr.py myfile.pim” will say “run Python, pass it the converter script, and pass that the input file to convert.”

      Let me know if that does or doesn’t help, and feel free to send me your PIM file if all else fails.

      • Ahh sweet stubborn determination you pull me through again ^_^ SO in summation I initially assumed my dated PIM Backup would suffice but after updating to the latest version, figuring out how to set the PATH for python, and fiddling around to set my desktop as the directory VIOLA! Sweet sentimental messages welcome to your new Android EVO 4G LTE home and out of the dated but adored WinMo 6.5 TP2 ^_^ ^_^ ^_^

        Now I’m just trying to figure out why my sent messages aren’t threaded into their correct conversations. Currently they’re bundled together in a conversation all their own… Any idea on how I can fix that?

        • Unfortunately I’m not sure why your sent messages are being grouped… this only appears to happen to some people, which is strange. My best guess is that perhaps you don’t have a “me” contact set, so your sent message are recorded without any “from” details? You could have a look at the backup source file (if you’re feeling brave) and see if anything’s missing (though you don’t have much to compare to).

  25. It seemed to work fine except that all the messages I sent as replied are grouped into a single thread and I cant tell what was sent to who.

    • Hi Connor, sorry to hear that. As I just replied to Aleida above, this problem doesn’t affect everyone; could it be that you don’t have a contact that refers to you, the owner of the phone?

  26. hi mate
    i install python 2.7.3
    in CMD i type C:Python27>Python pim2smsbr.py con-91-6-11.pib
    but this error happened to me :
    —————————————-
    PIM Backup to SMS Backup & Restore Converter
    Written by Oliver Lade (piemaster21@gmail.com)
    More information at http://piemaster.net/tools/winmo-android-sms-converter/
    Questions and comments very welcome!
    —————————————-

    – Reading input from ‘con-91-6-11.pib’…

    !!!!!!!!!
    ! ERROR !
    !!!!!!!!!

    -> Couldn’t find messages file. Please check your input path and contents.

    For help resolving this error:
    More information – http://piemaster.net/tools/winmo-android-sms-converter/
    Help in the forums – http://piemaster.net/forums/

    i don’t now where i should “pib file” and” pim2smsbr.py” ?
    in C:Python27 or…..?

    • Hi Mohsen, fortunately this is not an uncommon problem.

      In command prompt, the string to the left of the > character is your “working directory”. When you want to specify the path to a file (pim2smsbr.py or your PIB file), you can do it relative to this path. For the simplest solution, just copy your .py and .pib files into your working directory, and your previous command should work.

      Alternatively, you can Shift + right click on the files and select “Copy as path”, which will copy an absolute path. You can paste this into command prompt (right click, Paste), and then you don’t have to worry about your working directory; it will work from anywhere.

      Good luck, and let me know if it works!

  27. Hi, i tried the script and it work, but the sent sms is all in one conversation.
    i’ve my contact (my name with my number) in address book, the output is that all sent message from me go in conversation with me.
    input:
    me to contact1, contact1 to me, me to contact2, contact2 to me, me to contact3
    output:
    conversation me: me to contact1, me to contact2, me to contact3
    conversation contact1: contact1 to me
    conversation contact2: contact2 to me

    thanks for the work

  28. Hello, another information i can give you for the problem “sent message” not go in right conversation with destination contact. I not use the “sent” folder, i use custom folder to make a conversation with contact. so if you check the folder “sent” to change type=2, this can be the problem

    • Hi m4rv1n, I’m sorry to hear it didn’t work for you, but I’m not quite sure what you’re asking me to do. Did the type=2 setting fix the import or break it? Hopefully the former, since I really don’t have any time to do anything for about 6 weeks.

  29. hi Pie, the type=2, as you know, is to make the sms in the “sent state”, the type=1 is the “received state”.
    I not use the sent folder, so if you check only the folder without check the sender contact (when sender=mynumber set type=2) , the sent sms not in sent folder go in type=1 with sender=mycontact.
    You can add a matching rule that ask the “mynumber” var (also not check if the number is with or without the international code) to set type=2 .
    Hope help you!

  30. Hi,

    Its showing me error:

    – Reading input from ‘PIMBackup_20121027.pib’…
    – Processing SMS messages
    —————————————-
    – Working…
    Traceback (most recent call last):
    File “pim2smsbr.py”, line 254, in
    convert(args.source[0], args.out)
    File “pim2smsbr.py”, line 129, in convert
    items.append(process(row, line_num))
    File “pim2smsbr.py”, line 180, in process
    item['date'] = int(time.mktime(time.strptime(row[16], ‘%Y,%m,%d,%H,%M,%S’)))
    * 1000
    OverflowError: mktime argument out of range

    Whats the problem..??
    Can anyone fix it..

    • Hi Yunus, thanks for reporting this error; it really shouldn’t happen if your times are formatted correctly. Do you have any idea what the format of the time that was causing the error was? I could try to handle that separately. Cheers though!

    • Great to hear! My HD2 is still going strong with a Jelly Bean ROM, but I installed the system data to a cheap SD card to preserve my international 512MB internal memory, so it’s painfully slow. It’s pretty, though!

  31. Hi there,
    I was tring to convert the SMS with your script on my linux box, but unfortunately it fails giving these errors:
    : not found
    : not found.py: 35: ./pim2smsbr.py:
    ./pim2smsbr.py: 36: ./pim2smsbr.py: import: not found
    ./pim2smsbr.py: 37: ./pim2smsbr.py: import: not found
    ./pim2smsbr.py: 38: ./pim2smsbr.py: import: not found
    ./pim2smsbr.py: 39: ./pim2smsbr.py: import: not found
    ./pim2smsbr.py: 40: ./pim2smsbr.py: import: not found
    from: can’t read /var/mail/zipfile
    from: can’t read /var/mail/xml.sax.saxutils
    : not found.py: 43: ./pim2smsbr.py:
    ./pim2smsbr.py: 44: ./pim2smsbr.py: SMS_LABEL: not found
    ./pim2smsbr.py: 45: ./pim2smsbr.py: DETAIL_URL: not found
    : not found.py: 46: ./pim2smsbr.py:
    ./pim2smsbr.py: 48: ./pim2smsbr.py: Syntax error: “(” unexpected

    My pib is a fresh backup file created with the specifications above.
    I’ve read that there’re some problem with special characters, and I suppose that might be the same for me (there could be some italian characters in).
    Can you please assist ?

    Thx in advance,
    Marco

  32. Hi, I tried your work step by step without problems, only the last step didn’t work, sms backup &restore can’t find my .xml – file. I’ve put it into folder external_sd/smsbackup (ther was no folder “SMSBackupRestore”), where the program also put its own files to, and it didn’t find anything. But it’s there, I can see it in my explorer, so why that?

    Many thanks for help,
    Louis

    • Hi Louis, that sounds more like an issue with SMSBR, so I’m not entirely sure. Now that I’ve done it, I’m only using SMS Backup+ which syncs everything straight to Gmail. You could possibly ask Ritesh with a comment, or just follow the time-honoured tradition of trying everything until it works. Sorry I can’t be of much help!

  33. Cheers, mate!
    Your script works like a charm!

    Just one addition and tip for people in a similar situation. If you have used several phone numbers with your previous phone and did some backups and restores, PIMBackup cannot handle that and puts your other numbers to the CSV as sender.

    To accomodate for that I simply had to add those numbers to the was_sent condition like this: was_sent = (row[2] == ” or row[2] == ’123456789′ or row[2] == ’987654321′), after which the script took the right field as the address field, and the conversations show up right.

  34. Hello!
    I have a problem with restoring the .xml file.
    I used GO Sms to backup all my text messages before changing the device. Now I tried several apps to restore the file. Super Backup showed “No messages found”, SMS Backup & Restore “0 messages restored”, Go SMS keeps restoring for few hours then no message appears.
    I put the xml file through some online backup xml file reader and all my text messages where there.

    Do you have any idea why this happens and how it can be fixed?

    Thanks in advance!

    • Unfortunately I’m totally unfamiliar with GO SMS, but I’m pretty sure my script will be incompatible with your output. I’d recommend either contacting the developers of GO SMS, or backing up all your messages again with PIM Backup, as outlined above (or both!).

  35. Hi,

    I’m having this error:

    – Working…
    WARNING (line 1120): Failed to decode line (CSV error), skipping…
    WARNING (line 1140): Failed to decode line (CSV error), skipping…
    WARNING (line 1465): Failed to decode line (CSV error), skipping…
    WARNING (line 1619): Failed to decode line (CSV error), skipping…

    When i go and see the line i cannot found the “bug”, can you give me some pointers?

    Thanks

Leave a Reply