How do I export the history of Skype?

31

10

Is it possible to export Skype v4 chat history into some readable plain-text format?
(.txt, .xml, .html)

Alternatively, is it possible to backup/restore skype chat history?
(I wouldn't mind backup to Gmail, or to readable plain-text format).

I have found numerous tools on the internet and even tried some of them, but they don't seem to work.

Peter Štibraný

Posted 2009-11-07T13:20:10.200

Reputation: 1 281

Nowadays it's possible to backup/restore the chats simply copying the file main.db, and it is possible to export the chat with a python program or directly with a program able to read a database sqlite3, doing a query or selecting through the option of a graphical interface. I wrote more detail in the answer below. – Hastur – 2015-12-11T17:10:57.150

Answers

11

See the script presented here: Save Skype chat history.

Here is the code:

' Define global variables
Dim oFSO, chat_file, folder_to_save
' Directory where You want to save history (you can modify it)
' Now it is relative, so it will be created where Your *.vbs script runs
folder_to_save = "SkypeChatHistory"
line_count = 0

' Create FSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
set_next_free_dir()

' Connect to Skype API via COM
Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_")
' Open skype, if it is not running
If Not oSkype.Client.IsRunning Then
oSkype.Client.Start()
End If

WScript.Echo "Skype history will be saved. Found " & oSkype.Chats.Count & " chat group."

' Iterate chats
For Each oChat In oSkype.Chats
names = ""
' First name is You, so it is unnecessary to keep
no_1st_flag = TRUE
For Each oUser In oChat.Members
If no_1st_flag Then
no_1st_flag = FALSE
Else
   names = names & "_" & oUser.FullName
End If
Next
get_file("chat" & names & ".txt")
chat_file.WriteLine(vbNewLine & "==== CHAT HISTORY (" & Replace(names, "_", "") & ") ====" & vbNewLine)
line_count = line_count + oChat.Messages.Count
' Fix by an anonymous commenter
If oChat.Messages.Count > 0 Then
For Each oMsg In oChat.Messages
' Fix by Vadim Kravchenko
On Error Resume Next
chat_file.WriteLine(oMsg.FromDisplayName & " (" & oMsg.Timestamp & "): " & oMsg.Body)
Next
End If
chat_file.Close
Next

WScript.Echo "Backup was finished (" & line_count & " line saved). You can find your chats in: ./" & folder_to_save

' Garbage collection
SET chat_file = NOTHING
SET folder_to_save = NOTHING
SET oFSO = NOTHING
SET oSkype = NOTHING

' Access to a file given by name
Sub get_file(file_name)
' Parameter fix by: rommeech
Set chat_file = oFSO.OpenTextFile(folder_to_save & "/" & file_name, 8, True, -1)
End Sub

' Find an appropriate directory the logs to save, however, to avoid collision with former dirs
Sub set_next_free_dir()
If oFSO.FolderExists(folder_to_save) Then
ext = 1
While oFSO.FolderExists(folder_to_save & "_" & ext) And ext < 100
  ext = ext + 1
Wend
folder_to_save = folder_to_save & "_" & ext
End If
oFSO.CreateFolder(folder_to_save)
End Sub

Just save it as .vbs file and run it. Then at the first time, Skype will ask you about permission to connect the Skype API, so just click OK. After that it will create a folder called SkypeChatHistory and some files in it which should have your chat history.

harrymc

Posted 2009-11-07T13:20:10.200

Reputation: 306 093

1

I remember I had used it once and it worked at that time. Now it gives me this error http://i53.tinypic.com/zmd3lf.png

– IsmailS – 2011-08-02T11:07:52.530

1

The download moved to here: https://developer.skype.com/accessories

– sjbotha – 2011-09-22T20:55:21.757

After registering it still wouldn't work on my 64-bit Win7 system. The solution is to run the 32-bit version of wscript like this, but do it from a command prompt window or you won't know where the folder is created: C:\WINDOWS\SYSWOW64\wscript exportskypehistory.vbs – sjbotha – 2011-09-22T21:12:37.307

this blog mentions a still (@2013) working alternative application. (The pointed program points to another updater website, this): http://eigenein.info/skype-historian/downloads.html

– n611x007 – 2013-01-21T13:57:33.103

1Thanks. Unfortunately it doesn't work for me :-( It shows "Could not locate automation class names 'Skype4COM.skype'" error. I'll try to find out how to get it working. – Peter Štibraný – 2009-11-09T08:37:45.243

1

I've got it working ... I needed to install Skype4COM from https://developer.skype.com/Download (by using regsvr32.exe Skype4COM.dll from cmdline), and then run the script again.

– Peter Štibraný – 2009-11-09T08:47:45.410

It turns out that using Skype API for getting chat history is pretty easy. Thanks for pointing me in correct direction. – Peter Štibraný – 2009-11-09T11:34:38.773

10

There is Skype Historian, it can export to plain text, json, csv and xml; also able to group data.

As of 2013, it worked for me out of the box (my skype is 6.0.0.126). However it's successor seems to be the open-source skyninja, which I haven't tried yet.

System Requirements: Windows 7 / Windows XP with .NET Framework 3.5

export options

Found the link to this project on the blog in harrymc's answer.

n611x007

Posted 2009-11-07T13:20:10.200

Reputation: 5 291

@lkraav there seems to be a 20150318 v0.1 release of skyninja. it requires dotnet 4.5 – n611x007 – 2015-07-09T13:47:25.357

There doesn't seem to be any builds of skype-ninja available. – lkraav – 2013-07-20T20:35:46.453

3

Quick answers

  1. Is it possible to export Skype v4 chat history (.txt, .xml, .html)?
    Yes, it is with programs like Skyperious [1], written in phyton and open source, or more directly with each program that allows to read the sqlite3 database format [3] (see below for details).

  2. Alternatively, is it possible to backup/restore skype chat history?
    Yes,it is [2]. The chat history is saved in one database file, the main.db file.
    You can backup and restore the main.db file. when you need/want.


Some words more about to export in a human usable format:

  • It is not the case to reinvent the weel :-) There are many program developed for this.
    I would like to suggest Skyperious [1], written in python, downloadable as source code and in binary version for Windows so that it can work under each Operating System.
    It is able to export in html, txt or csv.
    This command line for Linux will create an html file for each other chat partner in a subdirectory:

        ./skyperious.sh export ~/.Skype/SKYPE_USERNAME/main.db -t html
    

    For Windows there is the analogous batch file skyperious.bat. Html with a nice format.

  • To be honest you don't need a 3rd part program: but you can do some gym with a database.
    The chat is inside the file main.db [2]. that is an sqlite3 database [3],[4].
    With sqlite3 or with any other graphic or not graphic tool you can do a query such as

        sqlite3 main.db "SELECT author,timestamp, body_xml 
                FROM messages WHERE dialog_partner = '<OTHER_SKYPENAME>'" > My_file.txt
    

    (in only one line and with the skype username of the second persons instead of <OTHER_SKYPENAME>)

    Note that it is possible to SELECT each column of the database you are interested in.
    With a GUI such as sqliteman [3b], it can me more simple, you can select the column in a graphical way, then put a filter on the value of a field ... and it will compose again a line as

    SELECT author, timestamp, body_xml FROM "main"."messages" WHERE dialog_partner = 'SKYPE NAME of 2nd USER';
    

    enter image description here


