Dies ist eine alte Version des Dokuments!
Intro
After Upgrading my mobile from SailfishOS 3.3.??? to 4.1.??? it figured out, that I've missed a backup with the OS tools. I've had only a backup of the filesystem. Restoring most of the relevant information was simple. So it was no problem to get my Phonecalls, Messages and also Notes back. Only two things didn't work. Contacts and Calendar. Allthough I can ignore my Calendar for the moment, also my contacts went away due to the fact, that there was a DB Schema change.
Luckily it was possible to start an emulator with OS 3.2.??? and restore the contacts within that emulator *but*, all tryes to restore the data with Backuptools on that emulator or CalDav syncing or vcardconverter on OS level failed. For whatever reason it was not possible to restore that data.
Solution
My Solution here is to restore the data with a python script, exporting it from the Sqlite database to .vcf (vCard File).
This only works for DB Structures of SailfishOS and was especially tested with DBs of OS version 3.2.X and 3.3.X
Version 0.2 is the latest one.
Implementation
function | implemented |
---|---|
Full Name | ![]() |
First Name | ![]() |
Last Name | ![]() |
voice number | ![]() |
fax number | ![]() |
sms number | ![]() |
e-mail addresses | ![]() |
Organization name | ![]() |
Organization parameters | ![]() |
picture / foto | ![]() |
address | ![]() |
birthday | ![]() |
URL | ![]() |
Database
Schema
table descriptions
Addresses
subTypes
The database is missing a table with subTypes to identify entries in Addresses. To have a reference, here is a list of Types
subType | vCard/vobject parameter | SailfishOS Contact label |
---|---|---|
Null | personal | Personal Address |
0 | parcel | |
1 | cell | Cell Phone |
2 | fax | Fax |
3 | pager | Pager |
6 | video | Video |
10 | ?? | Assistent |
PhoneNumbers
The Phonenumbers are listed in table PhoneNumbers with details from table Details. Most interesting here is the type of number. Which is stored in table PhoneNumbers column subTypes.
Here is an example:
detailId | contactId | phoneNumber | subTypes | normalizedNumber | detailId | contactId | detail | detailUri | linkedDetailUris | contexts | accessConstraints | provenance | modifiable | nonexportable |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | 3 | 01719994445 | 1 | 19994445 | 10 | 3 | PhoneNumber | NULL | NULL | Home | 0 | NULL | NULL | NULL |
11 | 3 | 040111222334 | NULL | 11222334 | 11 | 3 | PhoneNumber | NULL | NULL | Home | 0 | NULL | NULL | NULL |
12 | 3 | 01720004443 | 1 | 20004443 | 12 | 3 | PhoneNumber | NULL | NULL | Work | 0 | NULL | NULL | NULL |
13 | 3 | 040111222333 | NULL | 11222333 | 13 | 3 | PhoneNumber | NULL | NULL | Work | 0 | NULL | NULL | NULL |
14 | 3 | 040111222335 | 2 | 11222335 | 14 | 3 | PhoneNumber | NULL | NULL | Work | 0 | NULL | NULL | NULL |
subTypes
The database is missing a table with subTypes to identify entries in PhoneNumbers for example. To have a reference, here is a list of Types
subType | vCard/vobject parameter | SailfishOS Contact label |
---|---|---|
Null | voice | Voice Phone |
1 | cell | Cell Phone |
2 | fax | Fax |
3 | pager | Pager |
6 | video | Video |
10 | ?? | Assistent |
Definition from RFC:
+-----------+-------------------------------------------------------+ | Value | Description | +-----------+-------------------------------------------------------+ | text | Indicates that the telephone number supports text | | | messages (SMS). | | voice | Indicates a voice telephone number. | | fax | Indicates a facsimile telephone number. | | cell | Indicates a cellular or mobile telephone number. | | video | Indicates a video conferencing telephone number. | | pager | Indicates a paging device telephone number. | | textphone | Indicates a telecommunication device for people with | | | hearing or speech difficulties. | +-----------+-------------------------------------------------------+
The default type is "voice".
VCARD
Allthough it wasn't specified by python vobject lets assume we've to use VCard specification by RFC6350.
external Links
- FileFormatdescription: https://docs.fileformat.com/email/vcf/#vcf-30-example
- Python vobject: http://eventable.github.io/vobject/
ToDo
- fotos
- birthday
- missing parameters for names
- URL with parameters
source
The sourcecode is located under svn://svn.siningsoft.de/Sailfish_Contacts_Restore. A free read access via svn will follow. If you're interested in submitting code as part of the development, a read/write access could be requested via sailfish@siningsoft.de
you see this when javscript or css is not working correct