I have created a custom module in magento and now I want to move the custom module in magento 2. I read few articles and also the magento2 custom module creation but i am getting confused from where to start. Since the syntax of magento2 is different from magento Controller Action functions are separate in magento2 so do i have to create separate php file for every action function of a controller in magento


It depends on the complexity of your module.

The most important thing is to separate your business logic from your mage1 module. The "pure php" part of that module can be easily ported to your mage2 module.

Then start by creating a skeleton of the module from zero in mage2. As you've seen, the structure is completely different: config files, how you declare your routers, how you interact with the db etc.

When you have your mage2 skeleton, start copying your business logic from mage1 making the necessary adjustments.

It is NOT an easy process and many chose to rewrite their modules from zero.

And yes in magento 2 you need different files for your action functions.

This may be an useful resource: http://www.developers-paradise.com/wp-content/uploads/2016/05/03-Fabian-Schmengler-Porting-a-complex-extension-to-Magento-2.pdf


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.