as web designers we had a good year 2011 with more than 50 (different) cms & other php 5.2 driven applications. Some had customizations to core as well.
How does someone upgrade such amount of apps to php 5.3?
Do developers of php ever thought about that?
Much (popular) functions are just depreciated causing a lot of work to people like us.
I really don’t know how to best proceed
The short answer
It depends.
The strategy for migration would be influenced by the quality and content of the source itself, as well as the architecture and workflow. There is no “silver bullet” to make it work.
Longer answer
How it should be done
You automatically upgrade all the staging sites, run all the unit tests and if they all pass – run the acceptance tests. Fix the issues that arise till you can pass all the tests. Then let your QA people make sure that everything is really 100% OK. This whole process would mostly run by your continuous integration system/framework.
When all works on the staging environment, you take down each site for maintenance, deploy the updated code to the production environment, upgrade the server’s software, and bring the sites back up.
How you will (most likely) HAVE to do it
Since none of your software has any unit/acceptance tests, no up-to-date specification, or even notion of continuous integration system, you will have to do it the hard way:
This is kinda the “brief” version. Basically you will have to go server-by-server, clone it locally, then upgrade, patch projects. Then upgrade each server and put the patched version on. And hope.
Should you upgrade ?
Since you have ~50 different projects, you would have to investigate if it’s even worth the time and money. After such analysis you might discover that it would make more sense for a business to mark most of the projects as “legacy” and just upgrade server(s) to latest 5.2.x. Then leave it alone.
Of course even if you decide to not upgrade most of the projects, there will be some that will require it. Particularly project with ongoing contracts, which generate a steady stream of income for the company.
I would recommend to start upgrading those cash-cow projects, because you will have to anyway. And then from this experience you can calculate the costs for the rest of your “portfolio”.
What about next time ?
PHP 5.4 is out (at the time of last edit, 5.5 is already coming). Most companies by the end of this year will be faced with a question: “Is it time to start using 5.4 ?”. Some sooner, some a bit later. The frameworks and CMSs, that you use, too have a tendency to get updates.
Bottom line: your company as whole should start to investigate ways to streamline this process.
And what about when you upgrade to PHP 5.5 and
mysql_*functions start showingE_DEPRECATEwarnings? See the red box inmysql_affected_rows()documentation. This is not a one-time thing.It might be wise to invest in implementing better deployment strategy (something that involves unit-tests and continuous integration).
<rant>The functions and functionality, that has been deprecated, has been marked as such in documentation for ages. For example, the notice, that
ereg()and passing object by reference should not be used, has been there since I began learning PHP. The deprecation warnings would affect mostly PHP4 codebase (in which case, your question is a bit disingenuous).I do not see how enforcing practices, which have been accepted in the community for years, is “causing a lot of work”.
</rant>