Notices


Reply
Thread Tools
Posts: 16 | Thanked: 8 times | Joined on Jan 2010
#1
Hi ,

I got an HTC Desire under Android 2.1 .

I am looking for a method to export my sms from N900 to Android.

I know a method who can import sms in file .csv from pc suite.

Or do you know an application on N900 who can generate a .csv file structured like pc suite one's ?

Thanks for advance for your help.
 

The Following User Says Thank You to BabylonV2000 For This Useful Post:
Posts: 16 | Thanked: 8 times | Joined on Jan 2010
#2
Hi ,

No answer to my Thread :=((
Ok when i backup my message where the file is stocked ?

i hope the backup file is in .csv.

Thanks for your answer.
 

The Following User Says Thank You to BabylonV2000 For This Useful Post:
Posts: 16 | Thanked: 8 times | Joined on Jan 2010
#3
Hi,

After some googling i found my answer
1. export sms from n900 with smsexporter (cf http://talk.maemo.org/showthread.php?t=37354)
2. import them in Android (cf http://libe.toile-libre.org/?p=530)

Hope it could help.

Thanks for reading
 

The Following 4 Users Say Thank You to BabylonV2000 For This Useful Post:
Posts: 15 | Thanked: 3 times | Joined on Sep 2010 @ Australia
#4
Originally Posted by BabylonV2000 View Post
Hi,

After some googling i found my answer
1. export sms from n900 with smsexporter (cf http://talk.maemo.org/showthread.php?t=37354)
2. import them in Android (cf http://libe.toile-libre.org/?p=530)

Hope it could help.

Thanks for reading
did you export sms from smsexporter?

Cheers
 

The Following User Says Thank You to motom For This Useful Post:
Posts: 119 | Thanked: 22 times | Joined on Dec 2009
#5
guys, any update on this? link under 2. doesn't work
 

The Following User Says Thank You to inzimam For This Useful Post:
Posts: 1 | Thanked: 1 time | Joined on Jun 2010
#6
I managed by exporting my SMSes in .csv format from Nokia PC suite.
By using Ath2Sms from Android market i could import them into gingerbread. Had to do it separately for sent and recieved SMSes.

First I tried to export with Ovi suite but Ath2Sms did not recognize .cvs format from Ovi.

Last edited by Rotsopp; 2011-06-15 at 18:09.
 

The Following User Says Thank You to Rotsopp For This Useful Post:
Posts: 1 | Thanked: 5 times | Joined on Apr 2014
#7
Hi all,

I know that this thread is old, but probably there are still people around here needing to import N900 SMS on Android. I finally had to bury my beloved Nokia after the second Touchscreen started to malfunction as well

Anyway, I do not have access to a working Ovi Suite for exporting my SMS, so I used a Backup copy of the phone (created using the Backup & Recovery tool on the N900) for that. This is just a folder containing some zip archives, containing more folders and archives and finally there's an SQLite database containing the SMS. A tool like SQLite database browser can then be used to export the table into a CSV file, which in turn can be converted to the standard Nokia format understandable for e.g. SMS Tools on Android. For this conversion, I've written a little Perl script, see below (n900_smsconv.pl). This also contains some more usage information.

Maybe it helps anyone.

Cheers,
Philipp

Code:
#!/usr/bin/perl

use strict;
use warnings;
use Time::Piece;

my %sms;
my $numsms = 0;

# Dump the SMS from an N900 backup file:
# 1. Open the backup folder and use an unpacker to open comm_and_cal.zip.
# 2. Navigate to /Root/home/user/.rtcom-eventlogger/ in the archive.
# 3. Open the backup.tgz archive.
# 4. Extract el-v1.db and open it using "SQLite database browser".
# 5. Select "File" -> "Export" -> "Table as CSV file".
# 6. Choose table "Events" and store the file.

# The file now contains the SMS along with some other events. Double
# quotes (") in the SMS text are replaced by "" (double double quotes)
# and new lines are still present. This script takes care of the former
# and replaces them by '' (two apostrophes), but it doesn't handle the
# latter. This makes some quasi-manual preprocessing necessary, which
# can be done using the Geany text editor:
# Replace all ([^"])\n by \1 to get rid of wrapped lines. Repeat this step
# until the pattern is not found anymore.
# If you ignore this step, multi-line messages will be silently discarded.

# When this is done, the script can be run by supplying the converted
# CSV file as standard input and redirecting standard output to another
# CSV file:
# ./n900_smsconv.pl < sms_in.csv > sms_out.csv

# An application like "SMS Tools" can then be used to import the SMS
# into your Android phone (choose the nokia format when asked).

# The database contains some definitions for the various IDs, those
# are shown in the following lists:

# service_id field:
# 1:  RTCOM_EL_SERVICE_CALL
# 2:  RTCOM_EL_SERVICE_CHAT
# 3:  RTCOM_EL_SERVICE_SMS

# event_type_id field:
# 1:  RTCOM_EL_EVENTTYPE_CALL
# 2:  RTCOM_EL_EVENTTYPE_CALL_MISSED
# 3:  RTCOM_EL_EVENTTYPE_CALL_VOICEMAIL
# 4:  RTCOM_EL_EVENTTYPE_CHAT_MESSAGE
# 5:  RTCOM_EL_EVENTTYPE_CHAT_NOTICE
# 6:  RTCOM_EL_EVENTTYPE_CHAT_ACTION
# 7:  RTCOM_EL_EVENTTYPE_CHAT_AUTOREPLY
# 8:  RTCOM_EL_EVENTTYPE_CHAT_JOIN
# 9:  RTCOM_EL_EVENTTYPE_CHAT_LEAVE
# 10: RTCOM_EL_EVENTTYPE_CHAT_TOPIC
# 11: RTCOM_EL_EVENTTYPE_SMS_MESSAGE

# flags field:
# 1:  RTCOM_EL_FLAG_CHAT_GROUP
# 2:  RTCOM_EL_FLAG_CHAT_ROOM
# 3:  RTCOM_EL_FLAG_OPAQUE
# 4:  RTCOM_EL_FLAG_OFFLINE
# 5:  RTCOM_EL_FLAG_SMS_PENDING
# 6:  RTCOM_EL_FLAG_SMS_TEMPORARY_ERROR
# 7:  RTCOM_EL_FLAG_SMS_PERMANENT_ERROR

foreach my $csvline (<STDIN>) {
  chomp $csvline;
  if ($csvline =~ m/
      "(\d+)",                # 1  id                 e.g. "3131"
      "(3)",                  # 2  service_id         e.g. "3"
      "(11)",                 # 3  event_type_id      e.g. "11"
      "(\d+)",                # 4  storage_time       e.g. "1396603341"
      "(\d+)",                # 5  start_time         e.g. "1396603339"
      "(\d+)",                # 6  end_time           e.g. "1396603341" or "0"
      "(\d+)",                # 7  is_read            e.g. "1"
      "(\d+)",                # 8  outgoing           e.g. "0" or "1"
      "(\d+)",                # 9  flags              e.g. "0"
      "(\d+)",                # 10 bytes_sent         e.g. "0"
      "(\d+)",                # 11 bytes_received     e.g. "0"
      "([^"]*)",              # 12 local_uid          e.g. "ring tel ring"
      "([^"]*)",              # 13 local_name         e.g. "<SelfHandle>"
      "([^"]*)",              # 14 remote_uid         e.g. "+4179..."
      "([^"]*)",              # 15 channel            e.g. ""
      "(.*?)",                # 16 free_text          e.g. "abcdef"
      "([^"]*)"               # 17 group_uid          e.g. "6288879"
      $/pxo)
  {
    $sms{$numsms}{'sent'} = int($8);
    $sms{$numsms}{'time'} = $5;
    $sms{$numsms}{'number'} = $14;
    $sms{$numsms}{'msg'} = $16 =~ s/""/''/ro;
    ++$numsms;
  }
}

