attiquer
6/28/2016 - 1:51 PM

Magento 2 composer installation & upgrade

Magento 2 composer installation & upgrade

1. composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <installation directory name>

2. Set Permissions, change ownership of files and chmod u+x bin/magento

3. issue following command (change credentials where applicable):
bin/magento setup:install \
--base-url=http://mage2.com \
--db-host=localhost \
--db-name=mage2 \
--db-user=root \
--db-password=mage7321 \
--backend-frontname=mageadmin \
--admin-firstname=Attique \
--admin-lastname=Rehman \
--admin-email=admin@admin.com \
--admin-user=attique \
--admin-password=mage7321 \
--language=en_US \
--currency=USD \
--timezone=Europe/London \
--use-rewrites=1

4. To install sample data, issue bin/magento sampledata:deploy
you might need to provide repo secure keys

5. Issue command bin/magento setup:upgrade

6. Reset permissions
chown -R user:group .
sudo find . -type d -exec chmod 770 {} \; && sudo find . -type f -exec chmod 660 {} \;
chmod u+x bin/magento

UPGRADE MAGE 2
composer require magento/product-community-edition 2.1.2 --no-update   (change versions accordingly)
composer update
rm -rf var/di var/generation
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex