Is it possible copy composer install modules of vendor from one project to another project magento 2 without composer commands.

If anyone having any idea please guide. I knew that it's not good practice but i don't have more ideas on it.

  • when we install module using composer, it added entry in composer.json and composer.lock. So you need to copy those entry as well. – Pawan Sep 10 '20 at 15:31
  • @Pawan, yes i copied entries in both composer.json, composer.lock and app/etc/config.php file but after upgrade it's removing entries from app/etc/config.php – Hitesh Balpande Sep 10 '20 at 15:35
  • upgrade means module upgrade or setup:upgrade ? – Pawan Sep 10 '20 at 15:36
  • yes setup:upgrade – Hitesh Balpande Sep 10 '20 at 15:37
  • what happens if you do not make entry in config.php and run setup:upgrade, it should automatic add entry in this. – Pawan Sep 10 '20 at 15:42

Just copy the contents of the composer.json file from the old project and to the new one. Then run

'composer install'

It will then install all dependancies into the vendor folder.

  • yes i did same but for me paid extension entry was not downloaded. so i removed that entry and did used 'composer install' command. – Hitesh Balpande Sep 11 '20 at 6:14
  • 1
    Why don't you move this paid module that won't install via composer from the vendor folder to the app/code folder of the new site? If you take a look at the etc/module.xml file you'll see the <module name="Namespace_Module"> xml node. You then match this in your folder structure. So it becomes app/code/Namespace/Module then the contents of the vendor folder for that module inside. – Luke Collymore Sep 11 '20 at 7:22

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.