Upgrading a Plesk FC2 server to FC4
September 22nd, 2006
One of our clients just bought a new server and asked us to move a rails app onto it. Unfortunately, I found that the server software was Fedora Core 2, which is not the best playmate for rails (you can only get ruby 1.8.2 via yum for a start). And support for FC2 has just been dropped by the Fedora Legacy project. Methinks an upgrade. This looked like it could consume many days and involve much pain...
(you can skip straight to the upgrade)
After a bit of googling, it seemed that this was not a totally crazy plan. The basic idea being: upgrade yum first, and grab the target fedora-release. Then upgrade everything, removing any conflicts, reboot into FC3. Repeat for FC4. Ta-da. But I'd been here before...
Owing to a spectacular failure of imagination, I'm an optimist about pretty much anything that is more than 20 minutes into the future. Luckily my memory is in better shape than my imagination. So a little voice said 'you could totally tool yourself here, we're talking utterly spannered'
That voice was right. I needed to know more, and I needed to be rational about this. It was time to consult my handy tarot utility...
$ tarot --help
Gives a tarot reading for the specified path(s).
USAGE: tarot [options] path[s]
--help this text
--ironic invokes no real powers
--port=PORT Attempts to establish a connection to the nether world on
the specified port (default = 777). Connecting on port 666 is
only recommended with --ironic.
Many have reported good results when used in conjunction with
the 'pom' utility.
$
$ tarot --ironic /usr/local/bin/psa /usr/boot /var/www/vhosts
card 1: #13 La Mort
card 2:
Segmentation Fault: Core dumped
$
La Mort, Death... then a segfault, holy crap!
But a few minutes on the interweb revealed that it's a schoolboy error to equate 'La Mort' with bad. No! It can mean rebirth, or starting anew. This was great news!
I had previously thought that this sort of thing was just guff. A handy way for the charlatans to avoid the unfortunate economic effects of their their arcane art's heritage. (Remember the scandal in the 1960s when the North Ulster Tarot Society proposed replacing La Mort with Le Lapin?).
But I could see that this reading was telling me, in some detail, exactly what the outcome of the update would be. Confidently, without even cross-referencing with pom, I plowed ahead.
Requirements
The server was running FC2 and Plesk 8.01, and very little else. I had to make sure that the existing data on the server (about 100 vhosts) remained a-o-k. I had to make sure that Plesk and Webmail would all work in the same way for the client.
I won't keep you in suspense; it turned out fine, but there was one heart stopping moment...
The Upgrade
A lot of the following info was gleaned from Fedora's yum upgrade faq
DISCLAIMER: that little voice is telling me to tell you "it's yer own damn fault if you tool yourself"
Backup
The first thing to do is backup the plesk client data. Make sure you transfer the resulting file off the server in case you tool it and can't reboot.
/usr/local/psa/bin/pleskbackup --all <filename>
FC2 to FC3
Next, upgrade yum and fedora-release to version 3 (make sure you're logged in as root). If you find that you can;t download the rpms from the example mirrors, just google the rpm name with 'Fedora'.
wget http://fedora.glorb.com/core/3/i386/os/Fedora/RPMS/fedora-release-3-8.i386.rpm wget http://fedora.glorb.com/core/3/i386/os/Fedora/RPMS/yum-2.1.11-3.noarch.rpm rpm -Uvh yum-2.1.11-3.noarch.rpm rpm -Uvh fedora-release-3-8.i386.rpm yum -y upgrade
Now, while the upgrade is churning away, prepare yourself for some dependency failures. I had a missing dependency, various plesk packages (psa-*) require libcurl v2, which is not in FC3. By far the best solution is to remove these packages, and start over. I only had to remove psa and php, which you will install later.
Once you've removed all the offending packages (with yum remove <packagename> by the way) and have gotten yum to upgrade you;re ready to set the kernel to the new version. To do this edit /boot/grub/grub.conf and set the value of default to the position in the list that 2.6.9 is at (the list starts from 0)
You're now ready to reboot into FC3! Do so with reboot
FC3 to FC4
Now you want to upgrade to FC4. Pretty much the same procedure as before, but easier because you're now using a better yum.
rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/fedora-release-4-2.noarch.rpm yum -y update kernel
It's a good idea to remove any stale kernels at this stage
yum remove kernel-2.6.\*FC3\*
Now do the upgrade, and again just remove any offending packages which cause dependency failures
yum -y upgrade
Once you're updated check the /boot/grub/grub.conf file again, making sure the FC4 kernel is default, and reboot!
Congratulations! you're on FC4. But there still some stuff to do to get plesk back.
Reinstall Plesk
Find the version of plesk you want (make sure it's packaged for FC4) and grab the autoinstaller, make it executable, and execute it, and follow all the prompts.
wget http://download1.swsoft.com/Plesk/Plesk8.0/FedoraC4/psa_installer_v3.0.2_build060704.16_os_FedoraCore_4_i386 chmod +x psa_installer_v3.0.2_build060704.16_os_FedoraCore_4_i386 ./psa_installer_v3.0.2_build060704.16_os_FedoraCore_4_i386
After a while you will have plesk back!
Firstly, the default firewall for FC4 won't allow access to the plesk admin server on port 8443. So you should either add some rules to iptables to allow this, or disable it with chkconfig --del iptables. Disabling it is fine, as Plesk comes with a firewall.
Now, check that no php4 cruft is hanging about in /etc/php.ini. I just replaced it with the rpm distro one.
Check your webmail and admin interface. Hopefully, it will all be there, and you won't have to restore from backup. But you'll probably find that plesk is running in 'Demo' mode.
At this stage I had to reinstall my license key for plesk, which I got from my reseller. You can apparently reinstall the license key by restoring from the plesk backup.
Which brings me to the heart stopping moment...
Restoring the Plesk Backup
I was pretty sure everything was still there, but I thought that restoring from the backup was prudent. First you must create a 'map' file of your current system, without the 'map' your backup is useless - you're spannered. Here goes...
$ /usr/local/psa/bin/pleskrestore --create-map my_plesk_backup -map backup.map ERROR: PleskException Can not start supervisor /root/restore: Traceback (most recent call last): ... ImportError: Bad magic number in /usr/local/psa/admin/lib/python/libxml2.pyc ---
D'oh!
Much fun ensued b/n me, my host company, and eventually SwSoft. SwSoft said it was a known issue, but was fixed in Plesk 8.01, but it wasn't. It was established that I did have the latest version. Eventually the plesk version of the libxml2.pyc library simply had to be removed and recompiled as follows.
rm /usr/local/psa/admin/lib/python/libxml2.pyc /usr/local/psa/admin/sbin/supervisor
Throughout all this our host company Idaq were extremely good (especially at not blaming me). SwSoft were also quick to acknowledge and diagnose the problem. But I did have to laugh at the closing statement of SwSoft.
"I contacted our developers regarding the issue and they surmised that it was a hardware problem during first compilation of libxml2.pyc, so the file was created with error."
Hmmm, spooky. I think they might need a copy of tarot.
Sorry, comments are closed for this article.