When a client hires us to develop their website and it contains an ecommerce element, we typically take a close look at Magento. We like developing for Magento because it had an enormous amount of features and capabilities, and ends up with a much nicer result than what we have seen with many OScommerce and ZenCart solutions.
Recently, one of our development servers had a very old version of Magento on it, and before we could start development on a new extension for a client, we had to upgrade it.
This is the script that I use whenever I am upgrading Magento:
wget http://www.magentocommerce.com/downloads/assets/188.8.131.52/magento-184.108.40.206.tar.gz tar -zxvf magento-220.127.116.11.tar.gz cd magento tar cf - . |(cd ..; tar xvf -) chmod -R o+w media var chmod o+w app/etc rm -rf magento/ magento-18.104.22.168.tar.gz
Let’s take a look at what is happening here.
First, we download the next newest version of Magento (click the “Release Archives” tab) and untar it. While theoretically Magento will cleanly upgrade from any old version to any new version, I’ve had the best luck when I don’t skip versions.
wget http://www.magentocommerce.com/downloads/assets/22.214.171.124/magento-126.96.36.199.tar.gz tar -zxvf magento-188.8.131.52.tar.gz
Next, we do my favorite part. First go into the new magento directory, and then use tar to gather all of the files, retaining permissions and ownership information, and untar them into the root directory of the site.
cd magento tar cf - . |(cd ..; tar xvf -)
Then we just have to set the directories that have to have write access.
chmod -R o+w media var chmod o+w app/etc
And finally we cleanup the excess Magento directory and tar file.
rm -rf magento/ magento-184.108.40.206.tar.gz
After you have run this, visit the home page of the site to allow it to go through the database upgrade process. I’ve received errors while trying to upgrade the database in the past. Usually these can be solved by deleting the file mentioned in the error.
Then, just like shampoo, you’ll want to repeat the process, changing the version numbers on all three lines until your site is at the most current stable version.
I can’t guarantee that this will solve all of your upgrade woe’s, but I can tell you that this has helped me limit my woes to just those caused by deprecated code.