Upgrading CentOS 6 to 7

General support questions
kluch
Posts: 10
Joined: 2020/05/31 05:47:54

Re: Upgrading CentOS 6 to 7

Post by kluch » 2020/10/03 20:08:20

I've just upgraded Centos 6.10 (without GUI) to Centos7 (and finally to Centos 8.2), so it is still possible:
Just try yourself:
1. add repo in /etc/yum.repos.d/upg.repo;
[upg]
name=CentOS-$releasever - Upgrade Tool
baseurl=http://buildlogs.centos.org/centos/6/upg/x86_64/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

2. Then:
yum -y install openscap-1.0.8 preupgrade-assistant-contents preupgrade-assistant redhat-upgrade-tool
3. and give it a try (it will only inform you about potential problems):
preupg -s CentOS6_7
4. If there are too many errors in point 3 that you dont understand then GIVE UP HERE!
or else just finally do:
centos-upgrade-tool-cli --network 7 --cleanup-post --instrepo=http://vault.centos.org/centos/7.2.1511/os/x86_64/ --addrepo=CentOS7=http://mirror.centos.org/centos/7/os/x86_64/ (<=here you can use preferred repo)
5. Upgrade grub:
yum remove grub
yum install grub2 grub2-tools grubby
grub2-mkconfig -o /boot/grub2/grub.cfg
6. enable services
systemctl enable network
systemctl enable sshd
systemctl enable rsyslog

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Upgrading CentOS 6 to 7

Post by jlehtone » 2020/10/04 19:21:56

Which one looks like less effort and less risk:
  • Install new system and learn to use it properly
  • Use something that has low chance of success, no guarantee whatsoever, and then learn to use the new system properly even though your system might have silent corruption
I do hope that you don't even consider the option of not learning to use the system. It is not an option.

hockeyrink
Posts: 1
Joined: 2020/10/10 17:50:47

Re: Upgrading CentOS 6 to 7

Post by hockeyrink » 2020/10/10 17:53:48

kluch wrote:
2020/10/03 20:08:20
2. Then:
yum -y install openscap-1.0.8 preupgrade-assistant-contents preupgrade-assistant redhat-upgrade-tool
Hrm Having issues finding the pre-upgrade elements. Gonna have to check my repo settings.

Thanks for the walkthru. I've got a VM needing updating for an updated service requirement, and I appreciate somebody relating their experience to make a tool work rather than having to rebuild it from scratch.

User avatar
TrevorH
Site Admin
Posts: 33224
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Upgrading CentOS 6 to 7

Post by TrevorH » 2020/10/10 18:04:54

At risk of repeating myself:

There is NO UPGRADE from one CentOS version to the next. None. The official position is that you backup your data and configs, reinstall the system, restore the data and adjust configs.

Please note this tool DOES NOT WORK. It bricks systems on a regular basis, possibly beyond recovery. It is dangerous to use and you cannot ever rely on the results if by some remote possibility that it does work (which it does not in 99% of all cases).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Upgrading CentOS 6 to 7

Post by jlehtone » 2020/10/10 18:14:15

hockeyrink wrote:
2020/10/10 17:53:48
... rather than having to rebuild it from scratch.
Rebuilding a VM from scratch is infinitely safer, and probably quicker and easier if you know what you are doing.

If you don't know what you are doing, then the last thing you should attempt is duct tape on duct tape of undefined behaviour, of which you by definition can't tell whether it just sold your kidney.

mikadamsterdam
Posts: 1
Joined: 2020/10/11 09:44:34

Re: Upgrading CentOS 6 to 7

Post by mikadamsterdam » 2020/10/11 10:13:19

on centos 6.10 running on a VM

all was fine until the step:

the command:
grub2-mkconfig -o /boot/grub2/grub.cfg doesn't work apparently

# grub2-mkconfig -o /boot/grub2/grub.cfg
-bash: grub2-mkconfig: command not found

User avatar
TrevorH
Site Admin
Posts: 33224
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Upgrading CentOS 6 to 7

Post by TrevorH » 2020/10/11 13:18:45

It. Is. Unsuppoorted. Please. Do. Not. Use. It.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: Upgrading CentOS 6 to 7

Post by Whoever » 2020/10/12 03:07:56

TrevorH wrote:
2020/10/11 13:18:45
It. Is. Unsuppoorted. Please. Do. Not. Use. It.
Another reason to NOT use the unsupported tool is that, during a reinstall of a new system, you can take the opportunity to clean up the cruft and tighten up the security of the new machine. I know that this should ideally not be necessary, but here in the real world .....

kluch
Posts: 10
Joined: 2020/05/31 05:47:54

Re: Upgrading CentOS 6 to 7

Post by kluch » 2020/10/21 18:18:32

mikadamsterdam wrote:
2020/10/11 10:13:19
on centos 6.10 running on a VM

all was fine until the step:

the command:
grub2-mkconfig -o /boot/grub2/grub.cfg doesn't work apparently

# grub2-mkconfig -o /boot/grub2/grub.cfg
-bash: grub2-mkconfig: command not found
You should have grub2-mkconfig as earlier was command "yum install grub2 ..." without successful installation of grub2 you will end up with unbootable system.
ps. On Centos 6.10 it was good to downgrade "grep" from 2.20-6 to 2.6.3 from earlier centos 6.x distro, because centos 7.x has version 2.20-2 and upgrade is not performed automatically.

Post Reply