Howto update Nextcloud Contacts?

NS8 with Nextcloud / Contacts.
Hello,
we imported addresses via vCard file from a SQL database. But now we need a solution to UPDATE this addresses, at example if there is a new phone number at an existing address.
We thought the field REVISION is the way to select, which dates are the newer one.
But our tests without luck …
Is there a solution to update an address ???
vCard line is:

REV;VALUE=DATE-AND-OR-TIME:20250422T140244Z

There are a lot of open issues about contacts import, see also GitHub · Where software is built
You could remove and recreate the addressbook and import all contacts again.

I found a script, maybe it’s of help, there’s also an explanation how to update a contact:

YOU NEED TO GET THE UID OF THE CONTACT AND INSERT IT IN THE URL PATH TO MODIFY AN OLD CONTACT

Thanks,
we hope, that the script works in Nethserver8 too. We need some time to test…
It looks a little bit complicated.
We thought there is an error in our timestamp field or
we need a special option in one of the config files.

1 Like

I don’t know if the script works at all, it’s just a pointer to explain how to update contacts and how it could be scripted.

1 Like

Thanks,
… we will try it after the import test.
But there we found a special german problem: äüöß
We tested import with some handmade “normal” addresses, but if we export all 500 addresses from SQL database and convert it to vCard file, we found, that only the last step of nextcloud import changed äöüß to <?><?><?><?> !!!
We tried that in GUI of NC/Contacts > import VCF
We found no solution, tried different codepages, but no solution

It should work using UTF-8, see also German Umlauts replaced when uploading from Windows - ℹ️ Support - Nextcloud community

Yes, I red this yesterday, tried it, but no effect in my environment…
We need a resolution to change the vCard file to UTF-8 IN A Windows batch file.
Something like chcp UTF-8 or so … don’t find the correct codepage.
Perhaps it is better to open a new topic ?

I tested it and it works when the file is encoded in UTF-8.

markus@asusminipc:~> file -i Downloads/testab1_shared_by_admin-2025-04-22.vcf 
Downloads/testab1_shared_by_admin-2025-04-22.vcf: text/vcard; charset=utf-8

I think you can convert the files using iconv or for example Notepad++ in Windows, see also How to Convert Files to UTF-8 Encoding in Linux

2 Likes

OK, that i know.
I took Geany editor to change to UTF-8, but we need an “automatic” for our scripts (adr.SQL or csv2vcf-convert.CMD). It’s the last convert problem of 12 others we could solve.
Sorry, I know this is not a nethserver/nextcloud problem …

On Windows you could use powershell or install iconv, see also Converting text file to UTF-8 on Windows command prompt - Super User

Thanks…
… but found an easier way: During export from SQL there exist an option to create Adressen.CSV with UTF-8 coding (-f 65001). Example:
`

Sqlcmd -S “Server/Instance” -d “Database” -U “User1” -P “Password” -i “Script1.sql” -W -f 65001 -h -1 -s “,” -o “c:\File.csv”

1 Like