Skip to content

Instantly share code, notes, and snippets.

@rafaelstz
Last active May 1, 2024 20:22
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save rafaelstz/a16b66f722f0786d6730 to your computer and use it in GitHub Desktop.
Save rafaelstz/a16b66f722f0786d6730 to your computer and use it in GitHub Desktop.
Install Magento 1.9 (With Sample Data)
  
  ## Magento 1 + SampleData
  
  sudo apt-get update && \
  sudo apt-get install -y git wget unzip
  
  git clone https://github.com/OpenMage/magento-mirror.git ./ ;

  wget https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-magento-sample-data-1.9.1.0.tgz ;
  
  tar -xf compressed-magento-sample-data-1.9.1.0.tgz ;
  
  cp -rv magento-sample-data-1.9.1.0/* ./ ; 
 
  rm -rf magento-sample-data-1.9.1.0/ ;
  
  ## Translate pt_BR
  
  wget http://mariosam.com.br/wp-content/uploads/2013/02/Traducao_Magento_ptBR_19xx_MarioSAM_v12.zip ;

  unzip Traducao_Magento_ptBR_19xx_MarioSAM_v12.zip ;

  cp -rv Traducao_Magento_ptBR_19xx_MarioSAM/pt_BR app/locale/ ;

  cp -rv Traducao_Magento_ptBR_19xx_MarioSAM/rwd/ app/design/frontend/ ;

  rm -rf Traducao_Magento_ptBR_19xx_MarioSAM Traducao_Magento_ptBR_19xx_MarioSAM_v12.zip  ;
  
  ## Installing using n98-magerun tool
  
  n98 local-config:generate -q localhost root root magento files admin;
  
  n98 db:create ;
  
  n98 db:import --drop magento_sample_data_for_1.9.1.0.sql ;
  
  url=http://magento.test/
  
  n98 config:set "web/secure/base_url" $url ;

  n98 config:set "web/unsecure/base_url" $url ;
  
  n98 admin:user:create admin rafael@magento.com admin123 Rafael Gomes ;
  
  n98 customer:create rafael@magento.com admin123 Rafael Gomes -q ;
  
  n98 admin:notifications ;
  
  n98 design:demo-notice --off --global -q ;

  n98 config:set web/seo/use_rewrites 0 ;

  n98 cache:flush ;
  n98 index:reindex:all;
 
  chmod -R o+w media var ;
  
  chmod o+w app/etc ;
  
  find . -type d -exec chmod 775 '{}' \;
  
  find . -type f -exec chmod 644 '{}' \;
  
  chmod -Rv 777 app/etc var/ media/ ;
 
@itaymesh
Copy link

itaymesh commented Jan 3, 2017

Nice one.
Thanks a lot.

@vdshop
Copy link

vdshop commented Jan 9, 2017

Thank you sir

@zhavick
Copy link

zhavick commented Feb 7, 2017

Thank you very much

@jsmageto
Copy link

awesome

@fezanqadirbhatti
Copy link

What is n98? If it's a third party application then please document it in pre-requisites (install before you execute commands).

@fezanqadirbhatti
Copy link

I dislike the things that are not properly documented.

@albertobraschi
Copy link

da hora!

@victooooor
Copy link

What is n98?

@sigmawadbude
Copy link

what is n98

@mhhansen
Copy link

n98 is an alias for n98-magerun, which is this tool:
https://github.com/netz98/n98-magerun

@hudsonreis81
Copy link

I did install n98-magerun and run your gist. worked perfectly. Thank you so much! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment