sailfishos:projects:sailfish_contacts_rescue

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.? and 3.3.?

functionimplemented
Full Name
First Name
Last Name
voice number
fax number
sms number
e-mail addresses
Organization name
Organization parameters
picture / foto

Database

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:

detailIdcontactIdphoneNumbersubTypesnormalizedNumberdetailIdcontactIddetaildetailUrilinkedDetailUriscontextsaccessConstraintsprovenancemodifiablenonexportable
10301719994445119994445103PhoneNumberNULLNULLHome0NULLNULLNULL
113040111222334NULL11222334113PhoneNumberNULLNULLHome0NULLNULLNULL
12301720004443120004443123PhoneNumberNULLNULLWork0NULLNULLNULL
133040111222333NULL11222333133PhoneNumberNULLNULLWork0NULLNULLNULL
143040111222335211222335143PhoneNumberNULLNULLWork0NULLNULLNULL

The database is missing a table with subTypes to identify entries in PhoneNumbers for example. To have a databases, here is a list of Types

subTypevCard/vobject parameterSailfishOS Contact label
NullvoiceVoice Phone
1cellCell Phone
2faxFax
3pagerPager
6videoVideo
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

ToDo

  1. ORG-PARAM parameters associated with organisation like role, etc. pp.
  2. pictures

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

× iphelper toolbox

you see this when javscript or css is not working correct

Untested
IP Address:
First usable:
Subnet:
Last usable:
CIDR:
Amount of usable:
Network address:
Reverse address:
Broadcast address:

  • sailfishos/projects/sailfish_contacts_rescue.1628113845.txt.gz
  • Zuletzt geändert: 2021/08/04 21:50
  • von admin