Is your feature request related to a problem? Please describe.
I'm trying to switch from SOGo to nextcloud. I exported my contacts from SOGo which makes them available as a LDIF file. I didn't find a way to convert this to a VCF file, so I'm stuck with using SOGo.
Describe the solution you'd like
I'd love to be able to upload LDIF files in the contacts app.
Describe alternatives you've considered
A link or description in the manual of the contacts app on how to import data from different sources would be awesome as well.
Hello!
I found this http://labs.brotherli.ch/vcfconvert/
Though I have no idea what a ldif file is :)
Can't you export as vcf from sogo? :thinking:
I found that link, too :) sadly they only convert vcf -> ldif and not the other way...
ldif is the ldap data interchange format and sadly it is the only format sogo can export :(
Arf, I read too fast ;)
Does this one help? https://www.freeviewer.org/ldif/converter.html
@raffomania
You can import your LDIF contacts to Thunderbird and then export them to VCF
Or you can use Thunderbird's CardBook extension to transfer them to NextCloud.
As this sounds like a nice feature, currently there a no plans to implement such a feature. Thus I will close this ticket for now. This does not mean we don't want this feature, but it is simply not on our roadmap for the near future. If somebody wants to implement this feature nevertheless we are happy to assist and help out.
Nextcloud can't import ldif, but you can convert to vcf and then import to Nextcloud.
To convert ldif to vcf you can use Mozilla Thunderbird.
Problem:
Thunderbird converts to vcf-version 2.1 and Nextcloud can only handle 4.x.
So you have to convert.
For that I used this Python script:
f = open("output.vcf", "a")
idCountBase = "0xfb44caa1468f"
idAsInt = int(idCountBase, 16)
idAsInt += 1
theName = ""
telNr = ""
def writeit():
f.write("BEGIN:VCARD\n")
f.write("VERSION:4.0\n")
f.write("PRODID:-//Nextcloud Contacts v3.2.0\n")
f.write("UID:b0d19993-a542-47e3-b69c-" + idAsHex + "\n")
f.write("REV;VALUE=DATE-AND-OR-TIME:20200312T085943Z\n")
f.write("FN:" + theName + "\n")
f.write("ADR;TYPE=HOME:;;;;;;\n")
f.write("EMAIL;TYPE=HOME:\n")
f.write('TEL;TYPE="HOME,VOICE":' + telNr + "\n")
f.write("END:VCARD\n\n")
filepath = "vcf-file-from-thunderbird-conversion.vcf"
with open(filepath) as fp:
line = fp.readline()
while line:
idAsInt = int(idCountBase, 16)
idAsInt += 1
idAsHex = hex(idAsInt)
idCountBase = idAsHex
if(line.strip().startswith("fn:")):
theName = line.strip().split(":")[1]
if(line.strip().startswith("tel;cell:")):
telNr = line.strip().split(":")[1]
if(line.strip().startswith("end:vcard")):
writeit()
line = fp.readline()
f.close()
You need to have both vcf files mentioned in script in same directory.
"vcf-file-from-thunderbird-conversion.vcf" ist the ouput from converting ldif to vcf 2.0 with Mozilla Thunderbird.
And you must create an empty file "output.vcf".
Then run in cmd-shell "py file.py" where file.py is the file you copy-pasted that Python code above in.
After that you finally can import "output.vcf" to Nextcloud!
@haukegithub Saved my day!
Most helpful comment
@raffomania
You can import your LDIF contacts to Thunderbird and then export them to VCF
Or you can use Thunderbird's CardBook extension to transfer them to NextCloud.