print STDERR "Parsed $numsms messages.\n";

foreach my $key (sort {$a<=>$b} keys %sms) {
  print '"sms",';
  my $number = $sms{$key}{'number'};
  my $time = localtime($sms{$key}{'time'})->strftime('%Y.%m.%d %H:%M');
  my $text = $sms{$key}{'msg'};
  if ($sms{$key}{'sent'}) {
    print '"SENT",';
    print '"",';
    print "\"$number\",";
  } else {
    print '"READ,RECEIVED",';
    print "\"$number\",";
    print '"",';
  }
    print '"",';
    print "\"$time\",";
    print '"",';
    print "\"$text\"\n";
}
 

The Following 5 Users Say Thank You to phip For This Useful Post:
Posts: 14 | Thanked: 36 times | Joined on Dec 2009 @ Adelaide, Australia
#8
Originally Posted by phip View Post
Hi all,
I know that this thread is old, but probably there are still people around here needing to import N900 SMS on Android. I finally had to bury my beloved Nokia after the second Touchscreen started to malfunction as well
Thanks Phillipp. This script was a big help to me.

A couple of notes for anyone else needing to do this conversion:

1) Check that the order of the CSV fields in csvline matches up against the CSV you exported from the database browser. I had to reorder some fields, add a new field (mc_profile), and change the event type ID from 11 to 7 to get it to work.

