Project

General

Profile

Feature #701

Fix a Magento Install From The Command Line

Added by Daniel Curtis over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
11/27/2015
Due date:
% Done:

100%

Estimated time:
1.50 h
Spent time:

Description

I recently had to fix Magento after a hung update happened. After looking around online I found that Magento can be update directly from the command line. This is a guide for doing so.

  • Make sure sudo is installed:
    pkg install sudo
    
  • Make the mage script executable:
    chmod u+x /usr/local/www/sites/magento.example.com/mage
    
  • Change into the magento install directory:
    cd /usr/local/www/sites/magento.example.com
    
  • Set the maintenance.flag file:
    touch /usr/local/www/sites/magento.example.com/maintenance.flag
    
  • Show the list of installed Magento packages:
    sudo -u www sh /usr/local/www/sites/magento.example.com/mage list-installed
    
  • Upgrade any other packages:
    sudo -u www sh /usr/local/www/sites/magento.example.com/mage upgrade-all --force
    
  • Force the reinstallation of the Mage_All_Latest package:
    sudo -u www sh /usr/local/www/sites/magento.example.com/mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
    
  • Reindex everything:
    php shell/indexer.php reindexall
    
  • Set the correct permissions:
    chmod -R 644 /usr/local/www/sites/magento.example.com/*
    find /usr/local/www/sites/magento.example.com -type d -exec chmod 755 {} \;
    chmod 550 /usr/local/www/sites/magento.example.com/mage
    
  • Flush all cache and sessions:
    rm -rf /usr/local/www/sites/magento.example.com/var/{cache,session}/*
    
    • NOTE: For some reason I also needed to remove the old pkginfo/Mage_All_Latest.txt directory:
      rm -rf /usr/local/www/sites/magento.example.com/pkginfo/Mage_All_Latest.txt
      
  • Remove the maintenance.flag file:
    rm /usr/local/www/sites/magento.example.com/maintenance.flag
    

Resources

#1

Updated by Daniel Curtis over 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
#2

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
#3

Updated by Daniel Curtis over 8 years ago

  • Project changed from GNU/Linux Administration to Website Hosting
  • Description updated (diff)
  • Category deleted (Web Server)
  • Status changed from In Progress to Resolved
  • Target version changed from *nix to Magento 1.9
  • % Done changed from 50 to 100
#4

Updated by Daniel Curtis about 8 years ago

  • Status changed from Resolved to Closed
#5

Updated by Daniel Curtis about 8 years ago

  • Description updated (diff)

Also available in: Atom PDF