Migrating ~200 accounts BUT different OS + versions of PHP, MySQL, WHM etc

timuk

Member
Aug 27, 2013
6
0
1
cPanel Access Level
Root Administrator
Hi folks, I was just wondering which approach you recommend with regards to migration from my existing server to a new one (with a different provider). I use cPanel so the migration tool should simplify the process greatly, but in terms of DNS etc which do you recommend and why:

(a) Setting up new nameservers and server hostname for the new server, migrating accounts using WHM then asking customers to update their nameservers or;

(b) Migrate all accounts using WHM, keep the hostname the same as existing server and then point the existing nameservers to the new server IP address so customers don't have to take action and the migration appears seamless

Also, the current server is running outdated software -> FEDORA 2 i686 (now EOL), PHP v5.2.17, MySQL 5.1.63, Apache v1.3.42 and WHM 11.30.8. The new server will be running CentOS 6 64-bit and assumedly latest versions of PHP (PHP v5.4), MySQL, Apache & cPanel/WHM etc.

I want to avoid any disruption or breaking of customer websites when their sites are migrated to the new server and they're running on the latest software. What do you suggest?

E.g. with MySQL is there an upgrade script or something I can run once things have migrated across? Or will migrating the sites using the WHM tool mean as the databases are being imported into a newer version that they'll be upgraded automatically? Or should I really do a MySQL upgrade before migrating? (but this is risky as could corrupt existing sites and only delays things due to the notice that would have to be given etc)

Many thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

Personally, I recommend the second option (b) that you referenced. This way, you can keep the same name servers and they do not have to be modified for every domain name. I recommend alerting your customers of the new versions of Apache/PHP/MySQL so they can update their scripts if necessary. You can also pay close attention to the Apache error log after the migration and address issues as they come up. You could upgrade MySQL before the migration, but this could be a problem because an Apache/PHP update is required after changing a major version of MySQL. Typically, the databases are migrated without issue when using the cPanel transfer tools. Any database issues will likely stem from a script's incompatibility with the newer version of MySQL.

Thank you.
 

timuk

Member
Aug 27, 2013
6
0
1
cPanel Access Level
Root Administrator
Thanks for your reply Michael. I agree that option B is almost certainly the best approach as then I'm not relying on customers to change their DNS settings etc.

How likely do you think new versions of PHP, MySQL and Apache (and I suppose WHM) are likely to affect the accounts?
I suppose there could also be limitations on customers upgrading now as their software may say they need to be running PHP 5.3 or later for example.

So you recommend (a) asking customers to upgrade - most likely they won't take notice! (b) migrating as-is using the WHM tool, despite the new software versions and hoping for the best?

Worried about old installs of SMF, Joomla and WordPress. Can upgrades to sites be done AFTER once they're on the new server or is it too late?

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
You could always run EasyApache on the destination server and utilize an earlier version of PHP. For instance, PHP 5.2 will be available in EasyApache until the end of 2013. Thus, you could migrate the accounts over, and then make sure everything else is working as expected before upgrading PHP. Your customers can upgrade their scripts after the migration, yes.

Thank you.
 

timuk

Member
Aug 27, 2013
6
0
1
cPanel Access Level
Root Administrator
Hi all, thanks for your replies - really helpful and definitely gives me a lot to think about. Very difficult to get this right due to the need to successfully migrate all data to new/upgraded versions of software.

I've been doing some testing of migrating a few accounts and am seeing some errors and broken scripts (especially switching from PHP 5.2 to later versions). E.g. "Function split() is deprecated in" and "Fatal error: Incompatible file format: The encoded file has format major ID 3, whereas the Loader expects 5 in"

I appreciate sooner or later both myself and customers will have to update software so it's compatible with the latest versions. However, I think we need to look into possible temporary workarounds.

My current server is running PHP v5.2.17, MySQL 5.1.63, Apache v1.3.42. I do not want to touch or upgrade anything on this server as everything is working as it should.

What I ideally want to do to guarantee compatibility is either:
(a) downgrade to these older/EOL versions on the newly purchased server and then migrate all the data to the new server, check everything works, then upgrade. At least if it fails I can rebuild the server, migrate from the old server again and re-try

(b) Preferably, is it possible to keep the latest versions of PHP & MySQL installed that come with the server BUT have PHP 5.2 (and if possible MySQL 5.1) running alongside? I've done this in the past (with PHP4 and PHP5) and then the client can specify by inserting a line into their .htaccess file as to which version of PHP they wish to use. Can this be done? This will at least guarantee compatibility and give customers time to upgrade