Some words more about backup/restore

It is possible to backup/restore the chat file directly [2].

All chat history is saved in one database file, the main.db file.
If you make regular copies of this file, then it will always be possible to restore the chat history.
Make sure that Skype is not running on the computer.

You have only to find where it is stored on your computer:

  • In Windows it is reported [2b] to be in %appdata%\Skype\YourSkypeName, where usually %appdata%\Skype is translates to: C:\Users\YourUserName\AppData\Roaming\Skype
  • In Linux instead is under /home/LinuxUsername/.Skype/SkypeUserName/
    or shortly ~/.Skype/SkypeUserName/.
  • On Mac should be under ~/Library/Application\ Support/Skype/<YOUR SKYPENAME>/

Hastur

Posted 2009-11-07T13:20:10.200

Reputation: 15 043

1

I agree, https://github.com/suurjaak/Skyperious is the best tool available. It even can create statistics of your chats, e.g. messages per user, emoticons per user, most used words in a chat etc. .

– asmaier – 2016-01-11T15:10:59.290

3

If you want the easiest way to export your history into a readable format, that would be skypebrowser.com, which can read your main.db file.

But since it's a third-party service, you obviously should think twice before using it if you have any confidential data in your chats. In this case your only safe choice is a SQLite browser (you'll need the messages table).

