This Blog describes the Migration from CentOS 8 to Rocky Linux 8.
And hopefully there is a backup or VM Snapshot in place when something goes wrong.

At first Updating CentOS 8 to the latest is required, but this is now not so easy, most Repositiory Mirrors are deprecated.
As Preparation an adaptation of the CentOS Repo files is needed to get this task done.

In this case the following repo files where in place, CentOS-AppStream.repo, CentOS-Base.repo, CentOS-Extras.repo, CentOS-PowerTools.repo.
So a adaptation of the baseurl in these four files is required.

$ CentOS-AppStream.repo
$ baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
$ CentOS-Base.repo
$ baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
$ CentOS-Extras.repo
$ baseurl=http://vault.centos.org/$contentdir/$releasever/extras/$basearch/os//
$ CentOS-PowerTools.repo
$ baseurl=http://vault.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/

The repositories at http://vault.centos.org working, most other as I wrote are deprecated and not reachable.

After the adaptation of the repo file update CentOS 8 to 8.5.

$ dnf update

And reboot afterwards.
If possible create after the CentOS 8.5 upgrade a backup or snapshot.

The CentOS repo files renamed to repo.rpmsave and there will be new ones named CentOS-Linux.. now.

Rocky Linux provides a migration script which ca be downloaded using curl.

$ cd /tmp
$ mkdir rocky
$ cd rocky
$ curl https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh -o migrate2rocky.sh
$ chmod u+x migrate2rocky.sh

This scrip know three switches, -h for help, -r for run and -V for verify.
For the migration we need -r.

$ ./migrate2rocky.sh -r

There will be an error message about invalid URLs, this is related to CentOS so it can be ignored.
This script will replace the CentOS packages with the Rocky Linux ones, so it will run a while.
When it has finished successfully and the system was rebootet the migration is done.

# cat /etc/os-release
$ NAME="Rocky Linux"
$ VERSION="8.5 (Green Obsidian)"
$ ID="rocky"
$ ID_LIKE="rhel centos fedora"
$ VERSION_ID="8.5"
$ PLATFORM_ID="platform:el8"
$ PRETTY_NAME="Rocky Linux 8.5 (Green Obsidian)"
$ ANSI_COLOR="0;32"
$ CPE_NAME="cpe:/o:rocky:rocky:8:GA"
$ HOME_URL="https://rockylinux.org/"
$ BUG_REPORT_URL="https://bugs.rockylinux.org/"
$ ROCKY_SUPPORT_PRODUCT="Rocky Linux"
$ ROCKY_SUPPORT_PRODUCT_VERSION="8"