8

I'm using Ubuntu 12.04 LTS and Skype 4.3 on my machine. I've taken a file named main.db from the location on my machine ~/.Skype/SKYPEUSERNAME/

Now I want to see the chat history from that file with each of the contact. For it I installed Sqliteman but I'm still not able to see the chatr history. Can someone please provide me the easiest though effective solution for this issue? Thanks in advance.

1

1 Answer 1

6

Messages are stored as XML in messages table. You may use a simple SQL command to extract need dialog:

sqlite3 .Skype/yourusername/main.db "select timestamp,body_xml from messages where dialog_partner=\"partnerusername\";"

As you may use Sqliteman to run same command:

select timestamp,body_xml from messages where dialog_partner="partnerusername";
5
  • 4
    instead of timestamp use datetime(timestamp, 'unixepoch') as date, otherwise +1 as it fixes the bug in the skype client which shows empty history for all contacts
    – Gabor
    Apr 9, 2015 at 12:41
  • 2
    Also I'd include the author field to get a log with proper sender per message
    – Treviño
    Dec 4, 2015 at 16:58
  • What about chat groups? How can you correctly indentify them?
    – tigerjack
    Dec 7, 2015 at 11:01
  • 1
    At least on my main.db, the table is Messages (with a capital), not messages (all lower case). I use: sqlite3 -csv main.db "select datetime(timestamp,'unixepoch'),dialog_partner,body_xml from Messages where dialog_partner != \"\";" > Skype_messages.csv
    – qwa
    Mar 26, 2017 at 20:48
  • 1
    Putting many of the above comments together with my own ideas, I'd use sqlite3 main.db "select datetime(timestamp, 'unixepoch') as date,author,body_xml from messages where dialog_partner=\"partnerusername\";" > out.txt. This saves the output in a useful txt file that shows the author's names and gives the date/time in a human-readable format.
    – J. Mini
    Jul 18, 2021 at 15:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.