geppertuo

Posted 2009-11-07T13:20:10.200

Reputation: 49

3

that's the reason why i'm still using Skype 3.

what were they thinking when they removed the /htmlhistory command???

with Skype 4 i'm afraid the only options are commecial programs such as Pamela for Skype (chat recording is not available in the free version).

as for backup and restore the chat history, that's fairly easy:

Locate the folder Application Data\Skype\ (your username) and copy it to another location such as a CD or DVD-ROM.

To restore the history files just copy the files back to that folder.

Molly7244

Posted 2009-11-07T13:20:10.200

Reputation:

1

Yo can use this to export chat history data:

http://www.gammatwo.com/2010/12/18/save-skype-chat-history/

Maryann

Posted 2009-11-07T13:20:10.200

Reputation: 11

1

You just have to go to your user main folder as in win7: C:\Users[your_user]\AppData\Roaming\Skype

Remember that the "AppData" folder is hidden, so you might have to select the option to show hidden folders.

Then find the folder with the user name of your skype account and copy it to the new pc... all your chats and contacts icons and etc will be copied to the new computer.

Iconfx

Posted 2009-11-07T13:20:10.200

Reputation: 11

1

Just open a new chat window with the contact for whom you want to save the chat history. Type "/history" (without the quotation marks) in the chat window. Once the history is populated, select/highlight a portion of the text with your mouse cursor. Then, (on Windows) press "Ctrl+A" on your keyboard. Once everything is highlighted, press "Ctrl+C." Open Microsoft Word (or a similar word processing software, like OpenOffice.org Writer) and press "Ctrl+V" on your keyboard. Save the file on your harddisk or USB drive, and voila: You have a complete record of your chat history.

Wesley

Posted 2009-11-07T13:20:10.200

Reputation: 11

1

The Skype plugin G-Recorder works great for me to backup chats.

Greg

Posted 2009-11-07T13:20:10.200

Reputation:

@Peter: I'm a co-author of G-Recorder, have you reported you problem by "Report a problem" menu item? At least just to check how our support team works :) – Andriy Tylychko – 2011-09-06T15:55:08.750

I found that, but it didn't work for me :-( – Peter Štibraný – 2010-01-02T18:54:34.737

0

This tool can export your Skype history to HTML:

You can find executables for Win and Mac here:

asmaier

Posted 2009-11-07T13:20:10.200

Reputation: 161

0

Software which allows to record calls and store recorded calls/chat history/file transfers to your email - http://skype2email.com

Skype2email is a commercial program with a 14 days free trial.
Disclaimer: I worked on this program.

Mehal

Posted 2009-11-07T13:20:10.200

Reputation: 111

Hi Mehal. I tried your program, but it crashes when I start it. If you tell me where to look or what to send you, I'll give it more try. – Peter Štibraný – 2010-05-29T15:55:10.237

0

I think there is a more elegant way to save your chats and calls then send it to email. For example using Skype Recorder lets you save all of it to online storage as well as add such functions like full-text search, play your calls online, and many others nice features. I think it will really help you with your problem.

Zhenya

Posted 2009-11-07T13:20:10.200

Reputation: 1

0

The easiest thing to do if you just want to transfer the history to another computer is to follow the advice by Skype here: https://support.skype.com/en/faq/FA10649/Can-I-transfer-my-chat-history-from-one-computer-to-another?frompage=search&q=chat+history&fromSearchFirstPage=false . What you do is mark your conversations as Unread, and they get transfered to another computer when you sign in to it the next time.

RyanTM

Posted 2009-11-07T13:20:10.200

Reputation: 910

0

There is an option to export Skype history in CSV etc from your Account page on Skype.com.

Daniel

Posted 2009-11-07T13:20:10.200

Reputation: 130

7Could you please write where exactly I can find it? I looked over entire Skype account, but didn't find it anywhere :-( – Peter Štibraný – 2009-11-09T08:34:53.020

1Not to mention how scary that is – lkraav – 2013-07-20T20:29:45.553