Hi. I want to try some package locally and then upload to production. Which is the best way to install in production?
I was thinking to upload the entire vendor folder (and make a copy of production vendor directory, just in case).
Other way I read, like upload the composer.lock file and the run "composer install"... but my site is already on production, I don't know when to run the command without any bad surprises.
@drewdan Yes I have a staging server. My question is? When I run "composer install", do I have to delete de vendor directory first? Other issue is that sometimes I receive memory error, but I fixed applying some swap to the server. (aws micro instance).
The composer install command installs, upgrades or deletes as per what is in the composer.lock file. So you do not need to touch the vendor file, just run composer install, if you change a version number to one of the packages, and run composer install, only the one package will be updated and the rest will remain untouched. If you removed a package from the composer.lock file, and ran composer install, the package would be removed.
Composer.lock is like a snapshot of your packages at that example moment you first installed them, if you deleted your vendor folder, and ran composer install a month later and did not change the composer.lock file, composer would install the exact same packages at the exact same version as when you deleted the vendor folder.