How to back up logs

Logs in gajim are stored in a database, called logs.db. This page explains how to backup this database.

For more, read about the design of the database

This can be used to restore a malformed database.

For Linux

you need sqlite3 package to do that.

In a terminal, type that to backup your database:

sqlite3 ~/.gajim/logs.db .dump > backup.sql

To restore it, just remove (or move) your old database:

mv ~/.gajim/logs.db ~/.gajim/logs.db.old

then type:

sqlite3 ~/.gajim/logs.db < backup.sql

For Windows

You need sqlite3 command line tool (precompiled binaries) to do that. In a command-line windows, type:

sqlite3.exe %appdata%\Gajim\logs.db
sqlite> .output C:\backup.sql
sqlite> .dump
sqlite> .quit

This will store the create and insert sql commands 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:

sqlite3.exe %appdata%\Gajim\logs.db
sqlite> .read C:\backup.sql
sqlite> .quit