Will either of these approaches work? Any tips, guidance, suggestions? Thanks as ever.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
The first approach (A) is the best option if you want to avoid installing third-party applications. MySQL version 5.1 should be installed by default on the new server. You can select the versions of Apache/PHP that most closely resemble the source server via EasyApache on the new server. You will only be able to install multiple PHP 5 versions alongside each other if you use a third-party application such as the PHP Selector feature in Cloud Linux:

Cloud Linux - PHP Selector

Thank you.
 

timuk

Member
Aug 27, 2013
6
0
1
cPanel Access Level
Root Administrator
Hi Michael, just to update you... on the new server there was PHP 5.4 and MySQL 5.5 pre-installed. I migrated a few sites but received various PHP-related errors implying incompatibility so used EasyApache to downgrade to PHP 5.2 as you suggested. This worked and brought those sites back online.

I haven't found a way to downgrade MySQL to 5.1. Any ideas? Or should I keep the current version? The majority of databases and sites *seem* to have transferred fine (I haven't run any sort of upgrade script or conversion on the databases - do I need to? if so, how?) but I've just run into one site that wasn't working and a repair in phpMyAdmin shows the tables not compatible and something about innoDB :\ so I'm not sure what to do about this site to convert it so it's compatible with the latest database format.

CloudLinux PHP Selector looks very interesting, will research further thanks. Is it an addon/plugin that can be installed easily on CentOS and integrated with cPanel?

Few issues have cropped up along the way at different times, all of which I think I've now sorted *fingers crossed* e.g. "MySQL wont start - PID error", "innodb unable to lock ibdata1 error 11", "/usr/bin/mysqladmin: connect to server at 'localhost' failederror: 'Access denied for user 'root'@'localhost' (using password: YES)'The mysql server is offline.", "DBD::mysql::st execute failed: Can't open file: './mysql/user.frm' (errno: 24) at /usr/local/cpanel/Cpanel/Mysql.pm line 1072", "ERROR 1016 (HY000) at line 1: Can't open file: './mysql/user.frm' (errno: 24) ERROR 1016 (HY000) at line 2: Can't open file: './mysql/user.frm' (errno: 24) ERROR 1016 (HY000) at line 3: Can't open file: './mysql/user.frm' (errno: 24) ERROR 1016 (HY000) at line 4: Can't open file: './mysql/user.frm' (errno: 24) "
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
1. Downgrading MySQL is generally not a good idea. I recommend keeping MySQL version 5.5 installed and addressing any issues that arise. What is the specific error message you are receiving related to InnoDB for that account?

2. You can find more information on Cloud Linux at:

cPanel - Cloud Linux

Than you.
 

timuk

Member
Aug 27, 2013
6
0
1
cPanel Access Level
Root Administrator
It looks as though it's Joomla related (judging by the accounts affected). I've just run mysqlcheck --all-databases --check-upgrade --auto-repair to no avail and the accounts affected all have the same output, as follows:

user_vO3en7U.w04hl_finder_tokens
note : The storage engine for the table doesn't support check
user_vO3en7U.w04hl_finder_tokens_aggregate
note : The storage engine for the table doesn't support check
 

timuk

Member
Aug 27, 2013
6
0
1
cPanel Access Level
Root Administrator
The company I'm thinking of moving servers to runs Virtuozzo as their VPS platform - I'm gutted to find out that CloudLinux isn't compatible with Virtuozzo:

Q: Can cPanel® with CloudLinux work within Virtual Machines?
A: cPanel with CloudLinux is fully compatible with hypervisor based virtualization, but container level virtualization (like Virtuozzo, OpenVZ, vserver) is not supported at this time.
Can you think of any alternative compatible packages that allow me to run multiple versions of PHP on the same server? Not fussed about the account limiting and isolation as such, the key feature is the multiple versions of PHP. Failing that, any ideas how I can run PHP 5.2.17 and 5.4 together on the same server? (even if files have to have a different extension or a line needs to be put in .htaccess etc). Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
1. What errors do you see in the MySQL error log (/var/lib/mysql/$hostname.err) when this happens with your PHP scripts?

2. I am not aware of any other third-party applications that allow for multiple versions of PHP 5. There is an open feature request for this at:

Multiple PHP 5 Versions

Thank you.