Prerequisites

  • Have an OwnCloud server running.
  • Have the CardDAV-Sync application (either the free or paid version if you want to support the author).

Steps

  • On your phone, open “Contacts”, then open the settings menu, and select “Import/Export”.

  • Select “Export to USB storage”

  • Select all your contacts, and validate

  • The phone now has a file named “something.vcf”. I didn’t succeed in downloading that file from my phone (argh) with the USB cable. So…

  • Delete all your existing contacts on your phone (be strong). If you don’t want to be that strong, you can skip this step.

  • Backup your OwnCloud server database. Preventing is better than fixing.
  • Set up CardDAV-Sync with your OwnCloud informations (URL, login, password). The URL should be something like that : https://your-owncloud-server/path-to-owncloud/remote.php/carddav/principals/yourlogin

  • Don’t forget to check the option to sync from your phone to the OwnCloud server, otherwise your imported contacts will stay on the phone and will never be synced.
  • Then, open the VCF file on your phone. It will ask you what to do. Just say “Import to [your CardDAV contacts]”.

  • W00t! All my existing contacts are now imported to the OwnCloud contacts on my phone. And now it starts syncing to my server! This is brillant!

Conclusion

This is a workaround, more a “hack” than a real solution. I can’t figure out why I haven’t been able to download with USB the VCF file from my phone, or copying my internal contacts to the OwnCloud contacts on my phone. Maybe it’s fixed in recent Android versions.

See also : http://doc.owncloud.org/server/4.5/user_manual/contacts.html