0

What is the standard practice for porting Magento 1 extensions to Magento 2? Is there any official documentation or are there comprehensive guides I've overlooked?

Most guides only cover the basics: setup your directory in app/code/<company>/<module>, add registration.php, add etc/module.xml, then run the shell command php bin/magento set:upgrade.

What about the other directories, such as the Block, Controllers, Helper, and Model directories in Magento 1? What are they for? And some of them no longer exist in Magento 2, but now there are Setup, view and other directories there. What are the new ones for? What are the xml files in the etc directory and sub-directories for and what are their rules?

Before you link me to the Magento 2 devdocs, please ask yourself: do the following two pages answer any of the questions I pose?

https://devdocs.magento.com/videos/fundamentals/create-a-new-module/ https://devdocs.magento.com/videos/fundamentals/create-a-new-page/

1

Actually there is another question on stackexchange already relating to this: How I can migrate Magento 1.9.2 modules to Magento 2?

,but let me summarize what i think about this:

Well there is a lot of basic stuff which is also different in Magento2 modules. Mostly the best practices of code style updated nearly completly, to a better standard actually. This is maybe the main reason that there are nearly no good guides on how to migrate a magento1 module to a magento2 module.

But the best way you should go with is first of all, read into the documentation on how to create Magento2 modules. What the folders are for, and what the code standard of Magento2 is like.
F.e. Magento2 got also rid of the Mage - God class and uses dependency injection. Also Magento2 prefers Object composition over Class inheritance (https://devdocs.magento.com/guides/v2.3/ext-best-practices/extension-coding/common-programming-bp.html), while in Magento1 it was mostly the other way around...
You may do better to think about what your old module does and try to adapt the functionality in a new Magento2 module. No guide could tell you how to do that on a better way then the Magento2 documentation already does.

  • I appreciate your effort, but do you realize that none of those links or the links within those links answer any of my questions? I'm really struggling here. There seems to be a fundamental lack of documentation for Magento 2. – AlexanderGR Mar 11 at 23:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.