CakePHP 2 → 5
CakePHP Upgrade and Migration: from CakePHP 2 to CakePHP 5 or Symfony
CakePHP 2 reached end of life years ago and CakePHP 3 changed almost every API. We either take you to the current CakePHP release, or, if the team prefers a larger ecosystem, migrate the application to Symfony or Laravel step by step.
Typical blockers
What stops a CakePHP upgrade
- CakePHP 2 conventions: static
ClassRegistry, array-based models and$this->request->dataeverywhere - Magic naming instead of explicit dependencies, so tooling cannot follow what calls what
- The CakePHP 2 → 3 jump is a rewrite of the ORM, no upgrade shell covers it
- Plugins abandoned in the CakePHP 2 era with no CakePHP 4 or 5 versions
How we do it
Step by step, always mergeable
- Intro analysis: we count controllers, models and plugins and show you the cost of both paths, staying on CakePHP or migrating to Symfony or Laravel.
- Make the code explicit first: constructor injection, typed models and value objects, with Rector rules written for CakePHP conventions.
- Move one layer at a time, routing, then controllers, then the ORM, keeping the old and the new framework running side by side.
- Finish on a maintained framework with Rector and PHPStan in CI, so this is the last big migration your team pays for.
What the diff looks like
Every change is a reviewable diff, small enough to merge the same day.
-class OrdersController extends AppController
-{
- public $uses = array('Order', 'Customer');
-
- public function view($id = null)
- {
- $order = $this->Order->findById($id);
- $this->set('order', $order);
- }
-}
+final class OrdersController extends AbstractController
+{
+ public function __construct(
+ private readonly OrderRepository $orderRepository,
+ ) {
+ }
+
+ #[Route('/orders/{id}')]
+ public function view(int $id): Response
+ {
+ $order = $this->orderRepository->find($id);
+
+ return $this->render('orders/view.html.twig', ['order' => $order]);
+ }
+}
“I'm extremely pleased with the progress we are making.
It's really come a long way.”
William Adam Gleiss
VP of Technology at aRes Travel
Intro analysis
2 weeks, $6,000-8,000
Codebase measured, blockers listed, timeline and price for the whole upgrade in a PDF report.
Hands-on upgrade
$120 / hour
20-80 hours a week, in parallel to your team, every change delivered as a mergeable pull request.
Do it yourself
Open source
Browse Rector rules and read the documentation to run the upgrade with your own team.