|
|
# How to backup chatlogs
|
|
|
[[_TOC_]]
|
|
|
|
|
|
In Gajim, your history (chat logs) is stored in a database, called `logs.db`. This page explains how to backup that database.
|
|
|
To backup or move a Gajim installation, copy/backup any of the folders where Gajim stores its data.
|
|
|
|
|
|
For more info, read about the [design of the database](/development/LogsDatabase).
|
|
|
### Linux
|
|
|
|
|
|
*This can be used to restore a malformed database.*
|
|
|
On linux Gajim saves data in multiple places
|
|
|
|
|
|
### For Linux
|
|
|
| Type | Path |
|
|
|
| ------ | ------ |
|
|
|
| Settings | `~/.config/gajim/` |
|
|
|
| Logs and other Data | `~/.local/share/gajim/` |
|
|
|
| Cache | `~/.cache/gajim/` |
|
|
|
|
|
|
You need the `sqlite3` package to do that.
|
|
|
### Windows
|
|
|
|
|
|
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 |
|
|
On Windows all data is stored in `%APPDATA%/roaming/gajim` |