The curl command I am using is:
curl -o /filepath/filename.vcf -u [u]:[pw] “[remote_adress]:/remote.php/dav/addressbooks/users/[user]/[addressbook]/?export”
That curl command is correct as long as [addressbook] is the value uri from the table oc_addressbooks (your prefix might be different than oc_).
I suspect a timeout issue of either the webserver or php. You can avoid that by increasing the relevant values of your webserver/php configuration. If you are using nextcloud-snap you need to open an issue for that, since the configuration files of the according webserver and php are not changeable in nextcloud-snap: https://github.com/nextcloud/nextcloud-snap/issues
However, since a addressbook is nothing else than single vCards glued together to one big file, as a workaround you could create a backup of the according addressbook directly from the database. Of course access to the database is needed for that:
find out the id of the addressbook you want to export with: mysql -u[dbuser] -p [dbname] -e "SELECT * FROM oc_addressbooks"
get the contacts of the addressbook and save them all together in a file as backup of the addressbook (use the id from step 1 as [ID]) with: mysql -u [dbuser] -p [dbname] -sre "SELECT carddata FROM oc_cards where addressbookid=[ID]" > addressbookbackup.vcf
Remarks:
I am using the database-table prefix oc_ which is used for standard installations of nextcloud. Your prefix might be different, you can find it in nextclouds /path/to/nextcloud/config/config.php
[dbuser] and [dbname] can be looked up in nextclouds /path/to/nextcloud/config/config.php
If you are using nextcloud-snap: replace mysql -u [dbuser] -p [dbname] -sre
with sudo nextcloud.mysql-client
You don‘t have to look up [dbuser], [dbname] nor the table prefix when using snap.
EDIT:
replace mysql
with sudo nextcloud.mysql-client
all the options are needed. The values can be looked up in nextcloud snaps config.php under /var/snap/nextcloud/current/