How to access SMS database in Sailfish?
I am trying to find a way to import my SMS'es from my N9 to my new Jolla device. By looking around the device I see that it's got a tracker DB just like N9 has, in /home/nemo/.cache/tracker/
Hence, I'd believe SMS'es are stored in tracker the same way that N9 handles them. Now, on N9 I can get my SMS'es via tracker query: tracker-sparql -q "select nie:plainTextContent(?d) where {?d a nmo:SMSMessage}" The same thing on Jolla device, however, returns nothing: [nemo@localhost ~]$ tracker-sparql -q "select nie:plainTextContent(?d) where {?d a nmo:SMSMessage}" On N9 when I grep SMS from the used classes I get the hit for it: ~ $ And on Jolla it seems to be unused: [nemo@localhost ~]$ Now, how would I get to my messages on Jolla? |
Re: How to access SMS database in Sailfish?
The access layer for messages isn't tracker but libcommhistory, tracker just happens to be the storage engine on the N9
libcommhistory is part of the nemo middleware layer so it can be used on Sailfish aswell, see https://github.com/nemomobile/libcommhistory/ I've started working on an Harmattan exporter (to CSV) and Sailfish importer, the exporter is finished, but the importer isn't there yet. The code lives on github: https://github.com/merlin1991/Harmattan-SMS-Boat EDIT: since not everyone has a working scratchbox installation, here's a built binary: http://cdnm.at/~christian/Harmattan-SMS-Boat/smsExport (use save link as) |
Re: How to access SMS database in Sailfish?
Quote:
Code:
[sbox-HARMATTAN_ARMEL: ~/Harmattan-SMS-Boat/n9Export] > qmake |
Re: How to access SMS database in Sailfish?
Quote:
|
Re: How to access SMS database in Sailfish?
Nice Merlin1991,
Back in the day, I actually transferred all my messages from my N900 to my N9. So now there are well over 20000 messages on my N9. I think this time I will not import them as the database gets a bit large because of that import. Unless some of you guys tells me to put Jolla to the test. :) |
Re: How to access SMS database in Sailfish?
I maintain the messaging stack for Jolla, so there are some pointers I can give here..
Quote:
Your CSV exporter looks like a great start. For importing, use /org/freedesktop/Telepathy/Account/ring/tel/account0 as the localUid. Use a GroupModel to create one group per unique phone number, and then an EventModel to create events. Make sure to set the right groupId on events. I wouldn't recommend trying to import IM messages from the N9. Quote:
|
Re: How to access SMS database in Sailfish?
Quote:
But apart from a wikipedia entry which tells me that vMessage is specified by IrDA and that the format is most likely in their IrMC standards set I've found nothing about the format. And as usual one gets the standard only for a fee, which is 100$ in this case, so not an option for me. |
Re: How to access SMS database in Sailfish?
Quote:
I'd stick with the CSV for now - no reason to make it complicated. Although if you ever get bored and want to implement vmsg import/export in libcommhistory.. :p |
Re: How to access SMS database in Sailfish?
What would be good (but quite more complex than just import/export) is to synchronize SMS with an email account.
There is an app for Android that does that on gmail and even if it is google-only, the principle is good. SMS could just be exported/imported to an IMAP folder. MMS could also with multimedia content as attachment. |
Re: How to access SMS database in Sailfish?
Quote:
Nowdays I would not worry about the ML overhead, trying to squeeze data into too little containers is pointless on the age of memory abundance we are living :D |
Re: How to access SMS database in Sailfish?
human-readable import/export of SMS on sailfish is mission critical before i can start using jolla as a primary phone.
likewise with call log and contacts {MMS would be nice too} i also dont care what format is used, as long as its human-readable, well-structured, and validatable. however, i personally would prefer a platform-independent solution, preferably one that just reads/writes the sqlite database so that it can be done on a faster box. as soon as i get a jolla {usa, so sad} this will be the first thing i investigate coding up. -a sqlite solution will be complicated. it will also be brittle, since the libcomm interfacing impl and the sql table structure could change -things aside from libcommhistory might be in the sqlite db, so this might involve risk in replacing the db. -if the jolla code that handles the sqlite db is open and modular, it might be adaptable for this purpose |
Re: How to access SMS database in Sailfish?
Quote:
Quote:
There is a basic JSON format in commhistory-tool for importing messages right now, primarily meant for predefined content. That may eventually be extended into a full import/export format, to replace the current fragile binary one. See https://github.com/nemomobile/libcom...tool.cpp#L1112 There's nothing to export readable call logs right now, but they are also managed by libcommhistory. I'm happy to see so much interest. Patches are always welcome.. ;) |
Re: How to access SMS database in Sailfish?
this is all REALLY good news, thanks.
full json import/export would be perfect {with my n9, i am currently entirely dependent on https://github.com/wwwjfy/MeegoSMSBackupRestore} out of curiousity, what sort of contacts metadata is non-exportable to vcard? {only things i can imagine are for tie-in with awful apps like skype or wazapp} |
Re: How to access SMS database in Sailfish?
I've hacked up the smsImporter today, I've tested it on nemo since I don't have a device, so no guarantee for it's functionality.
Running the binary with the exported csv as argument imports everything Binary: http://cdnm.at/~christian/Harmattan-SMS-Boat/smsImport Source: https://github.com/merlin1991/Harmat...port/smsIm.cpp edit: Thanks to a tip from jbrooks it works now perfectly, no more segfaults. The new binary is available at the link above. |
Re: How to access SMS database in Sailfish?
Quote:
How can I use these tools (smsExport, smsImport) on N9 and Jolla respectively? Simply get the binaries in each device and then execute from a terminal? Any simple examples? |
Re: How to access SMS database in Sailfish?
Quote:
smsExport just prints everything to stdout so do Code:
./smsExport > somefile.csv Code:
./smsImport somefile.csv |
Re: How to access SMS database in Sailfish?
Hello,
I'am interested too but to import SMS from symbian device, i have found a way to export the SMS in XML How can-i see the fields to import into libcommhistory ? |
Re: How to access SMS database in Sailfish?
Quote:
|
Re: How to access SMS database in Sailfish?
Quote:
/bin/chmod +x path-to/smsExport /bin is not in PATH as standard, may be your issue |
Re: How to access SMS database in Sailfish?
Quote:
Now, I've manage to run it (as user, via ssh), as mentioned, from "home", and it does: Code:
./smsExport |
Re: How to access SMS database in Sailfish?
Quote:
Code:
/dev/mmcblk0p1 on /home/user/MyDocs type vfat (rw,nosuid,nodev,noexec,noatime,nodiratime,uid=29999,fmask=0133,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,rodir,errors=remount-ro) Regarding your problem, never forget our dear friend aegis. You have to run the application as the developer user since he is the only user with enough aegis credentials to access your messages database. |
Re: How to access SMS database in Sailfish?
Otherwise works ok, but it scrambles צהו characters on import, maybe it should export/import in utf8 or something?
And on N9 side you needed to run it as developer and not as user. |
Re: How to access SMS database in Sailfish?
Worked perfect on my N9 and Jolla :) Thanks everyone involved!
|
Re: How to access SMS database in Sailfish?
Another day, another update:
As suggested by rainisto the application now saves to utf-8 files. It also can ex/import the call history now by using the -c flag. New binaries: http://cdnm.at/~christian/Harmattan-...at/jollaImport http://cdnm.at/~christian/Harmattan-SMS-Boat/n9Export Source still at github: https://github.com/merlin1991/Harmattan-SMS-Boat |
Re: How to access SMS database in Sailfish?
Quote:
Code:
/home/user # whoami |
Re: How to access SMS database in Sailfish?
@Nikos Alexandris
Run Code:
develsh |
Re: How to access SMS database in Sailfish?
Quote:
Code:
libqtcontacts-tracker: engine.cpp:1591: Not cleaning up obsolete resources for nao:hasTag property since the property's range is too generic (rdfs:Resource). |
Re: How to access SMS database in Sailfish?
Quote:
|
Re: How to access SMS database in Sailfish?
When i try to export my sms on n9 i get following error message:
Code:
~/MyDocs/SMSBackup $ develsh n9export -s 20132612 |
Re: How to access SMS database in Sailfish?
Quote:
you should first launch "develsh", then "./n9export" |
Re: How to access SMS database in Sailfish?
When i do it so, i get 'Permission denied'. I tried to change rights for this file with chmod, but i will not change it.
|
Re: How to access SMS database in Sailfish?
After today's Sailfish OS update I decided to switch to the Jolla as my primary phone. These utilities worked beautifully - thanks merlin1991!
|
Re: How to access SMS database in Sailfish?
1 Attachment(s)
I've hacked an old smsexporter program to work with newer rtcom-eventlogger DB format (used on recent versions of N900 FW) and output CSV format which can be imported in Jolla.
So, you can export SMS messages from your N900 by using: Code:
n900export <filename> Code:
$ ./n900export sms_backup.csv and then use generated file with Merlin's jollaImport to import SMS messages to your Jolla. Please note I'm not a C programmer and this is just a quitck&dirty hack. So please check the generated file whether the format looks okay and backup Jolla's history DB before importing. But it worked fine for me, I've transfered about 2000 of SMS messages without problem. |
Re: How to access SMS database in Sailfish?
when I use the command "n900export" on N900, it says "not found" although I copied the bin to /home/user/ as well as the .cvs files I got from Nokia communication centre, am I doing something wrong?
|
Re: How to access SMS database in Sailfish?
Quote:
Code:
/home/user/n900export <csv-file> Code:
echo $PATH |
Re: How to access SMS database in Sailfish?
Thanks, however, now I am getting a message "permission denied" even as su on Jolla, why is that?
|
Re: How to access SMS database in Sailfish?
@xkkkx
Look several posts above - use develsh command! EDIT: On Jolla? I missed that. Are you sure you have all the right permissions setup for the import script? Do Code:
chmod 777 <file> EDIT2: Change the permission on the script file itself. Looks like it is not executable. Run: Code:
ls -l /home/nemo/Documents/ |grep jollaImport Code:
chmod 777 jollaImport |
Re: How to access SMS database in Sailfish?
develsh command does not work on Jolla, I am getting the "permission denied" message on my Jolla, even after "devel-su" command... I am already done with the n900 part.
EDIT: I did like you suggested: chmod 777 smsbackup.csv and then ./jollaImport -s smsbackup.csv and the same message came: Code:
bash: /home/nemo/Documents/jollaImport: Permission denied |
Re: How to access SMS database in Sailfish?
Firstly, thankyou for the exporter! I was using smsbackup and it suffered from the libcommhistory bug - really annoying.
Secondly, I am wondering is it possible to export the messages to match the timezone set for the phone, not GMT? I see how to do it now, using Qt::SystemLocaleLongDate but I do not have the scratchbox installed. :-) EDIT: Scratchox installed and locatime used for exported sms's. |
Re: How to access SMS database in Sailfish?
Great stuff! Successfully transferred 1500+ SMS form N9 to Jolla :-)
|
All times are GMT. The time now is 18:23. |
vBulletin® Version 3.8.8