Copy contacts.db from old device to new device results in empty people app

isn’t it possible to copy the contacts.db from an old device to a new one or in another location as a backup? i copied contacts.db and the other two files in that folder to my computer and when in overwrote the database on a flashed saifish device the peoples app doesn’t load the contacts. unfortunately i don’t have access to the old device. has anyone got an idea how to get out the contacts from contacts.db?

There are some entries related to sim cards which will probably need to be corrected (CollectionsMetaData - ModemIdentifier), then there are entries about avatars from ~/.local… You could try to import the data into a fresh contacts.db that has the right modemidentifiers, maybe it would work

thanks for your suggestion. unfortunately it didn’t work. what’s strange, it somehow seems that the database is empty when i open it with sqlite or conversion to csv on a conversion website shows no entries in the db. could it be that it is encrypted since jolla introduced encryption?

  1. What was the SFOS version of the old device? 3.4 or a 4.
  2. Did the files go to: .local/share/system/privileged/Contacts/qtcontacts-sqlite
  3. Did you set the permissions to owner defaultuser and group privileged ?

As throwaway said there may be differences in meta data, but the schema of the db may also have changed.

You could, with the files in those directories try:

devel-su -p vcardconverter --export contacts.vcf

thanks for your reply. it went from sfos 4 to sfos 4. privileged doesn’t exist in system it’s directly Contacts and i didn’t set the permissions, i will try that.

maybe i just copied as regular user and it didn’t copy the privileged folder…

Ok, you have to copy with devel-su. It’s a bit strange, but that is directory the defaultuser (or nemo) can’t write to without root.

Just do:
devel-su chown defaultuser:priviledged .local/share/system/privileged/Contacts/qtcontacts-sqlite/*
for those files.

yes, thanks for your help. i wrote as root, but it seems i couldn’t copy the privileged folder as defaultuser and since i flashed the old device too, i guess the contacts are lost

at least the messages got copied. so i guess the contacts could be recreated, although quite time consumingly

did you try

devel-su find /home/defaultuser -name contacts.db
?