2) When using SMS Tools to do the import, if you don't allow it to be the default SMS app the import will appear to do stuff, but won't actually achieve anything. So you need to allow it to be the default app. After the import it will offer to make Messaging the default SMS app again.
 

The Following 2 Users Say Thank You to toojays For This Useful Post:
Posts: 26 | Thanked: 16 times | Joined on Mar 2010
#9
As toojays already said, current backups have a slightly different column count and order. I've had a lot of fun with the csv export from the database, especially with commas and newlines in the messages. I finally gave up, exported with a different delimiter, and did some magic with libreoffice. This slightly changed script ran fine:

Code:
#!/usr/bin/perl

use strict;
use warnings;
use Time::Piece;

my %sms;
my $numsms = 0;

# Dump the SMS from an N900 backup file:
# 1. Open the backup folder and use an unpacker to open comm_and_cal.zip.
# 2. Navigate to /Root/home/user/.rtcom-eventlogger/ in the archive.
# 3. Open the backup.tgz archive.
# 4. Extract el-v1.db and open it using "SQLite database browser".
# 5. Select "File" -> "Export" -> "Table as CSV file".
# 6. Choose table "Events" and store the file.

# The file now contains the SMS along with some other events. Double
# quotes (") in the SMS text are replaced by "" (double double quotes)
# and new lines are still present. This script takes care of the former
# and replaces them by '' (two apostrophes), but it doesn't handle the
# latter. This makes some quasi-manual preprocessing necessary, which
# can be done using the Geany text editor:
# Replace all ([^"])\n by \1 to get rid of wrapped lines. Repeat this step
# until the pattern is not found anymore.
# If you ignore this step, multi-line messages will be silently discarded.

# When this is done, the script can be run by supplying the converted
# CSV file as standard input and redirecting standard output to another
# CSV file:
# ./n900_smsconv.pl < sms_in.csv > sms_out.csv

# An application like "SMS Tools" can then be used to import the SMS
# into your Android phone (choose the nokia format when asked).

# The database contains some definitions for the various IDs, those
# are shown in the following lists:

# service_id field:
# 1:  RTCOM_EL_SERVICE_CALL
# 2:  RTCOM_EL_SERVICE_CHAT
# 3:  RTCOM_EL_SERVICE_SMS

