This article explains how to copy the text and multimedia messages from the SQLite database in Sailfish OS to CSV files. Note: the attachments of MMS messages must be handled separately - they will not be included in CSV.
- Enable Developer Mode
- Open Terminal app on your computer and create an SSH connection to your Sailfish device
- Give the following commands to access the SQL database:
cd /home/nemo/.local/share/commhistory sqlite3 commhistory.db sqlite> .headers on sqlite> .mode csv sqlite> .output SMS.csv sqlite> select * from events where type = 2; sqlite> .output MMS.csv sqlite> select * from events where type = 6; sqlite> .quit mv *.csv /home/nemo
- Exit SSH and disconnect USB
- Connect your device to PC again, now using the MTP mode
- Move files SMS.csv and MMS.csv from your device to PC
- Open CSV files with Excel or Libre Office. Do "Text to Columns" operation for column A using comma as the delimiter.
Column A contains now the message contents sent by you and column P has the contents received by you.
It is not handy to read the messages in Excel. It is better to copy/paste them to Word, for instance.