Upgrade Magento 1.5.1.0 to 1.7.0.2 with Magento Connect
on May 3, 2013
Using Magento Connect when possible makes the Magento upgrade process a lot faster and easier. Errors can still occur however, so we recommend setting up a development store on which to run the upgrade. This way it is easy to upgrade and troubleshoot any errors that may crop up without impacting your live site. Please find below a detailed guide to upgrading from version 1.5.1.0 to 1.7.02 via Magento connect as well as details on solving some common upgrade issues.
If you would like help upgrading, we can upgrade Magento for you or help you troubleshoot any errors that you may have encountered during an upgrade. In need for a guide for upgrading earlier versions of Magento? Check out our guide for upgrading Magento 1.4.2.0 to 1.5.1.0.
Step 1:
Log into the admin panel and go to System > Magento Connect > Magento Connect Manager. You will have to enter your password again to log into Magento Connect Manager.
Step 2:
You need to allow Magento Connect Manager to overwrite existing files. Do this by editing downloader\lib\Mage\Connect\Validator.php
. If you try to run Magento Connect without changing the code, you will receive a “files already exists” error, such as Fatal error: Call to undefined method Varien_Db_Adapter_Pdo_Mysql::isTableExists()
and the upgrade will not complete.
Remove or comment out the below code, which is located at bottom of the file:
if (file_exists($dest)) { $this->addError("'{$file}' already exists"); return false; }
If the installation fails for any reason, you will need to edit the file again per the above as it gets overwritten by the version just downloaded.
Step 3:
Under Install New Extensions in the Paste the extension key to install field enter http://connect20.magentocommerce.com/community/Mage_All_Latest and click the Install button.
Step 4:
Review the upgrades to be installed and then click Commit Changes.
Step 5:
After a successful upgrade, you will see the following message when you try to open your site’s homepage:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtimeor capacity problems. Please try again later.
Do not worry! The message is caused by a maintenance.flag
file created during the Magento Connect update process. To resolve this error simple navigate to the base folder of the Magento install and delete maintenance.flag
.
Step 6:
Clear /var/cache/ and /var/session/ by deleting all files and folders in each directory.
Step 7:
Now load your store page and check for any errors. If you see any, proceed to the troubleshooting tips below. Otherwise, congratulations on upgrading your store!
Troubleshooting:
If you are still getting errors after following the above steps, is possible that tables are not using the correct engine. This is a common problem for Magento installs before version 1.4.1.1. The engine should be Innodb for most tables in the database and if they are myisam, it will result in problems, such as foreign key errors.
To fix the errors, convert the tables in the database the correct engines via phpMyAdmin with the below SQL script. Be sure to check and add any applicable table prefixes to the script. For further info, please see after the script.
ALTER TABLE `admin_assert` ENGINE=InnoDB; ALTER TABLE `admin_role` ENGINE=InnoDB; ALTER TABLE `admin_rule` ENGINE=InnoDB; ALTER TABLE `admin_user` ENGINE=InnoDB; ALTER TABLE `adminnotification_inbox` ENGINE=InnoDB; ALTER TABLE `api_assert` ENGINE=InnoDB; ALTER TABLE `api_role` ENGINE=InnoDB; ALTER TABLE `api_rule` ENGINE=InnoDB; ALTER TABLE `api_user` ENGINE=InnoDB; ALTER TABLE `catalog_category_entity` ENGINE=InnoDB; ALTER TABLE `catalog_category_entity_datetime` ENGINE=InnoDB; ALTER TABLE `catalog_category_entity_decimal` ENGINE=InnoDB; ALTER TABLE `catalog_category_entity_int` ENGINE=InnoDB; ALTER TABLE `catalog_category_entity_text` ENGINE=InnoDB; ALTER TABLE `catalog_category_entity_varchar` ENGINE=InnoDB; ALTER TABLE `catalog_category_product` ENGINE=InnoDB; ALTER TABLE `catalog_category_product_index` ENGINE=InnoDB; ALTER TABLE `catalog_compare_item` ENGINE=InnoDB; ALTER TABLE `catalog_product_bundle_option` ENGINE=InnoDB; ALTER TABLE `catalog_product_bundle_option_value` ENGINE=InnoDB; ALTER TABLE `catalog_product_bundle_selection` ENGINE=InnoDB; ALTER TABLE `catalog_product_enabled_index` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_datetime` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_decimal` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_gallery` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_int` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_media_gallery` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_media_gallery_value` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_text` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_tier_price` ENGINE=InnoDB; ALTER TABLE `catalog_product_entity_varchar` ENGINE=InnoDB; ALTER TABLE `catalog_product_link` ENGINE=InnoDB; ALTER TABLE `catalog_product_link_attribute` ENGINE=InnoDB; ALTER TABLE `catalog_product_link_attribute_decimal` ENGINE=InnoDB; ALTER TABLE `catalog_product_link_attribute_int` ENGINE=InnoDB; ALTER TABLE `catalog_product_link_attribute_varchar` ENGINE=InnoDB; ALTER TABLE `catalog_product_link_type` ENGINE=InnoDB; ALTER TABLE `catalog_product_option` ENGINE=InnoDB; ALTER TABLE `catalog_product_option_price` ENGINE=InnoDB; ALTER TABLE `catalog_product_option_title` ENGINE=InnoDB; ALTER TABLE `catalog_product_option_type_price` ENGINE=InnoDB; ALTER TABLE `catalog_product_option_type_title` ENGINE=InnoDB; ALTER TABLE `catalog_product_option_type_value` ENGINE=InnoDB; ALTER TABLE `catalog_product_super_attribute` ENGINE=InnoDB; ALTER TABLE `catalog_product_super_attribute_label` ENGINE=InnoDB; ALTER TABLE `catalog_product_super_attribute_pricing` ENGINE=InnoDB; ALTER TABLE `catalog_product_super_link` ENGINE=InnoDB; ALTER TABLE `catalog_product_website` ENGINE=InnoDB; ALTER TABLE `catalogindex_aggregation` ENGINE=InnoDB; ALTER TABLE `catalogindex_aggregation_tag` ENGINE=InnoDB; ALTER TABLE `catalogindex_aggregation_to_tag` ENGINE=InnoDB; ALTER TABLE `catalogindex_eav` ENGINE=InnoDB; ALTER TABLE `catalogindex_minimal_price` ENGINE=InnoDB; ALTER TABLE `catalogindex_price` ENGINE=InnoDB; ALTER TABLE `cataloginventory_stock` ENGINE=InnoDB; ALTER TABLE `cataloginventory_stock_item` ENGINE=InnoDB; ALTER TABLE `catalogrule` ENGINE=InnoDB; ALTER TABLE `catalogrule_affected_product` ENGINE=InnoDB; ALTER TABLE `catalogrule_product` ENGINE=InnoDB; ALTER TABLE `catalogrule_product_price` ENGINE=InnoDB; ALTER TABLE `catalogsearch_fulltext` ENGINE=MyISAM; ALTER TABLE `catalogsearch_query` ENGINE=InnoDB; ALTER TABLE `catalogsearch_result` ENGINE=InnoDB; ALTER TABLE `checkout_agreement` ENGINE=InnoDB; ALTER TABLE `checkout_agreement_store` ENGINE=InnoDB; ALTER TABLE `cms_block` ENGINE=InnoDB; ALTER TABLE `cms_block_store` ENGINE=InnoDB; ALTER TABLE `cms_page` ENGINE=InnoDB; ALTER TABLE `cms_page_store` ENGINE=InnoDB; ALTER TABLE `core_config_data` ENGINE=InnoDB; ALTER TABLE `core_email_template` ENGINE=InnoDB; ALTER TABLE `core_flag` ENGINE=InnoDB; ALTER TABLE `core_layout_link` ENGINE=InnoDB; ALTER TABLE `core_layout_update` ENGINE=InnoDB; ALTER TABLE `core_resource` ENGINE=InnoDB; ALTER TABLE `core_session` ENGINE=InnoDB; ALTER TABLE `core_store` ENGINE=InnoDB; ALTER TABLE `core_store_group` ENGINE=InnoDB; ALTER TABLE `core_translate` ENGINE=InnoDB; ALTER TABLE `core_url_rewrite` ENGINE=InnoDB; ALTER TABLE `core_website` ENGINE=InnoDB; ALTER TABLE `cron_schedule` ENGINE=InnoDB; ALTER TABLE `customer_address_entity` ENGINE=InnoDB; ALTER TABLE `customer_address_entity_datetime` ENGINE=InnoDB; ALTER TABLE `customer_address_entity_decimal` ENGINE=InnoDB; ALTER TABLE `customer_address_entity_int` ENGINE=InnoDB; ALTER TABLE `customer_address_entity_text` ENGINE=InnoDB; ALTER TABLE `customer_address_entity_varchar` ENGINE=InnoDB; ALTER TABLE `customer_entity` ENGINE=InnoDB; ALTER TABLE `customer_entity_datetime` ENGINE=InnoDB; ALTER TABLE `customer_entity_decimal` ENGINE=InnoDB; ALTER TABLE `customer_entity_int` ENGINE=InnoDB; ALTER TABLE `customer_entity_text` ENGINE=InnoDB; ALTER TABLE `customer_entity_varchar` ENGINE=InnoDB; ALTER TABLE `customer_group` ENGINE=InnoDB; ALTER TABLE `dataflow_batch` ENGINE=InnoDB; ALTER TABLE `dataflow_batch_export` ENGINE=InnoDB; ALTER TABLE `dataflow_batch_import` ENGINE=InnoDB; ALTER TABLE `dataflow_import_data` ENGINE=InnoDB; ALTER TABLE `dataflow_profile` ENGINE=InnoDB; ALTER TABLE `dataflow_profile_history` ENGINE=InnoDB; ALTER TABLE `dataflow_session` ENGINE=InnoDB; ALTER TABLE `design_change` ENGINE=InnoDB; ALTER TABLE `directory_country` ENGINE=InnoDB; ALTER TABLE `directory_country_format` ENGINE=InnoDB; ALTER TABLE `directory_country_region` ENGINE=InnoDB; ALTER TABLE `directory_country_region_name` ENGINE=InnoDB; ALTER TABLE `directory_currency_rate` ENGINE=InnoDB; ALTER TABLE `downloadable_link` ENGINE=InnoDB; ALTER TABLE `downloadable_link_price` ENGINE=InnoDB; ALTER TABLE `downloadable_link_purchased` ENGINE=InnoDB; ALTER TABLE `downloadable_link_purchased_item` ENGINE=InnoDB; ALTER TABLE `downloadable_link_title` ENGINE=InnoDB; ALTER TABLE `downloadable_sample` ENGINE=InnoDB; ALTER TABLE `downloadable_sample_title` ENGINE=InnoDB; ALTER TABLE `eav_attribute` ENGINE=InnoDB; ALTER TABLE `eav_attribute_group` ENGINE=InnoDB; ALTER TABLE `eav_attribute_option` ENGINE=InnoDB; ALTER TABLE `eav_attribute_option_value` ENGINE=InnoDB; ALTER TABLE `eav_attribute_set` ENGINE=InnoDB; ALTER TABLE `eav_entity` ENGINE=InnoDB; ALTER TABLE `eav_entity_attribute` ENGINE=InnoDB; ALTER TABLE `eav_entity_datetime` ENGINE=InnoDB; ALTER TABLE `eav_entity_decimal` ENGINE=InnoDB; ALTER TABLE `eav_entity_int` ENGINE=InnoDB; ALTER TABLE `eav_entity_store` ENGINE=InnoDB; ALTER TABLE `eav_entity_text` ENGINE=InnoDB; ALTER TABLE `eav_entity_type` ENGINE=InnoDB; ALTER TABLE `eav_entity_varchar` ENGINE=InnoDB; ALTER TABLE `gift_message` ENGINE=InnoDB; ALTER TABLE `googlebase_attributes` ENGINE=InnoDB; ALTER TABLE `googlebase_items` ENGINE=InnoDB; ALTER TABLE `googlebase_types` ENGINE=InnoDB; ALTER TABLE `googlecheckout_api_debug` ENGINE=InnoDB; ALTER TABLE `googleoptimizer_code` ENGINE=InnoDB; ALTER TABLE `log_customer` ENGINE=MyISAM; ALTER TABLE `log_quote` ENGINE=MyISAM; ALTER TABLE `log_summary` ENGINE=MyISAM; ALTER TABLE `log_summary_type` ENGINE=MyISAM; ALTER TABLE `log_url` ENGINE=MyISAM; ALTER TABLE `log_url_info` ENGINE=MyISAM; ALTER TABLE `log_visitor` ENGINE=MyISAM; ALTER TABLE `log_visitor_info` ENGINE=MyISAM; ALTER TABLE `newsletter_problem` ENGINE=InnoDB; ALTER TABLE `newsletter_queue` ENGINE=InnoDB; ALTER TABLE `newsletter_queue_link` ENGINE=InnoDB; ALTER TABLE `newsletter_queue_store_link` ENGINE=InnoDB; ALTER TABLE `newsletter_subscriber` ENGINE=InnoDB; ALTER TABLE `newsletter_template` ENGINE=InnoDB; #ALTER TABLE `oscommerce_import` ENGINE=InnoDB; #ALTER TABLE `oscommerce_import_type` ENGINE=InnoDB; #ALTER TABLE `oscommerce_orders` ENGINE=MyISAM; #ALTER TABLE `oscommerce_orders_products` ENGINE=MyISAM; #ALTER TABLE `oscommerce_orders_status_history` ENGINE=MyISAM; #ALTER TABLE `oscommerce_orders_total` ENGINE=MyISAM; #ALTER TABLE `oscommerce_ref` ENGINE=InnoDB; #ALTER TABLE `paybox_api_debug` ENGINE=InnoDB; #ALTER TABLE `paybox_question_number` ENGINE=InnoDB; ALTER TABLE `paygate_authorizenet_debug` ENGINE=MyISAM; ALTER TABLE `paypal_api_debug` ENGINE=MyISAM; ALTER TABLE `paypaluk_api_debug` ENGINE=InnoDB; ALTER TABLE `poll` ENGINE=InnoDB; ALTER TABLE `poll_answer` ENGINE=InnoDB; ALTER TABLE `poll_store` ENGINE=InnoDB; ALTER TABLE `poll_vote` ENGINE=InnoDB; ALTER TABLE `product_alert_price` ENGINE=InnoDB; ALTER TABLE `product_alert_stock` ENGINE=MyISAM; ALTER TABLE `rating` ENGINE=InnoDB; ALTER TABLE `rating_entity` ENGINE=InnoDB; ALTER TABLE `rating_option` ENGINE=InnoDB; ALTER TABLE `rating_option_vote` ENGINE=InnoDB; ALTER TABLE `rating_option_vote_aggregated` ENGINE=InnoDB; ALTER TABLE `rating_store` ENGINE=InnoDB; ALTER TABLE `rating_title` ENGINE=InnoDB; ALTER TABLE `report_event` ENGINE=InnoDB; ALTER TABLE `report_event_types` ENGINE=InnoDB; ALTER TABLE `review` ENGINE=InnoDB; ALTER TABLE `review_detail` ENGINE=InnoDB; ALTER TABLE `review_entity` ENGINE=InnoDB; ALTER TABLE `review_entity_summary` ENGINE=InnoDB; ALTER TABLE `review_status` ENGINE=InnoDB; ALTER TABLE `review_store` ENGINE=InnoDB; ALTER TABLE `sales_bestsellers_aggregated_daily` ENGINE=InnoDB; ALTER TABLE `sales_bestsellers_aggregated_monthly` ENGINE=InnoDB; ALTER TABLE `sales_bestsellers_aggregated_yearly` ENGINE=InnoDB; ALTER TABLE `sales_billing_agreement` ENGINE=InnoDB; ALTER TABLE `sales_billing_agreement_order` ENGINE=InnoDB; ALTER TABLE `sales_flat_creditmemo` ENGINE=InnoDB; ALTER TABLE `sales_flat_creditmemo_comment` ENGINE=InnoDB; ALTER TABLE `sales_flat_creditmemo_grid` ENGINE=InnoDB; ALTER TABLE `sales_flat_creditmemo_item` ENGINE=InnoDB; ALTER TABLE `sales_flat_invoice` ENGINE=InnoDB; ALTER TABLE `sales_flat_invoice_comment` ENGINE=InnoDB; ALTER TABLE `sales_flat_invoice_grid` ENGINE=InnoDB; ALTER TABLE `sales_flat_invoice_item` ENGINE=InnoDB; ALTER TABLE `sales_flat_order` ENGINE=InnoDB; ALTER TABLE `sales_flat_order_address` ENGINE=InnoDB; ALTER TABLE `sales_flat_order_grid` ENGINE=InnoDB; ALTER TABLE `sales_flat_order_item` ENGINE=InnoDB; ALTER TABLE `sales_flat_order_payment` ENGINE=InnoDB; ALTER TABLE `sales_flat_order_shipping_rate` ENGINE=InnoDB; ALTER TABLE `sales_flat_order_status_history` ENGINE=InnoDB; ALTER TABLE `sales_flat_quote` ENGINE=InnoDB; ALTER TABLE `sales_flat_quote_address` ENGINE=InnoDB; ALTER TABLE `sales_flat_quote_address_item` ENGINE=InnoDB; ALTER TABLE `sales_flat_quote_item` ENGINE=InnoDB; ALTER TABLE `sales_flat_quote_item_option` ENGINE=InnoDB; ALTER TABLE `sales_flat_quote_payment` ENGINE=InnoDB; ALTER TABLE `sales_flat_quote_shipping_rate` ENGINE=InnoDB; ALTER TABLE `sales_flat_shipment` ENGINE=InnoDB; ALTER TABLE `sales_flat_shipment_comment` ENGINE=InnoDB; ALTER TABLE `sales_flat_shipment_grid` ENGINE=InnoDB; ALTER TABLE `sales_flat_shipment_item` ENGINE=InnoDB; ALTER TABLE `sales_flat_shipment_track` ENGINE=InnoDB; ALTER TABLE `sales_invoiced_aggregated` ENGINE=InnoDB; ALTER TABLE `sales_invoiced_aggregated_order` ENGINE=InnoDB; ALTER TABLE `sales_order_aggregated_created` ENGINE=InnoDB; ALTER TABLE `sales_order_tax` ENGINE=InnoDB; ALTER TABLE `sales_payment_transaction` ENGINE=InnoDB; ALTER TABLE `sales_recurring_profile` ENGINE=InnoDB; ALTER TABLE `sales_recurring_profile_order` ENGINE=InnoDB; ALTER TABLE `sales_refunded_aggregated` ENGINE=InnoDB; ALTER TABLE `sales_refunded_aggregated_order` ENGINE=InnoDB; ALTER TABLE `sales_shipping_aggregated` ENGINE=InnoDB; ALTER TABLE `sales_shipping_aggregated_order` ENGINE=InnoDB; ALTER TABLE `salesrule` ENGINE=InnoDB; ALTER TABLE `salesrule_coupon` ENGINE=InnoDB; ALTER TABLE `salesrule_coupon_usage` ENGINE=InnoDB; ALTER TABLE `salesrule_customer` ENGINE=InnoDB; ALTER TABLE `salesrule_label` ENGINE=InnoDB; ALTER TABLE `sendfriend_log` ENGINE=MyISAM; ALTER TABLE `shipping_tablerate` ENGINE=InnoDB; ALTER TABLE `sitemap` ENGINE=InnoDB; ALTER TABLE `tag` ENGINE=InnoDB; ALTER TABLE `tag_relation` ENGINE=InnoDB; ALTER TABLE `tag_summary` ENGINE=InnoDB; ALTER TABLE `tax_calculation` ENGINE=InnoDB; ALTER TABLE `tax_calculation_rate` ENGINE=InnoDB; ALTER TABLE `tax_calculation_rate_title` ENGINE=InnoDB; ALTER TABLE `tax_calculation_rule` ENGINE=InnoDB; ALTER TABLE `tax_class` ENGINE=InnoDB; ALTER TABLE `weee_discount` ENGINE=InnoDB; ALTER TABLE `weee_tax` ENGINE=InnoDB; ALTER TABLE `wishlist` ENGINE=InnoDB; ALTER TABLE `wishlist_item` ENGINE=InnoDB;
Magento requires Innodb to be used as the storage engine in the SQL database for the majority of files. However, note that some files use myisam. While this has always been a requirement, previous versions of the installer did not check to ensure Innodb was used. Couple this with the fact that certain versions of MySQL default to myisam and it is easy to see how problems may occur. For more information, see the Magento website and this post on the Magento community forum.
If you need assistance with resolving any errors during the upgrade process, please contact us for Magento upgrade help.
Hello sir,
Thanks for sharing this article its works perfect..
I have followed as per your instruction all the code core files are upgraded successfully but any how the version is not changed 1.5 to 1.9.(in admin at the footer)
Can you please suggest me why its not updated..
Thanks in Advance !!
Regards,
Anurag
Hi Anurag, glad the article was helpful. Not sure of the exact cause of why your versions is still showing 1.5, but perhaps you missed a step during the process and your database wasn’t updated correct. Check out this Magento Wiki for more info.