Successfully reported this slideshow.

Migrating from Magento 1 to Magento 2 @ Magento Meetup Wien

1

Share

Upcoming SlideShare
Outlook on Magento 2
Outlook on Magento 2
Loading in …3
×
1 of 64
1 of 64

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

Migrating from Magento 1 to Magento 2 @ Magento Meetup Wien

  1. 1. Migrating from Magento 1 to Magento 2 Matthias Zeis 21.09.2016
  2. 2. Vienna, Austria mzeis mzeis mzeis matthias-zeis.com
  3. 3. Who of you works with Magento 2?
  4. 4. Who of you is migrating stores to Magento 2?
  5. 5. https://twitter.com/mzeis/status/777113806573019136
  6. 6. SCENARIO Merchant wants to migrate from M1 to M2 © Rebecca Slegel
  7. 7. WHAT? WHEN? HOW?
  8. 8. DATA CODE THEME
  9. 9. Treat it like a platform switch because it is
  10. 10. MIGRATING DATA Core data 3rd party data Your data © Ron Cogswell
  11. 11. Official data migration tool magento/data-migration-tool
  12. 12. Does Products & categories Orders & Invoices Shipments & credit memos Core Configuration Customers Wishlists & Ratings
  13. 13. Does Doesn‘t Products & categories Orders & Invoices Shipments & credit memos Core Configuration Customers Catalog DB layout updates Web API credentials Wishlists & Ratings Admin users & privileges Media files Custom data 3rd party data
  14. 14. 1 Add repository composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool 2 Install tool composer require magento/data-migration-tool:<version> 3 Configure http://devdocs.magento.com/guides/v2.0/migration/migra tion-tool-configure.html
  15. 15. 1 Migrate settings php bin/magento migrate:settings /path/to/config.xml 2 Migrate data php bin/magento migrate:data /path/to/config.xml 3 Migrate delta php bin/magento migrate:delta /path/to/config.xml
  16. 16. Add mappings for custom tables and table columns COPY IGNORE RENAME TRANSFORM
  17. 17. A FEW LEARNINGS (a.k.a. what bit me)
  18. 18. Massive tool Team is working on it
  19. 19. Massive tool Team is working on it Schedule time
  20. 20. Clean up your data
  21. 21. Automate the process
  22. 22. Make tool run through first, then configure properly
  23. 23. Organise config files
  24. 24. Configure extension data migration manually
  25. 25. Test delta migration thoroughly
  26. 26. Alternatives ubertheme/module-ubdatamigration Alternative to official data migration tool firegento/FireGento_FastSimpleImport2 Wrapper for Magento 2 ImportExport functionality firegento/FireGento_ExtendedImport2 Extended features for Import (ported from AvS_FastSimpleImport)
  27. 27. MIGRATING CODE 3rd party code Your code © Peter Gronemann
  28. 28. 3rd party functionality
  29. 29. 3rd party functionality needed in new store?
  30. 30. 3rd party functionality DELETE needed in new store? missing in M2 core? no yes
  31. 31. 3rd party functionality DELETE needed in new store? missing in M2 core? USE M2 CORE continue with vendor? no no yes yes
  32. 32. 3rd party functionality DELETE needed in new store? missing in M2 core? USE M2 CORE continue with vendor? other 3rd party or custom? no no yes yes no
  33. 33. 3rd party functionality DELETE needed in new store? missing in M2 core? USE M2 CORE continue with vendor? other 3rd party or custom? OTHER 3RD PARTY DO IT YOURSELF no no 3rd party custom yes yes no
  34. 34. 3rd party functionality DELETE needed in new store? missing in M2 core? USE M2 CORE continue with vendor? other 3rd party or custom? M2 extension available? OTHER 3RD PARTY DO IT YOURSELF no no 3rd party custom yes yes yes no
  35. 35. 3rd party functionality DELETE needed in new store? missing in M2 core? USE M2 CORE continue with vendor? other 3rd party or custom? M2 extension available? OTHER 3RD PARTY DO IT YOURSELF USE M2 EXTENSION no no 3rd party custom yes yes yes yes no no
  36. 36. your M1 functionality
  37. 37. your M1 functionality needed in new store?
  38. 38. your M1 functionality DELETE needed in new store? missing in M2 core? no yes
  39. 39. your M1 functionality DELETE needed in new store? missing in M2 core? USE M2 CORE 3rd party or custom? no no yes yes
  40. 40. your M1 functionality DELETE needed in new store? missing in M2 core? USE M2 CORE 3rd party or custom? 3RD PARTY DO IT YOURSELF no no 3rd party custom yes yes
  41. 41. your M1 functionality DELETE needed in new store? missing in M2 core? USE M2 CORE 3rd party or custom? 3RD PARTY DO IT YOURSELF no no 3rd party custom yes yes REWRITE? MIGRATE?
  42. 42. rewrite extension automated testing document M1 behaviour platform independent code coding standards
  43. 43. rewrite extension automated testing document M1 behaviour platform independent code coding standards Awesome integer_net article series: https://www.integer-net.com/magento- 1-magento-2-shared-code-extensions/
  44. 44. migrate extension clean M1 code document M1 behaviour platform independent code refactor
  45. 45. Official code migration tool magento/code-migration
  46. 46. Does Namespaces Configuration XML files Layout XML files Magento code interaction Module directory structure
  47. 47. Does Doesn‘t Namespaces Configuration XML files Layout XML files Magento code interaction Module directory structure Template files & design Changes in business logic
  48. 48. 1 Get code git clone https://github.com/magento/code-migration 2 Install tool composer install
  49. 49. <src> Code to be migrated (excluding core) Prerequisites <m1> M1 project code including vanilla core <m2> M2 vanilla core <dst> Empty directory for generated code
  50. 50. 1 Migrate directory structure php bin/migrate.php migrateModuleStructure <src> <dst> 2 Migrate layout php bin/migrate.php convertLayout <dst> 3 Migrate configuration php bin/migrate.php convertConfig <dst> 4 Migrate PHP code php bin/migrate.php convertPhpCode <dst> <m1> <m2>
  51. 51. Don‘t get confused with directories
  52. 52. USE OUT OF THE BOX MAPPING Is your Magento 1 version current? noyes GENERATE YOUR OWN MAPPING
  53. 53. 1 php bin/utils.php generateClassDependency <m1> 2 php bin/utils.php generateClassMapping <m1> <m2> 3 php bin/utils.php generateModuleMapping <m1> <m2> 4 php bin/utils.php generateTableNamesMapping <m1> 5 php bin/utils.php generateViewMapping <m1> <m2> 6 php bin/migrate.php generateAliasMapping <m1> <m2> 7 php bin/migrate.php generateAliasMappingEE <m1> <m2>
  54. 54. Generating mappings yourself can be tricky
  55. 55. Double-check what was (not) converted
  56. 56. 1 Be pragmatic 2 Work together 3 Learn together
  57. 57. Sergii Shymko @ Imagine 2016: Code Migration Tool Presentation & Slides Noelle Darlington @ Imagine 2016: Migration from M1 to M2 Presentation Resources
  58. 58. Official data migration guide http://devdocs.magento.com/guides/v2.0/migration/bk- migration-guide.html Data migration experience by Marcin Szterling (English, Youtube) Marcin Szterling - Data Migration from Magento 1 to Magento 2 Resources
  59. 59. Data migration experience by Sven Wappler (German) https://www.wapplersystems.de/blog/slides-zum-vortrag- magento-002-migriere-an-einem-anderen-tag-sind-online/ Data migration experience by Eugen Bogdanovich (English) http://oyenetwork.com/articles/data-migration-to-magento2- case-study/ Resources
  60. 60. Matthias Zeis mzeis mzeis mzeis matthias-zeis.com Thank you! Questions?
  61. 61. Matthias Zeis mzeis mzeis mzeis matthias-zeis.com Thank you! Questions? Slides will be online: http://www.slideshare.net/mzeis/
  62. 62. Matthias Zeis mzeis mzeis mzeis matthias-zeis.com Thank you! Questions? Slides will be online: http://www.slideshare.net/mzeis/ LimeSoda is hiring! https://www.limesoda.com/jobs/

