|
|
# How to backup chatlogs
|
|
|
|
|
|
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](/development/LogsDatabase).
|
|
|
|
|
|
*This can be used to restore a malformed database.*
|
|
|
|
|
|
### For Linux
|
|
|
|
|
|
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
|
|
|
|
|
|
then type:
|
|
|
|
|
|
sqlite3 ~/.local/share/gajim/logs.db < backup.sql
|
|
|
|
|
|
### For Windows
|
|
|
|
|
|
You need the [sqlite3 command line tool](http://sqlite.org/download.html).
|
|
|
In a command-line window, type:
|
|
|
|
|
|
sqlite3.exe %appdata%\Gajim\logs.db
|
|
|
sqlite> .output C:\backup.sql
|
|
|
sqlite> .dump
|
|
|
sqlite> .quit
|
|
|
|
|
|
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:
|
|
|
|
|
|
sqlite3.exe %appdata%\Gajim\logs.db
|
|
|
sqlite> .read C:\backup.sql
|
|
|
sqlite> .quit |