In a previous post I documented how to quickly install Magento for a development environment (or a new Live shop I guess). With Magento Community Edition version 1.7.0.0 recently released lets look at upgrading from 1.6.x.x to 1.7.0.0 using the command line mage (formerly pear) utility.
BACKUP YOUR SYSTEM
Before you attempt any upgrades to your Magento systems, development, staging or live make sure you have everything backed up! Ideally do your testing in a virtual environment so you can easily revert to a system snapshot if there are problems with the upgrade.
Upgrading from 1.6.x to 1.7 should be fairly painless if you are using a standard theme and do not have too many third party extensions installed. Upgrading from earlier versions such as 1.4 might not be so straight forward and you should make sure you test the upgrade thoroughly. Earlier versions might require an upgrade path from 1.4 to 1.5 to 1.6 etc. which is not possible from the command line.
For my development 1.6 system I am fairly happy to let the upgrade run, I have backed up my database and installation folder and am ready to rock and roll.
Command line upgrade
From your magento installation folder i.e. /var/www/magento lets first reset our folder and file permissions to ensure they are correct for the installer.
find ./ -type f -exec chmod 0644 {} \;
find ./ -type d -exec chmod 0755 {} \;
Remove old session files
rm -rf var/cache/* var/session/*
make sure mage is executable
chmod 755 ./mage
Initialise mage
./mage mage-setup .
Run the upgrade
./mage upgrade-all
This may take a while to run as the various components are downloaded and installed. When complete remove unwanted packages.
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
Hello Magento v1.7.0.0
Login to your admin and check your cache status, refresh any caches as necessary. Check you are now running the correct version of Magento and perform the usual system checks, frontend registration, login, checkout etc.
Comments