Blank installation, reuse data and versions

Hello together,
I’m running NextcloudPI 27.1.6 on a physical hardware under Debian.
A while ago - I’ve updated Debian accidently to 13 (Trixy). This causes some issues with other apps on this server - Nexcloud works still fine so far.
I would like to make a fresh install on the server (Debian 12), with a fresh Nextcloud-Installation (without PI).
In this scenario I would like to keep all data (which is easy) and all document versions.
I don’t mind rescanning all files if needed.
Ideally - the clients do not have to be resynced afterwards - but I guess this is a dream :wink:
I’ve read several articles about moving between hosts and migration - but I couldn’t find a perfect fitt for my requirements.
Maybe somebody here has a hint for me.
Kind regards Erre Uno

hi @ErreUno please use search many topic including this one have been discussed often already server_migration . Consult official docs as well: Migrating to a different server — Nextcloud latest Administration Manual latest documentation