A step by step guide to upgrade Magento

A step by step guide to upgrade Magento

Digital Help Desk (DHD) has received a lot of queries around the topic of ‘how to upgrade Magento‘ recently, so in response we created a ‘how to guide’ to help businesses streamline their upgrades and avoid common pitfalls.  With over a dozen Magento upgrades in the past year under our belt, we consider ourselves very experienced in this field.

 

Steps to Upgrade Magento:

1. Clone your website (make sure you block Google from indexing your staging site)

 

2. Set up your staging site with your desired Magento version (once it is installed, remember to remove index.phtml file otherwise it will not load index.php)

 

3. Connect the X.X.X.X (new version) local.xml to the X.X database (old version) by getting the database from old version app/etc/local.xml

 

4. In config.xml (for the new version) you will see a line containing “SET NAMES utf8” which needs to be replaced by a new line

i.e:

app/etc/config.xml

<!–<initStatements>SET NAMES utf8</initStatements> –>

<initStatements>SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;</initStatements>

 

5. Clean new version’s cache and load the back end until getting a “Time out” error, from here wait until the database has finished syncing.

You will notice this by running top or going directly to mysql: mysql -u root -p (pass: 32SvD5ozmsql) and then showing process list;

 

6. Change the redirection coming from you old website’s database in the table named “core_config_data”,”base_url field” (i.e link: http://192.34.60.150:8081/phpmyadmin/) and clean the cache.

 

7. If the front end is still being redirected, go to the back end and edit Config>General>Web >Base Url to change to the correct store scope. Also, change URLs to the correct ones.

 

8.  Bring /media/ directory over via SSH

i.e:

cd to /var/www/merca1702.magecolombia.com/web

then

rsync -avh ../../merca.magecolombia.com/web/media/ media/

“using ‘relative’ paths, not absolute paths”

 

9. Reindex “php shell/indexer.php –reindexall” otherwise you may get an error like this:

“Product Flat Data index process unknown error:

exception ‘PDOException’ with message ‘SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs’ in /var/www/clients/client2/web36/web/lib/Zend/Db/Statement/Pdo.php:228”

So, we need to override some core code, it’s a mysql limitation when you have too many attributes

run:

mkdir -p app/code/local/Mage/Eav/Model/Entity/Attribute/

then

cp app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php  app/code/local/Mage/Eav/Model/Entity/Attribute/

and

change Line 677

‘type’      => ‘varchar(255)’

to

‘type’      => ‘varchar(64)’

 

10. Clean the cache and reindex

 

 

 

Upgrade Magento through SSH:

1. Change to your Magento installation directory:

cd /home/username/public_html

 

2. Download Magento 1.7.0.2 from MagentoCommerce.com:

wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz

 

3. Extract the archive:

tar -zxvf magento-1.7.0.2.tar.gz

 

4. Sync files from new (~/magento) version to the old one (~/web)

rsync -avh magento/ ../web/

 

5. Clean cache

 

6. Try to load the back end, wait until you get a 504 error, check the server to check msql (top) and wait until it calms down.

 

From the team at DHD, good luck with your next Magento upgrade and we hope our guide can help you easily walk through the process.

Atena kouchaki
No Comments

Leave a Comment

Please wait...

SUBSCRIBE TO NEWSLETTER

Subscribe to our newsletter to receive exclusive offers and the latest news on our services.