Centos 3.4 --> Centos 4 ?

R

Ramsy

Guest
Anybody has a how-to on how to upgrade from centos 3.4 to centos 4, and any do's and dont's for the progress ?
Can this be done remotely or do i need to go to the DC in order to migrate ?
 

nickn

Well-Known Member
PartnerNOC
Jun 15, 2003
616
1
168
Ramsy said:
Anybody has a how-to on how to upgrade from centos 3.4 to centos 4, and any do's and dont's for the progress ?
Can this be done remotely or do i need to go to the DC in order to migrate ?
This really isn't even worth doing at this point since you can't use selinux with cPanel.
 
R

Ramsy

Guest
nickn said:
This really isn't even worth doing at this point since you can't use selinux with cPanel.
Well CPanel supports it now (look @ cpanel.net frontpage) and i hear it's less resource hogless and more stable then 3.4, so i wanna give it a shot if it were that simple as the 3.3 --> 3.4 upgrade, altho i can't find any good how-to's on google.
Centos site says use "linux upgradeany" directly from CD, but i wanna know if somebody did it remotely with success :)
 

Webjunkie

Active Member
PartnerNOC
May 1, 2003
42
0
156
Use at your own risk, and YMMV!

# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
# rpm -Uvh ftp://sunsite.utk.edu/pub/linux/caos/centos/4.0/os/i386/CentOS/RPMS/centos-release-4-0.1.i386.rpm
# yum install glibc glibc-common
# yum install {kernel|kernel-smp} *(if this give you errors installing lvm2 read the note at the end of the post)
# rpm -e kernel-smp-2.4.21-27.0.2.EL (the release number may vary depending on your system)
# yum upgrade

conflict between udev and kernel

# rpm -qa|grep kernel
# rpm -e kernel-2.4-whatever

Also remember before rebooting to view the new kernel's initrd image size and generate a new one to compare.

# ls -l initrd-2.6.9-5.0.3.ELsmp.img
-rw-r--r-- 1 root root 195325 Mar 2 16:09 initrd-2.6.9-5.0.3.ELsmp.img

# mkinitrd initrd-2.6.9-5.0.3.ELsmp.img.new 2.6.9-5.0.3.ELsmp

# ls -l initrd-2.6.9-5.0.3.ELsmp.img.new
-rw-r--r-- 1 root root 474840 Mar 3 11:39 initrd-2.6.9-5.0.3.ELsmp.img.new

If this differs in size, like mines, move the old image to a different file name and cut off the '.new' extension in the new one's filename

# mv initrd-2.6.9-5.0.3.ELsmp.img initrd-2.6.9-5.0.3.ELsmp.img.dist
# mv initrd-2.6.9-5.0.3.ELsmp.img.new initrd-2.6.9-5.0.3.ELsmp.img

You need this in order to permit grub loading the new initrd (or change the grub.conf to point to the new generated initrd image, make your choice).

As you see the rpm generated initrd is smaller than the manually generated, which means there's something wrong in the rpm postinstall script. Make sure of this and take a lot of care before rebooting (otherwise be ready with a rescue CD to boot and follow the above procedure).

P.S.: you may have need of cutting the "smp" letters in the kernel name, depending on your hardware configuration.

I forgot to mention some important changes between 3.4 and 4.0 release. One of most important is the name changing of some packages, like rpmdb. On CentOS 3.4 that package has the name "rpmdb-redhat" while in 4.0 it has "rpmdb-CentOS". There's now way to upgrade it since it's a totally different name and the package install paths are different by the old one.

Just install the new rpmdb-CentOS through Yum or simply downloading it and installing with rpm -ivh, then remove with rpm -e the old rpmdb-redhat.

