Skip to content

An Android contacts (contacts2.db) to vCard format converter.

License

Notifications You must be signed in to change notification settings

tmo1/contacts2vcard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

contacts2vcard

contacts2vcard is a Perl script for converting Android contacts to vCard format. Its motivation was the need to extract contacts from a backup copy (produced by Oandbackup) of the Android contacts database and import them into a current Android installation. It has been designed for and tested on a copy of the contacts database ('contacts2.db') from Android 9 (Pie) (LineageOS); I do not know how well it will work, if at all, on other versions. The code is based on the excellent (unofficial) documentation of the database format here:

Currently, only name, phone number, and email data are extracted. A future version of the script may extract other data as well.

Dependencies

The script depends on the Perl modules DBD::SQLite and vCard (Debian: libdbd-sqlite3-perl and libtext-vcard-perl).

Invocation

The script is invoked as contacts2vcard [-d database] [-a address_book] [-v vCard version], where 'database' is the database file (including path - the default is 'contacts2.db' in the current directory), 'address_book' is the name of a file (including path - the default is 'address_book' in the current directory) to output the vCard address book to, and 'vCard version' is the desired vCard version (the default is 4.0) The error DBD::SQLite::db selectall_arrayref failed: no such table: data at perl/contacts2vcard.pl line nnn. indicates that the script has been pointed at an invalid file or (likely) a nonexistent one.

The Contacts app vCard importer on my Android phone (LineageOS 17.1, based on Android 10) refuses to import version 4.0 vCards ("The format isn't supported"), but it accepts version 2.1.

Alternatives

There are a number of other scripts that purport to do what contacts2vcard does; I have not tried them or studied their code, and contacts2vcard is not based on their code:

Cf.:

About

An Android contacts (contacts2.db) to vCard format converter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages