Upgrade process from CentOS 6. X to CentOS 7

Time:2021-6-9

Just a few weeks after the release of Red Hat Enterprise version 7, CentOS 7 was also released, and included the same exciting features as red hat. In addition to the long-awaited SYSTEMd and the current popular docker, this release also makes it possible for the system to automatically update from version 6 to version 7 without installing image files. Although the upgrade still needs to be restarted, it is not a kind of live upgrade, but it is very convenient for those servers that can only be accessed remotely.

Red hat has already released and documented the necessary update tools. The CentOS team didn’t have time to import, test, and rebuild the tools, but the developers were already doing it – and they provided untested binaries.

  Please note thatSince these packages have not yet been tested, you should not try them in any way, except on a standby test machine, which you can simply redeploy without any valuable data. Never try it on a production machine!

But if you want to have a preliminary understanding of how the tool works in general, I’d like toIt is recommended that you build a simple CentOS 6 virtual machine, install as few packages as possible and all system updates. Then, install these RPMs from the CentOS library mentioned above.

Among these RPMs, there is a preupgrade assistant, which can be safely executed on the system: preupg only analyzes the system and does not perform any tasks. After execution, it will give some suggestions to tell the update program what to search when updating.

Since I only run on systems with few services installed, I don’t get the actual results after running preupg. The same result is obtained even on a system with more services (there are many rows, so only some rows are shown as examples);

Copy code

The code is as follows:

$ sudo preupg
Preupg tool doesn’t do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/10 …finished (time 00:00s)
All changed files : 02/10 …finished (time 00:48s)
Changed config files : 03/10 …finished (time 00:00s)
All users : 04/10 …finished (time 00:00s)

042/100 …done (samba shared directories selinux)
043/100 …done (CUPS Browsing/BrowsePoll configuration)
044/100 …done (CVS Package Split)

|samba shared directories selinux |notapplicable |
|CUPS Browsing/BrowsePoll configuration |notapplicable |
|CVS Package Split |notapplicable |

As mentioned above, the preupgrade assistant only helps to analyze what problems will occur during the update – the real steps need to be completed by using the L RedHat upgrade tool cli. Tool. To make this tool work effectively, you must first import the key of CentOS 7:

Copy code

The code is as follows:

  $ sudo rpm –import http://isoredirect.centos.org/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

Then, the actual upgrade tool is called, and the corresponding options are the future release version and the URL address of the download data. In addition, because the tool will warn that preupg is not running ahead of time, I have to add the — force option shield, although this warning is correct. Once the upgrade tool is called, some necessary information, packages and pictures will be downloaded, and then it will request a restart, which will not happen automatically.

Copy code

The code is as follows:

$ sudo /usr/bin/redhat-upgrade-tool-cli –force –network 7 –instrepo=http://mirror.centos.org/centos/7/os/x86_64
setting up repos…
.treeinfo
| 1.1 kB 00:00 getting boot images…

After restart, the machine will use the downloaded package to start updating itself. Depending on the processing speed of the machine, the corresponding parsing time will be different. It is expected to take a few minutes instead of a few seconds. Anyway, if everything works properly, the next login will enter the CentOS 7 interface.

Copy code

The code is as follows:

$ cat /etc/os-release
NAME=”CentOS Linux”
VERSION=”7 (Core)”
ID=”centos”
ID_LIKE=”rhel fedora”
VERSION_ID=”7″
PRETTY_NAME=”CentOS Linux 7 (Core)”
ANSI_COLOR=”0;31″
CPE_NAME=”cpe:/o:centos:centos:7″
HOME_URL=”https://www.centos.org/”
BUG_REPORT_URL=”https://bugs.centos.org/”

The conclusion shows that the upgrade tool runs well. Although it is not as good as a real live upgrade, if it provides a very good way to upgrade the remote server. I tested a clean virtual machine, a bare computer, a remote server, and upgrade tools all worked surprisingly well. Unfortunately, the analysis tool didn’t work as I expected, either because it hasn’t been tested or because I didn’t use it properly. As time goes on, I look forward to how the upgrade tool will develop and improve. But, again, as mentioned earlier – don’t try it on your own product server.