I guess all hard drives of the old server are still running, so you have access to the nextcloud folder, data folder and theoretically database, which was also mysql/mariadb before?
So the nextcloud and data folders can just copied over. To set nextcloud into maintenance, you can manually change the related line in you nextcloud/config/config.php before accessing nc on your new machine.
About the database I am not too sure how to get all that data inside safely to your new machine, as you cannot do a database dump. The best way would be of course to temporarily get the old machine to run and do the database dump. There is this mysql folder somewhere in /var/run/ or something that contains the databases, but I got problems trying to just copy/replace them to a new operating system. Maybe someone elso knows how this can be handled if one just has access to the old hard drive but not the mysql console?
At least I guess it would already make it easier to use the exact same mysql/mariadb version, so no db upgrade need to be done on top.