In Gajim, your history (chat logs) is stored in a database, called logs.db. This page explains how to backup that database.
For more info, read about the design of the database.
This can be used to restore a malformed database.
You need the sqlite3 package to do that.
In a terminal, type the following to backup your database:
sqlite3 ~/.local/share/gajim/logs.db .dump > backup.sql
To restore it, just remove (or move) your old database:
mv ~/.local/share/gajim/logs.db ~/.local/share/gajim/logs.db.old
sqlite3 ~/.local/share/gajim/logs.db < backup.sql
You need the sqlite3 command line tool.
In a command-line window, type:
sqlite> .output C:\backup.sql
This will store database (the create and insert sql commands, to be exact) in C:\backup.sql .
To restore the database, remove logs.db (or rename it to logs.db.old) from %appdata%\Gajim\logs.db (most probably C:\application data\YOUR_ACCOUNT\Gajim\logs.db):
rename %appdata%\Gajim\logs.db %appdata%\Gajim\logs.db.old
then type in a command-line window:
sqlite> .read C:\backup.sql
Imagine your computer just crashed and Gajim is silent about all those previously unread messages.
You can view the most recent 100 messages with this query:
select logs.kind,jids.jid,logs.message from logs,jids where jids.jid_id=logs.jid_id and (logs.kind = 3 or logs.kind = 4) order by time desc limit 100;