Migrating to Symfony 4 & Flex

Migrating to Symfony 4 & Flex

A quick walkthrough of the major steps to take when migrating your existing Symfony 2/3 application to Symfony 4 using the Flex directory structure.

6a1345d8e6dd15b2c78eff0c331963b1?s=128

Denis Brumann

July 03, 2018
Tweet

Transcript

  1. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de Migrating to Symfony 4 1 from

    Symfony 2 & 3
  2. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 2

  3. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 3

  4. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 4 Denis Brumann Software Developer Berlin,

    Germany
  5. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 5 https://symfony.com/doc/current/contributing/community/releases.html

  6. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 6 https://symfony.com/roadmap Symfony Version End of

    Support End Of Security Fixes 2.8 (LTS) November 2018 November 2019 3.4 (LTS) November 2020 November 2021 4.0 July 2018 January 2019
  7. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 7 Flex is not your only

    option
  8. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 8 composer update symfony/symfony

  9. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 9

  10. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 10 https://symfony.com/blog/new-in-symfony-3-3-persisted-deprecation-logs

  11. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 11 Step 1: Add symfony/flex as

    a dependency from Symfony 3.4
  12. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 12 Step 2: Remove the symfony/symfony

    package
  13. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 13 Step 3: Make sure symfony/symfony

    is not kept
  14. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 14 optionally: stay with Symfony 3.4

    first
  15. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 15 Step 4: Manually require your

    Symfony dependencies
  16. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 16 Step 5: Copy & adjust

    your configuration
  17. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 17 Symfony 3 Symfony 4

  18. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 17 Symfony 3 Symfony 4

  19. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 19

  20. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 19

  21. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 19

  22. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 19

  23. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 19

  24. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 20 Step 6a: Move src/AppBundle/* to

    src/* Step 6b: Move namespace AppBundle\ to App\ Step 6c: Update autoload-section in composer.json
  25. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 21

  26. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 22 composer require acme/my-bundle

  27. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 23 { "require": { "acme/my-bundle": "dev-master"

    }, "repositories": [ { "type": "vcs", "url": "git@bitbucket.org:acme/my-bundle.git" } ] }
  28. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 24 Step 7: Move templates, translations

    & assets
  29. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 25 Step 8: Create public/index.php

  30. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 26 Step 9: Create bin/console

  31. Denis Brumann
 @dbrumann
 denis.brumann@sensiolabs.de 27 https://symfony.com/doc/current/setup/flex.html#upgrade-to-flex https://symfony.com/doc/current/setup/upgrade_major.html