maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Community (https://talk.maemo.org/forumdisplay.php?f=16)
-   -   How to import/export conversations in rtcom-eventlogger/SQLite on N900? (https://talk.maemo.org/showthread.php?t=64201)

Andre Klapper 2010-10-22 16:11

How to import/export conversations in rtcom-eventlogger/SQLite on N900?
 
I know that on the N900 conversations are stored in ~/.rtcom-eventlogger/el.db but I'm wondering how to export and import via the SQLite shell.
(Asking because a friend of mine accidentially deleted her Conversations thread with me and would like to have it back.)

Anybody having an idea?

daperl 2010-10-22 18:58

Re: How to import/export conversations in rtcom-eventlogger/SQLite on N900?
 
After the initial Events table dump, there are a few problems that can be solved by an awk script. First off, you'll have to generate unique integers that won't conflict with her primary key 'id' field. Secondly, all the 'local' and 'remote' values need to be swapped.

On your n900:

sqlite3 ~/.rtcom-eventlogger/el-v1.db
.mode insert
.output ~/.rtcom-eventlogger/friend.txt
select * from Events where remote_uid == '<friend remote_uid>';
<ctrl-d>
sed -i 's/ table / "Events" /' ~/.rtcom-eventlogger/friend.txt

Apply awk script to friend.txt

On her n900:

sqlite3 ~/.rtcom-eventlogger/el-v1.db
.read friend.txt
<ctrl-d>
killall rtcom-messaging-ui


EDIT: see above in red

daperl 2010-10-22 19:25

Re: How to import/export conversations in rtcom-eventlogger/SQLite on N900?
 
Oops, for some reason the insert mode didn't properly dump the table name. See above for the edit.


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

vBulletin® Version 3.8.8