After upgrading from SFOS 3.2 to 4.1 I missed to backup my contacts so I had to find a way to restore them from the SQLite DB to use them again.
Problematic is, that the schema had changed. So I diceded to create a script converting DB entries to vCards.
Now a working Version including Avatars (vCard Pictures included in vCards).
Documentation and Project wiki could be found here-, Sailfish Contacts Restore Wiki.
Script could by found here: Download Python Script in latest version
$ ./ContactRestore.py --help usage: ContactRestore.py [-h] --db DB --output OUTPUT [--avatars AVATARS] [--debug] [--version] Restore SailfishOS 3 Contacts optional arguments: -h, --help show this help message and exit --db DB, -d DB Sqlite3 Database file usually /home/{nemo,defaultuser}/.local/share/system/Contacts/qtcontacts- sqlite/contacts.db --output OUTPUT, -o OUTPUT Output directory for vcf files --avatars AVATARS, -a AVATARS Avatar directory. If present otherwise we skip this block of avatars, means, no avatars at all --debug debugging output to identify problems --version show program's version number and exit This script was written to restore SailfishOS 3 contacts as VCF files. To see additional information, visit: https://wiki.siningsoft.de/doku.php?id=sailfishos:projects:sailfish_contacts_rescue
$ ./ContactRestore.py -d Testdata/contacts_with-Phone-Mobile-Fax-Pager-Assistent-Addresses.db -o Testdata/Output/ exporting SiSo Emulator to file Testdata/Output//SiSo_Emulator.vcf exporting TestUserFirstName TestUserLastName to file Testdata/Output//TestUserFirstName_TestUserLastName.vcf exporting 2nd Test *FN* User *LN* to file Testdata/Output//2nd_Test_*FN*_User_*LN*.vcf exporting Phone Test to file Testdata/Output//Phone_Test.vcf exporting Ludowig Adressuser to file Testdata/Output//Ludowig_Adressuser.vcf
Comments
avidscavenger
Wed, 2024/05/15 - 05:05
Permalink
The script doesn't seem to be available.
devnull
Thu, 2023/04/13 - 19:55
Permalink
source is accessable again. Sorry for the slow connection. This will.change in future, once the connection was upgraded.
aviarus
Thu, 2023/04/13 - 18:16
Permalink
unfortunately is the script not accessible at the moment
DLQ
Mon, 2022/03/07 - 20:11
Permalink
There is another PhoneType: 4
I don't know what it stands for, but after defaulting it to 'voice' the script worked well for me. Thanks!
Firefox84
Tue, 2021/08/10 - 22:14
Permalink
The problem isn't the Android-side of the procedure, the export was done using backup & Restore, the format: xml version='1.0' encoding='UTF-8' standalone='yes'
xml-stylesheet type="text/xsl" href="sms.xsl. But if you try to open the message dump of SFOS, the only tool that works for me is libre office, but the output is not really usable. You see the messages, but the arrangement of the data is not helpful, its seams like a big chaos. I don't want to create a huge project for you, i just thought you might be interested in finding a solution for it :) Thanks anyway!
devnull
Wed, 2021/08/11 - 09:48
Permalink
Hi, yes I'm Always interested
. At least creating sample data to analyze to have something to start. Please contact me at sailfish@siningsoft.de
Firefox84
Tue, 2021/08/10 - 18:23
Permalink
Hi @devnull, there is the possibilty to import vcd files coming from Android, the transfer of the text messages is only possible from SFOS to SFOS. In Android i am able to export an xml file with all my text messages, but in SFOS i am neither able to edit the messages DB, nor to convert my xml file to a DB file. There was one guy who wrote a script, but it seems way to complicated for the average SFOS user like me :) https://github.com/javaes/sailfish-msg-importer
I just thought maybe someone is interested i writing such an app, that would facilitate the switch for Android users to SFOS. Thanks anyway for your reply :)
devnull
Tue, 2021/08/10 - 19:22
Permalink
When you export in Android, which tool have you used for that ? Allthough I think it would be possible to do that, I'm not sure when I find time for that. Anyway, one needs at least some example data with all cases in it (message threads, single messages, send and received messsges) and then one would need a way to understand the schema in that XML file. Maybe you could prepare something like that ?
devnull
Tue, 2021/08/10 - 01:28
Permalink
Hi Firefox84, could be interesting, but is a complete different source of problem. I can imagine a android and SFOS application to use for migration. On both sides its kind of API to read and write contacts, messages, all that stuff. But isn't there already a integrated migration wizard in SFOS?
Firefox84
Mon, 2021/08/09 - 23:38
Permalink
Wow nice, if we are at the topic rescuing. How about a tool to be able to transfer Android sms to Sailfish os, there is a script but its way to complicated. What would be nice would be a kind of Backup & restore vrrsion for SFOS. I am just mentioning this, because of tge DB for the messages, so maybe this would also be trivial for you :) Thanks for your work!