Upgrade for centos/rocky linux to new major versions is not supported. If you look for it there are procedures, but the changes between major versions can be so siginificant that this is not a good idea. Therefore, an approach I often use is to upgrade by installing the newer version next to the current version. Of course, I have also paritioned my old system to separate my home directory and other important directory into separate partitions so that the upgrade does not require copying user files.
This has some risks, since you might lose connectivity to the old linux version if the upgrade fails. Continue reading