Skip to content

Instantly share code, notes, and snippets.

@victordit
Last active August 3, 2018 08:19
Show Gist options
  • Save victordit/482886068927dd57e9e7beb7d4ef9c9a to your computer and use it in GitHub Desktop.
Save victordit/482886068927dd57e9e7beb7d4ef9c9a to your computer and use it in GitHub Desktop.

Start Magento 1 project - dev enviroment

Requirements

See the requirements: http://devdocs.magento.com/guides/m1x/system-requirements.html

Install

For New install (new DB) via n98-magerun

n98-magerun.phar install --dbHost="localhost" --dbUser="USER" \ --dbPass="PASSWORD" --dbName="DBNAME" \ --installSampleData=yes --useDefaultConfigParams=yes \ --magentoVersionByName="magento-mirror-1.9.3.6" \ --installationFolder="PATH" --baseUrl="URL"

For New installation (new DB) via php-cli

php-cli -f install.php --
--license_agreement_accepted "yes"
--locale "en_US"
--timezone "America/Phoenix"
--default_currency "USD"
--db_host "DB_HOST"
--db_name "DB_NAME"
--db_user "DB_USER"
--db_pass "DB_PASS"
--url "SITE_URL"
--use_rewrites "yes"
--use_secure "no"
--secure_base_url ""
--use_secure_admin "no"
--admin_firstname "FIRST_NAME"
--admin_lastname "LAST_NAME"
--admin_email "EMAIL_ADDRESS"
--admin_username "USERNAME"
--admin_password "PASSWORD"

You do NOT chage these parameters: use_rewrites,use_secure,use_secure_admin

With and exists DB via php-cli

  • Dump the database of project from staging or production
  • Run following commmands with your parameters:

setting config.xml (change just the uppercase)

n98-magerun.phar local-config:generate DB_HOST DB_USER DB_PASS DB_NAME files admin

create database

n98-magerun.phar db:create

import dump sql (put absolute path of your file)

n98-magerun.phar db:import DB_DUMP.sql

setting yuor local url

  • n98-magerun.phar config:set web/secure/base_url URL
  • n98-magerun.phar config:set web/unsecure/base_url URL
  • n98-magerun.phar config:set admin/url/use_custom 0
  • n98-magerun.phar config:set admin/url/use_custom_path 0
  • n98-magerun.phar config:set web/cookie/cookie_domain DOMAIN

setting your admin password (you must know the username)

n98-magerun.phar admin:user:change-password USER PASSWORD

Setup dev enviroment

enable dev logs

n98-magerun.phar dev:log --global --on

disable Cache

n98-magerun.phar cache:disable

disable email

n98-magerun.phar config:set system/smtp/disable "1"

disabling Google Analytics

  • n98-magerun.phar config:delete --all google/analytics/account
  • n98-magerun.phar config:delete --all google/analytics/active
  • n98-magerun.phar config:delete --all google/analyticsplus/conversionenabled
  • n98-magerun.phar config:set google/analytics/active 0
  • n98-magerun.phar config:set google/analyticsplus/conversionenabled 0

cancel cache

n98-magerun.phar ca:cl

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