Magento 2 can be quickly installed, deleted and reinstalled by the command line. This is very handy when migrating a website from Magento 1 to Magento 2, which can cause all sorts of database errors, until the migration tool runs without issue.
Magento 2 Installation Script
Your script to create a new Magento 2 install with admin user, will look very similar to the one below. This script is run from within the Magento directory folder (cd /fullserverpathtoMagento/www/magento2).
#install magento php bin/magento setup:install --backend-frontname=ADMINLINK --session-save=files --db-host=localhost --db-name=DATABASENAME --db-user=DATABASEUSER --db-password=DATABASEPASSWORD --base-url=URL --admin-user=ADMINUSER --admin-password=ADMINPASSWORD --admin-email=EMAILADDRESS --admin-firstname=John --admin-lastname=Smith --language=en_GB --currency=GBP --timezone=Europe/London
However most examples use the default US settings.
GB / UK Magento installation settings
To set the GB localised language, currency and time settings, you’ll need to use the below.
--language=en_GB --currency=GBP --timezone=Europe/London
Language, Currency & Time zone help commands
You can run the following commands to display a list of all available values.
Installer argument | Command |
---|---|
Language | magento info:language:list |
Currency | magento info:currency:list |
Time zone | magento info:timezone:list |
Hopefully that saves you time digging through the installation manual!
Really helpful article, just what I needed to know.
Thanks