Editor's Notes

  • Can‘t talk about everything today
  • it's not a simple update
    You don‘t get Magento 2 with the click of a button or a few commands
    It‘s a process which involves a lot of manual work.
    Use it as a chance for a make-over [Next]
  • Add repository
    Magento 2 installation needed, but not Magento 1
    Data migration tool release per Magento version (last version: 2.1.1, released beginning of September)

    Install tool
    Installation: composer require from Github or repo.magento.com
    Symfony Console
    Monolog

    Configure
    XML Files
    Credentials for M1 and M2 databases



  • * Custom = your extensions, 3rd party extensions

    Tables
    * copy
    * ignore
    * rename

    Columns
    * copy
    * ignore
    * rename
    * transform value => handlers can be defined (null handler, custom handler, …)
  • but it has issues – reserve time!

    As with every integration project: get real data as soon as possible
  • Ensure data integrity
    Remove un-needed entries
  • Create database backup after install (it's easy to introduce foreign key errors in target database; tool expects fresh database)
    Script steps for execution and reset
  • First „collect“ all errors (ignore documents / fields, rename to „“) and when the script runs through think what you make out of that information
  • You can have your files anywhere in the file system:
    Version them in your own repository outside of the migration tool directory structure for better overview and easier re-use
    You can divide config files further, for example for the different calls
  • Although you use a M2 installation, at the moment there is no way for your migrated M2 community extensions to specify mappings in own files – you have to define mappings manually for extensions for every project
  • Is said to be not working perfectly at the moment
  • Ubertheme
    Pro: easy to use, little configuration, does the job for standard data, supports delta
    Con: slow, hard to rewrite, not secured
  • Go through the list of extensions and make basic decisions for every module
  • 3rd party code: Marketplace
  • Second, decide on your homegrown modules
  • if you do the extension yourself: do you want to migrate the extension or rewrite it from scratch?
  • If you rewrite the extension from scratch:
    Try to use automated testing – base is better
    Follow official coding standards
    Document behaviour as it was in M1 so you know what should work how afterwards
    Maybe write platform independent code
  • If you want migrate the extension:
    Make sure you followed the coding standards in Magento 1, otherwise you may want to refactor the extension before migrating
    Good if you have files in separate directory like you have with modman or Composer
    Of course, also any kind of automated testing helps too
    Also here:
    document M1 behaviour
    think about writing platform independent code: (even more so if you have to develop new stuff before migrating)
  • It has a good documentation!
  • A few things that I learned here: [next]
  • Installation: you could also do composer require, but there are no official versions yet (current: "0.0.1-alpha")
    Symfony Console
    Monolog
    No Magento 1 or Magento 2 installation needed


  • <src>: Good for you if you extracted your code into Composer modules or the like

    Bring your code in order before doing the migration! See Sergii Shymkos presentation: remove unused modules, revert core modifications. Also interesting: remove core bugfixes irrelevant to M2
  • Mapping files make code migration possible

    Out of the box: newest M1 version to M2
    Generated by you: your M1 version to M2
  • Obey the order!
  • May generate warnings
    generateModuleMapping: exception with EE
    If you use <m1>, then mappings for third-party tools etc. may be added
  • convertConfig:
    config.xml is unchanged, so you have to find out yourself what has been moved and what not
    Bugs: convertConfig: system.xml type, show_in_store etc. not used

    convertPhpCode:
    Originale Dateien werden beibehalten, man kann vergleichen was gemacht worden ist
    Dependency information not migrated properly(?)
    Event observers not migrated properly(?)
  • be pragmatic.
    work together.
    find solutions together as you're both going to learn a lot about Magento 2 at this point of time

    To build a better shop!
  • Topics I didn‘t mention at all or not in detail:
    Theme migration
    Build & Deployment process
  • ×