Categories
Code

Upgrade Magento via SSH

Disclaimer: I’ve upgraded Magento CE 1 using this process with no issues many times. I can not confirm this process will work with Magento CE 2. As always, BACKUP EVERYTHING FIRST.

  1. Disable Cache
    Navigate to System > Cache Management and disable all.
  2. Turn on Maintenance Mode
    touch maintenance.flag
  3. Clear /var (need to replace htaccess file if you’re blocking access)
    rm -rf var
    mkdir var
  4. Backup Files & Database
  5. Start the Upgrade
    chmod -R 777 ./*
    chmod 550 ./mage
    ./mage mage-setup .
    ./mage config-set preferred_state stable
    ./mage list-installed
    ./mage list-upgrades
    ./mage upgrade-all
  6. Clean Up
    php shell/indexer.php reindexall
    See: https://magento.stackexchange.com/questions/68627/file-permissions-changed-after-applying-patch-403-forbidden-error
    rm -rf maintenance.flag
  7. Verify and Upgrade Database by Opening the Site

Don’t forget to re-anable cache management.

Categories
Code

Delete Error Logs

SSH commands to list and delete error logs.

  1. List error_log files.
    find . -name error_log
  2. Delete all error_log files.
    find . -name error_log -delete