This is how I upgrade thanks to SimpleHelix.com’s help plus some of my own stuff:
You will need a development site to upgrade correctly. In my case, I am using an Apple with MAMP installed running PHP 5.2.8.
Log in as an admin to the Magento production website
BACKUP DATABASE
Go to the System tab > Tools > Backups
In the top right click click the button “Backup”
This backs up the entire database
Download the file by clicking “gz” in the Download column on the same page
Unzip the file and install it to your development database. If you already had a development magento database, either create a new one or, dump the old one and have the development version of Magento use it. These setting can be changed in the app/etc/local.xml file.
BACKUP FILE STRUCTURE
Next backup all the files and folders in the production server folder. See the picture below for an example:
Next open a terminal window such “Terminal” or “PuTTY” and copy the newly downloaded files to folder where the development server is. Also make sure to copy the .htaccess files. e.g.
cp -pvr ./magento/* .
cp -pvr ./magento/.ht* .
Remove the following two directories: /var/cache and /var/session
rm -rf ./var/cache ./var/session
Test your development website,
If you get an saying it can’t connect check the app/etc/local.xml file
If it redirects to the production website, follow the two steps below:
Localhost Redirection to live production website
Delete the cache folder under /var
Enter to your local database, and search into the table core_config_data, for two keys, called: web/unsecure/base_url and web/secure/base_url and change them from the production server to the testing server.
If everything works, on both the frontend and the admin end, FTP the whole website back up to the production server. There is no need to update the database on the production server as it will update itself once the new files are accessed.
The attached PDF has better looking directions.
I had the following error after the upgrade. However, after hitting refresh and waiting a few more minutes, it worked itself out thanks to Magento’s code.
PDOException Object
(
[message:protected] => SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘0-1’ for key ‘UNQ_BY_CUSTOMER’
[string:private] =>
[code:protected] => 23000
[file:protected] => /Applications/MAMP/htdocs/lib/Zend/Db/Statement/Pdo.php
[line:protected] => 228
[trace:private] => Array
(
[0] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Zend/Db/Statement/Pdo.php
[line] => 228
[function] => execute
[class] => PDOStatement
[type] => ->
[args] => Array
(
[0] => Array
(
)
)
)
[1] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Varien/Db/Statement/Pdo/Mysql.php
[line] => 110
[function] => _execute
[class] => Zend_Db_Statement_Pdo
[type] => ->
[args] => Array
(
[0] => Array
(
)
)
)
[2] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Zend/Db/Statement.php
[line] => 300
[function] => _execute
[class] => Varien_Db_Statement_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] => Array
(
)
)
)
[3] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Zend/Db/Adapter/Abstract.php
[line] => 479
[function] => execute
[class] => Zend_Db_Statement
[type] => ->
[args] => Array
(
[0] => Array
(
)
)
)
[4] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php
[line] => 238
[function] => query
[class] => Zend_Db_Adapter_Abstract
[type] => ->
[args] => Array
(
[0] => ALTER TABLE `magentoreport_viewed_product_index` MODIFY COLUMN `customer_id` int UNSIGNED NOT NULL COMMENT ‘’
[1] => Array
(
)
)
)
[5] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line] => 389
[function] => query
[class] => Zend_Db_Adapter_Pdo_Abstract
[type] => ->
[args] => Array
(
[0] => ALTER TABLE `magentoreport_viewed_product_index` MODIFY COLUMN `customer_id` int UNSIGNED NOT NULL COMMENT ‘’
[1] => Array
(
)
)
)
[6] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line] => 327
[function] => query
[class] => Varien_Db_Adapter_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] => ALTER TABLE `magentoreport_viewed_product_index` MODIFY COLUMN `customer_id` int UNSIGNED NOT NULL COMMENT ‘’
)
)
[7] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line] => 924
[function] => raw_query
[class] => Varien_Db_Adapter_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] => ALTER TABLE `magentoreport_viewed_product_index` MODIFY COLUMN `customer_id` int UNSIGNED NOT NULL COMMENT ‘’
)
)
[8] => Array
(
[file] => /Applications/MAMP/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line] => 1110
[function] => modifyColumn
[class] => Varien_Db_Adapter_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] => magentoreport_viewed_product_index
[1] => customer_id
[2] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
)
)
)
[9] => Array
(
[file] => /Applications/MAMP/htdocs/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php
[line] => 1163
[function] => modifyTables
[class] => Varien_Db_Adapter_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] => Array
(
[magentocustomer_entity] => Array
(
[columns] => Array
(
[entity_id] => Array
(
[type] => integer
[identity] => 1
[unsigned] => 1
[nullable] =>
[primary] => 1
[comment] => Entity Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_set_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Set Id
)
[website_id] => Array
(
[type] => smallint
[unsigned] => 1
[comment] => Website Id
)
[email] => Array
(
[type] => text
[length] => 255
[comment] => Email
)
[group_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Group Id
)
[increment_id] => Array
(
[type] => text
[length] => 50
[comment] => Increment Id
)
[store_id] => Array
(
[type] => smallint
[unsigned] => 1
[default] => 0
[comment] => Store Id
)
[created_at] => Array
(
[type] => timestamp
[nullable] =>
[comment] => Created At
)
[updated_at] => Array
(
[type] => timestamp
[nullable] =>
[comment] => Updated At
)
[is_active] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 1
[comment] => Is Active
)
)
[comment] => Customer Entity
)
[magentocustomer_address_entity] => Array
(
[columns] => Array
(
[entity_id] => Array
(
[type] => integer
[identity] => 1
[unsigned] => 1
[nullable] =>
[primary] => 1
[comment] => Entity Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_set_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Set Id
)
[increment_id] => Array
(
[type] => text
[length] => 50
[comment] => Increment Id
)
[parent_id] => Array
(
[type] => integer
[unsigned] => 1
[comment] => Parent Id
)
[created_at] => Array
(
[type] => timestamp
[nullable] =>
[comment] => Created At
)
[updated_at] => Array
(
[type] => timestamp
[nullable] =>
[comment] => Updated At
)
[is_active] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 1
[comment] => Is Active
)
)
[comment] => Customer Address Entity
)
[magentocustomer_group] => Array
(
[columns] => Array
(
[customer_group_id] => Array
(
[type] => smallint
[identity] => 1
[unsigned] => 1
[nullable] =>
[primary] => 1
[comment] => Customer Group Id
)
[customer_group_code] => Array
(
[type] => text
[length] => 32
[nullable] =>
[comment] => Customer Group Code
)
[tax_class_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Tax Class Id
)
)
[comment] => Customer Group
)
[magentocustomer_eav_attribute] => Array
(
[columns] => Array
(
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[primary] => 1
[comment] => Attribute Id
)
[is_visible] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 1
[comment] => Is Visible
)
[input_filter] => Array
(
[type] => text
[length] => 255
[comment] => Input Filter
)
[multiline_count] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 1
[comment] => Multiline Count
)
[validate_rules] => Array
(
[type] => text
[length] => 64K
[comment] => Validate Rules
)
[is_system] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Is System
)
[sort_order] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Sort Order
)
[data_model] => Array
(
[type] => text
[length] => 255
[comment] => Data Model
)
)
[comment] => Customer Eav Attribute
)
[magentocustomer_eav_attribute_website] => Array
(
[columns] => Array
(
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[primary] => 1
[comment] => Attribute Id
)
[website_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[primary] => 1
[comment] => Website Id
)
[is_visible] => Array
(
[type] => smallint
[unsigned] => 1
[comment] => Is Visible
)
[is_required] => Array
(
[type] => smallint
[unsigned] => 1
[comment] => Is Required
)
[default_value] => Array
(
[type] => text
[length] => 64K
[comment] => Default Value
)
[multiline_count] => Array
(
[type] => smallint
[unsigned] => 1
[comment] => Multiline Count
)
)
[comment] => Customer Eav Attribute Website
)
[magentocustomer_form_attribute] => Array
(
[columns] => Array
(
[form_code] => Array
(
[type] => text
[length] => 32
[nullable] =>
[primary] => 1
[comment] => Form Code
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[primary] => 1
[comment] => Attribute Id
)
)
[comment] => Customer Form Attribute
)
[magentocustomer_address_entity_datetime] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => datetime
[nullable] =>
[default] => 0000-00-00 00:00:00
[comment] => Value
)
)
[comment] => Customer Address Entity Datetime
)
[magentocustomer_address_entity_decimal] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => decimal
[scale] => 4
[precision] => 12
[nullable] =>
[default] => 0.0000
[comment] => Value
)
)
[comment] => Customer Address Entity Decimal
)
[magentocustomer_address_entity_int] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => integer
[nullable] =>
[default] => 0
[comment] => Value
)
)
[comment] => Customer Address Entity Int
)
[magentocustomer_address_entity_text] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => text
[length] => 64K
[nullable] =>
[comment] => Value
)
)
[comment] => Customer Address Entity Text
)
[magentocustomer_address_entity_varchar] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => text
[length] => 255
[comment] => Value
)
)
[comment] => Customer Address Entity Varchar
)
[magentocustomer_entity_datetime] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => datetime
[nullable] =>
[default] => 0000-00-00 00:00:00
[comment] => Value
)
)
[comment] => Customer Entity Datetime
)
[magentocustomer_entity_decimal] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => decimal
[scale] => 4
[precision] => 12
[nullable] =>
[default] => 0.0000
[comment] => Value
)
)
[comment] => Customer Entity Decimal
)
[magentocustomer_entity_int] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => integer
[nullable] =>
[default] => 0
[comment] => Value
)
)
[comment] => Customer Entity Int
)
[magentocustomer_entity_text] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => text
[length] => 64K
[nullable] =>
[comment] => Value
)
)
[comment] => Customer Entity Text
)
[magentocustomer_entity_varchar] => Array
(
[columns] => Array
(
[value_id] => Array
(
[type] => integer
[identity] => 1
[nullable] =>
[primary] => 1
[comment] => Value Id
)
[entity_type_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Type Id
)
[attribute_id] => Array
(
[type] => smallint
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Attribute Id
)
[entity_id] => Array
(
[type] => integer
[unsigned] => 1
[nullable] =>
[default] => 0
[comment] => Entity Id
)
[value] => Array
(
[type] => text
[length] => 255
[comment] => Value
)
)
[comment] => Customer Entity Varchar
)
)
)
)
[10] => Array
(
[file] => /Applications/MAMP/htdocs/app/code/core/Mage/Core/Model/Resource/Setup.php
[line] => 624
[args] => Array
(
[0] => /Applications/MAMP/htdocs/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-
File Attachments