*NOTE: Possible errors installing lvm2 package
==============================
Yum may give errors trying to install the lvm2 package, since lvm1 is already installed and files may go to be conflicting (I had this issue only on two systems, the third worked perfectly, don't ask me why). The only solution I found is to manually install the downloaded rpms located in the /var/cache/yum/base/packages directory, just remember to use the --replacefiles switch to install lvm2, and later erase lvm1, like described below:

# cd /var/cache/yum/base/packages
# rpm -Uvh --replacefiles lvm2*.rpm (and some dependencies must follow)
 

Webjunkie

Active Member
PartnerNOC
May 1, 2003
42
0
156
Please keep in mind that it is very easy to make your system unbootable if you do not follow these instructions exactly or forget to do something mentioned.

Also, if the system is rebooted at any point during this process, you will find yourself with an unbootable system.

After everything is done, you will need to reboot in order to complete the upgrade.
 

Webjunkie

Active Member
PartnerNOC
May 1, 2003
42
0
156
Yes, we've done it several times with success.

After doing everything and rebooting, make sure you run

# /scripts/upcp --force

To make sure Cpanel is good to go.

You may also have to download and run

# sh buildapache.sea

because the upgrade sometimes makes Apache unusable.
 
R

Ramsy

Guest
Webjunkie said:
Use at your own risk, and YMMV!
I forgot to mention some important changes between 3.4 and 4.0 release. One of most important is the name changing of some packages, like rpmdb. On CentOS 3.4 that package has the name "rpmdb-redhat" while in 4.0 it has "rpmdb-CentOS". There's now way to upgrade it since it's a totally different name and the package install paths are different by the old one.

Just install the new rpmdb-CentOS through Yum or simply downloading it and installing with rpm -ivh, then remove with rpm -e the old rpmdb-redhat.
I that the only thing i need to do ?
Or are there more ?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
I'd strongly suggest you read the information and FAQ on the CentOS site:
http://www.centos.org/modules/smartfaq/faq.php?faqid=27

As Webjunkie said, you risk making your server unbootable, so I'd suggest you only do it on a server you can afford to have to lose any data on and have an OS restore done on. It would seem much more secure to backup, load CentOS4 then reload, but each to their own ;)
 
R

Ramsy

Guest
Hmm, it actually worked.
Just needed to copy the old named.conf that was all.
Worked without any problems.
Tested it first on a testbox, and must say ta for the howto webjunkie!
Cheers!
:D
 
R

Ramsy

Guest
webignition said:
Ramsy - how long did the upgrade take you and on what spec machine?

If I'm ever going to consider a live upgrade it would be good to know how long things are likely to take.
It is and AMD 2ghz, with 1GB RAM, 1x 120 and 1x 160 HDD.
It was running Centos 3.3 when i installed it the first time, then a few months ago i upgraded to Centos 3.4.
And todat i upgraded it to Centos 4.

Currently running:
WHM 10.1.0 cPanel 10.2.0-R82
CentOS 4.0 i686 - WHM X v3.1.0

I just followed Webjunkies intructions and that worked for me.
I only needed to remove imap and omni-foomatic and foomatic package, which was giving me problems.
Mysql didnt work after the reboot, so i did a upcp --force, mysqlup --force and copied old named.conf over the new one and worked like a charm.
The whole process took me 2 hrs tops.
 
S

Secret Agent

Guest
I followed this to upgade from 3.4 to 4.1:

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
rpm -Uvh http://mirrors.versaweb.net/centos/4.1/os/i386/CentOS/RPMS/centos-release-4-1.2.i386.rpm
yum install glibc glibc-common
yum install {kernel|kernel-smp} *(if this give you errors installing lvm2 read the note at the end of the post)
rpm -e kernel-smp-2.4.21-27.0.2.EL (the release number may vary depending on your system)
yum upgrade


I got this error during this step yum install glibc glibc-common

IOError - # 2 - No such file or directory


What should I do?
 

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Secret Agent said:
I followed this to upgade from 3.4 to 4.1:

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
rpm -Uvh http://mirrors.versaweb.net/centos/4.1/os/i386/CentOS/RPMS/centos-release-4-1.2.i386.rpm
yum install glibc glibc-common
yum install {kernel|kernel-smp} *(if this give you errors installing lvm2 read the note at the end of the post)
rpm -e kernel-smp-2.4.21-27.0.2.EL (the release number may vary depending on your system)
yum upgrade


I got this error during this step yum install glibc glibc-common

IOError - # 2 - No such file or directory


What should I do?
You're in uncharted territory. If you don't know what to do, you should probably have waited for others to clear the way first. Good luck, though.
 

brentp

Well-Known Member
Mar 11, 2004
323
0
166
Ayr, North Queensland, Australia
I highly suggest that you use rack911.com for this. Their pricing is $50 a box and their upgrade is flawless (even on my screwed over box) ;). They upgrade it in stages and get the main stuff out of the way and then they do the upgrade. As i said before. Flawless.

I just did an upgrade before from 3.5 - 4 and it worked flawlessly. However, DO NOT UPGRADE TO 4.1, as i do not know if cPanel works on it yet (and im not game to test it). One of the major changes between 3 and 4 is the change from 'devfs' to udev as devfs was obsoleted by udev. And if you do try to migrate to 4 and realise you fucked it over, dont try 'downgrading' to 3 by installing all the 3.x rpms again. It wont work.

Regards,
Brent
 

erwinfa

Well-Known Member
Jun 14, 2003
108
0
166
I'm using Centos 4.1 at one of my box without a problem

brentp said:
I highly suggest that you use rack911.com for this. Their pricing is $50 a box and their upgrade is flawless (even on my screwed over box) ;). They upgrade it in stages and get the main stuff out of the way and then they do the upgrade. As i said before. Flawless.

I just did an upgrade before from 3.5 - 4 and it worked flawlessly. However, DO NOT UPGRADE TO 4.1, as i do not know if cPanel works on it yet (and im not game to test it). One of the major changes between 3 and 4 is the change from 'devfs' to udev as devfs was obsoleted by udev. And if you do try to migrate to 4 and realise you fucked it over, dont try 'downgrading' to 3 by installing all the 3.x rpms again. It wont work.

Regards,
Brent
 

CoolMike

Well-Known Member
Sep 6, 2001
313
0
316
brentp said:
I highly suggest that you use rack911.com for this.
I'm not so sure about this, I asked rack911 to migrate my RHE 3 to Centos 3.4 about a month ago. They answered very fast and I sent them my login details. As agreed, they started with the migration but they told me, that there is a problem with the kernel, so I'm using now Centos 3.4 with the RHE kernel. They promissed me to fix this later, but since there, I'm not able to get any status from them. I sent email, replyed to the ticket in their helpdesk system, but no answer anymore.

How do you comunicate with them?

Michael