# event_type_id field:
# 1:  RTCOM_EL_EVENTTYPE_CALL
# 2:  RTCOM_EL_EVENTTYPE_CALL_MISSED
# 3:  RTCOM_EL_EVENTTYPE_CALL_VOICEMAIL
# 4:  RTCOM_EL_EVENTTYPE_CHAT_MESSAGE
# 5:  RTCOM_EL_EVENTTYPE_CHAT_NOTICE
# 6:  RTCOM_EL_EVENTTYPE_CHAT_ACTION
# 7:  RTCOM_EL_EVENTTYPE_CHAT_AUTOREPLY
# 8:  RTCOM_EL_EVENTTYPE_CHAT_JOIN
# 9:  RTCOM_EL_EVENTTYPE_CHAT_LEAVE
# 10: RTCOM_EL_EVENTTYPE_CHAT_TOPIC
# 11: RTCOM_EL_EVENTTYPE_SMS_MESSAGE

# flags field:
# 1:  RTCOM_EL_FLAG_CHAT_GROUP
# 2:  RTCOM_EL_FLAG_CHAT_ROOM
# 3:  RTCOM_EL_FLAG_OPAQUE
# 4:  RTCOM_EL_FLAG_OFFLINE
# 5:  RTCOM_EL_FLAG_SMS_PENDING
# 6:  RTCOM_EL_FLAG_SMS_TEMPORARY_ERROR
# 7:  RTCOM_EL_FLAG_SMS_PERMANENT_ERROR


foreach my $csvline (<STDIN>) {
  chomp $csvline;
  if ($csvline =~ m/
      (\d+),                # 1  id                 e.g. "3131"
      (3),                    # 2  service_id         e.g. "3"
      (7),                    # 3  event_type_id      e.g. "11"
      (\d+),                # 4  storage_time       e.g. "1396603341"
      (\d+),                # 5  start_time         e.g. "1396603339"
      (\d+),                # 6  end_time           e.g. "1396603341" or "0"
      (\d+),                # 7  is_read            e.g. "1"
      (\d+),                # 8  flags              e.g. "0"
      (\d+),                # 9 bytes_sent         e.g. "0"
      (\d+),                # 10 bytes_received     e.g. "0"
      ([^"]*),             # 11 local_uid          e.g. "ring tel ring"
      ([^"]*),             # 12 local_name         e.g. "<SelfHandle>"
      ([^"]*),             # 13 remote_uid         e.g. "+4179..."
      ([^"]*),             # 14 channel            e.g. ""
      (.*?),                 # 15 free_text          e.g. "abcdef"
      ([^"]*),             # 16 group_uid          e.g. "6288879"
      (\d+),                # 17  outgoing           e.g. "0" or "1"
      (\d+)                 # 18  mc_profile           e.g. "0" or "1"
      $/px)
  {
    $sms{$numsms}{'sent'} = int($17);
    $sms{$numsms}{'time'} = $5;
    $sms{$numsms}{'number'} = $13;
    $sms{$numsms}{'msg'} = $15 =~ s/""/''/ro;
    ++$numsms;
  }else{
    print STDERR "not parsed: ".$csvline."\n";
  }
}

print STDERR "Parsed $numsms messages.\n";

foreach my $key (sort {$a<=>$b} keys %sms) {
  print '"sms",';
  my $number = $sms{$key}{'number'};
  my $time = localtime($sms{$key}{'time'})->strftime('%Y.%m.%d %H:%M');
  my $text = $sms{$key}{'msg'};
  if ($sms{$key}{'sent'}) {
    print '"SENT",';
    print '"",';
    print "\"$number\",";
  } else {
    print '"READ,RECEIVED",';
    print "\"$number\",";
    print '"",';
  }
    print '"",';
    print "\"$time\",";
    print '"",';
    print "\"$text\"\n";
}
In case it doesn't, it's always helpful to run the perl debugger and/or some online one-click perl interpreter for fast debugging. A demo line of a valid message always helps as well.


Changed back my commas and newlines in the csv output and installed the "Sms Tools - All in one" (Valiero Finazzo - thanks man!) from the app store. Sent the stuff to the device, hit import, done! (backup your current messages first, you know...)

Well, guess my N900 is now ready for retirement after 7.5 years of service...
 

The Following 2 Users Say Thank You to Bzzz For This Useful Post:
Reply

Tags
export sms, fremantle

Thread Tools

 
Forum Jump


All times are GMT. The time now is 18:56.