If you want to keep configuration, accounts and settings, the best solution would be to follow the normal upgrade routine, so NC 21 → 22 → 23 → 24 → 25 → 26 → 27. This also requires some PHP updates on the way.
If you just want to start over but keep the data, maybe try downloading it all and then upload it on the new instance. (If you only have few accounts)
You could also clone the old data directory into the new nextcloud and then use the occ files:scan command to make NC discover the files.
Migration can be done to exactly the same server version - in order to finish with supported version at the end you have to follow the one-by-one upgrade path as mdw described. depending on your setup you can go all the the way on the initial system or on the final system or migrate in the middle…
so your second option with cloning the data…
I rsync the data from old instance (Version 21) to the new Instance (Version27)
Copy the config.php file (for ldap sync) and then do a occ files:scan?
And if I will go through the official steps, each version upgrade until 27…
You mentioned that I have to do something with PHP.
can you tell me where do I have to make some configuration because of the version jump from 7.4 to 8.0?
Maybe you have some additional information.
Thanks.
You expand your list of questions without providing any relevant information about your system. You have not filled out the support template from which the people who can and want to help you can then deduce what you will face with your project. Without the information, any advice is meaningless and can only be absolutely general.
So please fill out the support template, provide information about the environment, i.e. the operating system, the web server and the php-SAPI used, so that you can be helped if you cannot solve it yourself by reading the manual and using the search function here in the forum.
Unfortunately there is no crystal ball that explains your system to us yet.