How to upgrade Skype for Linux from version 4.2 to 4.3 without losing any of your old chat log / history

Skype for Linux, when updated to 4.3, from 4.2, brings up a big problem to many of the users who heavily rely on their Skype chat histories for a reason.
And since Canonical (the makers of Ubuntu) has included the update in its repositories, this problem is kind of unavoidable if you want to keep you up-to-date.
And with the now-Microsoft-owned Skype developers threatening that they would soon make the old Skype useless, you are in very much need of this fix to your existing Skype data files.

The Fix (tested on English version of Skype):

All your Skype data is usually stored under a folder named ".Skype" in your home directory - ie., in /home/USERNAME/.Skype (unless you had previously specified something else for the name, like when you use the option "--db-path=path-to-skype-data-folder").

The first step we have to take is - take a complete backup of the Skype. Takes a compressed backup of your Skype data folder, with

tar -zcvf Skype-data-backup_pre-update-to-4-3.tar.gz ~/.Skype

Then, you need to make sure you have SQLite3 installed.
To check that, use the command:

which sqlite3

This should output something as follows:

/usr/bin/sqlite3

Else, install SQLite3, using

sudo apt-get install sqlite3

Now update Skype to version 4.3 by running your Update Manager (or MintUpdate, on LinuxMint), and DO NOT start it up yet.

Next, do the following to make the necessary fixes to your DB:

sqlite3 ~/.Skype/[username]/main.db

And in the SQLITE prompt that shows up, execute these following commands:


UPDATE Messages SET body_xml=substr(body_xml,instr(body_xml,'<files')) WHERE type=68 AND body_xml LIKE 'posted%';
UPDATE Messages SET body_xml=substr(body_xml,instr(body_xml,'<files')) WHERE type=68 AND body_xml LIKE 'sent file%';
.quit

That should do the trick! Now fire up Skype and make sure you have all your chat history loading fine.

Let me know using the Comments box below if you face any difficulty with these.

Cheers,
Anto

References:

Add new comment

randomness