iPhone, NC crash, vacation and self signed certs in LAN

Nextcloud server only accessible from LAN with the usual self signed certificate. Coming back from vacation, server has crashed. New installation, restore server from backup. But the certificate has changed โ€“ ok, it is a new one.

Trouble is that the iPhones wonโ€™t accept the new certificate on an existing account! You have to delete the existing account on the iPhone and create a new one, accept the certificate and only then the iPhone syncs with the Nextcloud (which runs on a raspberry pi).

But the user made some entries into his NC calendar during his vacation, which will be lost if I delete the account! Ok, since time was of essence, I deleted the account on the iPhone and the entries got lost. But I really would like to prevent that happening for a second time.

Can I make a backup of the self signed certificates and restore them after a crash in a new installation? What is needed to this end? โ€“ Thank you!