Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Migrating from PHP 5.6 to PHP 7.2 with Magento

Migrating from PHP 5.6 to PHP 7.2 with Magento

In this presentation, which takes less than 30 minutes, we will discuss the approach I used to migrate a large Magento 1 project from PHP 5.6 to PHP 7.2, before the official compatibility provided by Magento, and what are the results.

Alexandre Jardin

June 27, 2019
Tweet

More Decks by Alexandre Jardin

Other Decks in Technology

Transcript

  1. SOME CONTEXT 1/2 ▪ Project started in 2011... with PHP

    5.3 ▪ More than 30 contributors 2 ▪ Code to migrate: ▫ ~ 11.500 classes ▫ ~ 1.900 templates
  2. SOME CONTEXT 2/2 ▪ By the end of 2017, we

    were still on PHP 5.5 ▪ Unable to upgrade the legacy infrastructure… ▪ … even if the code is compatible with PHP 5.6 3
  3. SUPPORTED/UNSUPPORTED VERSIONS OF PHP * Release date Active support date

    Security support date PHP 5.5 20 Jun 2013 20 Jun 2015 21 Jul 2016 PHP 5.6 28 Aug 2014 28 Aug 2016 31 Dec 2018 PHP 7.0 3 Dec 2015 3 Dec 2017 10 Jan 2019 PHP 7.1 1 Dec 2016 1 Dec 2018 1 Dec 2019 PHP 7.2 30 Nov 2017 30 Nov 2019 30 Nov 2020 6 * By the time we were working on the migration.
  4. PHP 7 COMPATIBILITY CHECKER (php7cc) “php7cc is a command line

    tool designed to make migration from PHP 5.3-5.6 to PHP 7 easier.” - Looks promising, but it’s no longer supported… 12
  5. PHP STATIC ANALYSIS TOOL (phpstan) “PHPStan focuses on finding errors

    in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.” - Nice! Let's give a try... 13
  6. 25 GENERATE PATCHES Use Git or your IDE to generate

    a patch from your local changes. PhpStorm documentation
  7. “ Remember that even if all automated tests are green,

    the application will have to be tested intensively. 28