Upgrading from CentOS 6 to CentOS 7
In just a few weeks after the release of Red Hat Enterprise 7, CentOS7 was also released, and included the equally exciting features as red hat. In addition to the long-awaited systemd and popular Docker, this release also makes it possible for the system to automatically update from version 6 to version 7 without installing the image file. Although the upgrade still needs to be restarted, it is not a live upgrade, but it is very convenient for servers that can only be accessed remotely.
RedHat has already released and documented necessary update tools. The CentOS team was too late to import, test, and rebuild tools, but developers had already begun-and they provided untested binary files.
Please note: since these packages have not been tested, you should not, in any way, you can try it on a machine that is easy to redeploy without any valuable data, except for a backup testing machine. Never try it on the production machine!
However, if you want to get a preliminary idea of how the tool works in general, I recommend that you create a simple CentOS 6 virtual machine, install as few packages as possible and all system updates. Then install the rpm from the CentOS Library mentioned above.
There is a Preupgrade Assistant among these rpm, which can be safely executed on the system: the preupg is only an analysis system and does not execute any tasks, after execution, it will provide some suggestions to tell the update program what to search for during the update.
Since I only run on a system with few services installed, I did not get the actual result after running preupg. Even a system with more services installed has the same result (there are many rows, so only some rows are shown as an example );
$
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, Preupgrade Assistant only helps to analyze what problems will occur during the update process-the real steps need to be completed using l RedHat-upgrade-tool-cli. tool. To make this tool work effectively, you must first import the CentOS 7 key:
$ Sudo rpm -- import http://isoredirect.centos.org/centos/7/ OS /x86_64/RPM-GPG-KEY-CentOS-7
Then, the actual upgrade tool is called. The corresponding options are the future release version and the URL of the downloaded data. In addition, this tool will issue a warning for the preupg not running in advance, so I have to add the -- force option to block it, although this warning is correct. Once the upgrade tool is called, some necessary information, packages and images will be downloaded, and then it will request a restart, which will not automatically happen.
$
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 the machine is restarted, it will use the downloaded package to start updating itself. The resolution time varies depending on the processing speed of the machine. It is expected to be several minutes instead of several seconds. In any case, if everything runs normally, the next login will go to the CentOS 7 interface.
$ 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/"
Conclusion: The upgrade tool runs well. Although it is not comparable to a real live upgrade, it provides a very good way to upgrade remote servers. I tested a clean virtual machine and a bare computer, remote server, and upgrading tool. They all worked exceptionally well. Unfortunately, the analysis tool didn't work as I expected, probably because it was not tested or I didn't use it correctly. With the passage of time, I look forward to how the upgrading tool will develop and improve. However, once again, as mentioned above-do not try it on your product server.
Use systemctl to add custom system services on CentOS 7
Compile and install LNMP in CentOS 7.0
CentOS 7.0 experiences different from previous versions
Official CentOS 7 release and download
64-bit CentOS 6.5 Installation Method
64-bit CentOS 6.4 dual-system installation in Win7
Precautions for installing CentOS and Windows systems
Install Windows 8 and CentOS on UEFI + GPT