Chatty¶
Database Location¶
The SMS content and associated metadata is stored in a database at /home/purism/.purple/chatty/db/chatty-history.db.
Export Chatty messages (SMS, Matrix)¶
You can export the messages from Chatty with a few commands.
Note
SQL is a very powerful language to search for data in databases, and the possibilities are so numerous, we cannot cover every single possible use-case out there. The steps we provide should provide you a good starting place to explore on your own.
Install
sqlite3from the Terminal application.sudo apt install sqlite3
Open the Terminal and create a Sqlite connection to the database.
sqlite /home/purism/.purple/chatty/db/chatty-history.db
Find the
thread_idvalues for the messages that are desired. Write down the IDs for later.
SELECT m.thread_id, m.time, m.body FROM messages AS m;
Switch the output mode to a parsable format, add the column headers, and declare the output file name. For this guide, the CSV format will be used, however, please refer to the Sqlite command line shell reference for the other available formats.
.mode csv .headers on
Note
.modesets the output format..headerson will add the column names to the top of the output.
By default, the column output will be separated by commas. If you want to change the separator, enter the
.separatormode and provide the separator value. The example below sets it to the caret character (^) but you can set it to almost anything..separator ^
Run a test
SELECTquery to check that the output is what you want.Important
Replace the part that say
:thread_idwith the thread ID value obtained earlier.SELECT m.time, m.body FROM messages AS m WHERE m.thread_id = :thread_id ORDER BY m.time ASC;
If you have multiple thread IDs, use
INinstead of=like so:SELECT m.time, m.body FROM messages AS m WHERE m.thread_id IN (:thread_id1, :thread_id2) ORDER BY m.time ASC;
If the output looks good, enable file output and set the file name.
.out my_messages.csv
Note
In this guide, the file is placed in the current directory from where the
sqlite3command was invoked.Run the same SQL query as before to export the data this time. Because of the
.outcommand used earlier, the output of the query will be written to the specified file, though the query result will not be printed to the screen so make sure the query is correct.