If you're using the aosp Fairphone, Fossify contacts and a bit of DIY. If you're using the /e/os Fairphone Murena.io has a built in cloud sync that's free.
Pretty sure you can export contacts using the contacts app on android, this puts the contacts into a .vcf file, then you can put the vcf file on your new phone and import the vcf file using the contacts app's import function. I could be wrong, it's been a while since I had to do that.
Don't know about the standard app but with Fossify Contacts you can export all your contacts (through the share function). And presumably import them from the generated file.
Do you need to do it only once, or on an ongoing basis?
I use Nextcloud and Davx⁵
DAVx does the same job as google contact sync.
it just needs you to host a contacts server on the other end. for practicality, it can be hosted on a regular laptop, and will sync when both are on.
make sure to have backups if you go this route!