Created
April 18, 2017 17:40
-
-
Save ProcessEight/bf1890f2c5af69583d6b30c7425b9781 to your computer and use it in GitHub Desktop.
Install Magento 1 with sample data through Composer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Install Magento sample data from pre-existing archive | |
# Just find and replace version number | |
# Run this from the projectroot of the vhost (usually folder with www and logs in it) | |
# | |
# What it does: | |
# | |
# 1. Copy media folder into current folder | |
# 2. Copy skin folder into current folder | |
# 3. Copy local.xml into app/etc ready for editing | |
DBNAME = 'mageattributescript' | |
VHOSTNAME = 'mdcmk92-payment-method-surcharge' | |
echo "{ | |
"name": "sfrost2004/magento", | |
"description": "Magento Community 1.9.3.1", | |
"extra": { | |
"magento-root-dir": "www" | |
}, | |
"require": { | |
"magento-hackathon/magento-composer-installer": "~3.0", | |
"aydin-hassan/magento-core-composer-installer": "~1.2", | |
"firegento/magento": "~1.9.3.1" | |
} | |
}" > composer.json | |
composer install | |
cd www | |
echo "Enter MySQL password to create database" | |
mysql -u root -p -e "create database $DBNAME" | |
echo "Enter MySQL password to import sample data database" | |
mysql -u root -p $DBNAME < ../../magento-resources/extras/sample-data/magento-sample-data-1.9.2.4/magento-sample-data-1.9.2.4/magento_sample_data_for_1.9.2.4.sql | |
echo "Copying media folder from sample data" | |
cp -rf ../../magento-resources/extras/sample-data/magento-sample-data-1.9.2.4/magento-sample-data-1.9.2.4/media/ media/ | |
echo "Copying skin folder from sample data" | |
cp -rf ../../magento-resources/extras/sample-data/magento-sample-data-1.9.2.4/magento-sample-data-1.9.2.4/skin/ skin/ | |
echo "Copying app/etc/local.xml" | |
cp -f ../../magento1931.local/www/app/etc/local.xml app/etc/ && nano app/etc/local.xml | |
echo "Creating new vhost" | |
sudo cp -f /opt/local/apache2/conf/extra/httpd-vhosts-magento-tdd-local.conf /opt/local/apache2/conf/extra/httpd-vhosts-mdcmk71-add-tags-to-catalog-search-indexer-local.conf | |
sudo chown simonfrost:admin /opt/local/apache2/conf/extra/httpd-vhosts-mdcmk71-add-tags-to-catalog-search-indexer-local.conf | |
sudo nano /opt/local/apache2/conf/extra/httpd-vhosts-mdcmk71-add-tags-to-catalog-search-indexer-local.conf | |
sudo nano /opt/local/apache2/conf/httpd.conf | |
sudo nano /etc/hosts | |
sudo service nginx restart | |
echo "Creating new admin user" | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar admin:user:create | |
echo "Setting locale options" | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar config:set 'general/country/default' 'GB' | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar config:set 'general/locale/timezone' 'Europe/London' | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar config:set 'general/locale/code' 'en_GB' | |
echo "Setting currency options" | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar config:set 'currency/options/base' 'GBP' | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar config:set 'currency/options/default' 'GBP' | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar config:set 'currency/options/allow' 'GBP' | |
/Users/simonfrost/PhpStormProjects/n98-magerun.phar cache:flush | |
curl -I http://$DBNAME.local/ | |
echo "Magento 1 is ready to go" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment