rocky-tools/migrate2rocky
Peter Ajamian fe473ae20b Add color back in
We previously removed color because (1) it was outputting the color codes to the
log file, which we do not want and (2) nobody could agree on what colors to use.
I've reintroduced color now fixing (1) by allowing for separate output to the
log file and the console and only sending the color codes to the console and (2)
well, I've changed the blue for info messages to cyan, hopefully everyone's
happy with that, but I'm open to suggestions on the info color.

There are now three more file descriptors for specialized output control, making a total of 5:

fd1 - This sends to stdout and to the log file.
fd2 - This sends to stderr and the log file.
fd3 - This just sends to stdout.
fd4 - This just sends to stderr.
fd5 - This just sends to the logfile.

There are also three additional functions:

msg_format - Intended to be used by infomsg and errmsg, this accepts a variable
name and one or more string args.  If there is just one string after the
variable name then it is copied to the variable verbatim.  If there is more than
one then it is taken to be a format specifier and additional args to be passed
to printf (output going to the variable).

infomsg - This will accept either a single arg which contains a verbatim string
or multiple format / args to be processed by printf.  The output of this will be
sent to the log file and also color coded and sent to stdout.

errmsg - Like infomsg but it uses the error color and sends output to stderr
instead of stdout.
2021-06-21 00:01:02 +12:00
..
migrate2rocky.sh Add color back in 2021-06-21 00:01:02 +12:00
README.md Move migrate2rocky into it's own subdirectory. 2021-06-11 19:17:16 +02:00

migrate2rocky -- Conversion Script

Running this script will convert an existing CentOS 8 system to Rocky Linux 8.

Usage

./migrate2rocky.sh -h
├── -h   # --> Display this help
├── -r   # --> Convert to Rocky
└── -V   # --> Verify switch

[!! USE WITH CAUTION !!]

Known Issues

Katello clashes

Katello installs its own repositories via subscription-manager that are meant to replace the ones from CentOS, but it does not remove, or even disable, the corresponding CentOS repositories. This would cause issues to a normal running system, but it is especially problematic for migrate2rocky as it means that migrate2rocky cannot properly determine which repositories to remove and attempting to run migrate2rocky on a katello will likely result in a corrupted system.

RHEL migrations show error messages during conversion

  Installing       : rocky-release-8.3-13.el8.noarch                        2/5Error unpacking rpm package rocky-release-8.3-13.el8.noarch
...
error: unpacking of archive failed on file /usr/share/redhat-release: cpio: File from package already exists as a directory in system
error: rocky-release-8.3-13.el8.noarch: install failed
...
Error: Transaction failed

This results from conflicts in the directory structure of RHEL with that of RockyLinux. migrate2rocky will detect the issue and go on to remove the conflicting directory and install rocky-release with the rpm command.

Grub still shows kernel entries from previous installation

This is normal. The running kernel cannot be safely removed when migrate2rocky is run. The RockyLinux kernel should come up as the default highlighed kernel on reboot but the other ones will remain until they are removed or replaced by newer kernels. If you want you can manually remove the old kernels after reboot with dnf or rpm.

Latest Version

The latest version of this script can be found here.

Debugging

The migrate2rocky script pipes everything shown on stdout and stderr to /var/log/migrate2rocky.log.

If you run in to issues executing this script, please submit an issue here.

Make sure to include the output log, and remove any sensitive information. (if any)

Feel free to create a pull request if you think you've got the fix.