How could I zip all my Magento files excluding non-required to a local setup?
I usually run this command to get all the files. But, it takes too long and the files are too heavy.
zip -r magento2.zip ./*
Do you have any suggestions to improve it?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
You can exclude the non-versioned folders and you can use -9 to compress all the files included in your ZIP.
zip -r -9 magento2.zip ./* \ -x "vendor/*" \ -x "generated/*" \ -x "pub/static/*" \ -x "pub/media/*" \ -x "var/*" \ -x "pub/wp/wp-content/uploads/*" \ -x "node_modules/*"
To compress your media folder too, I recommend using:
n98-magerun.phar media:dump media.zip
Generated CSS, JS and product image cache you can pass the option --strip