Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - update magento from 1.6.2 to 1.7.0.2

Tags:

mysql

magento

Hi when i update my magento 1.6.2 to 1.7.0.2 the files update work fine ... (i am all trieing this on my testserver)

I, get the same errors when is try to update through the diff files or the magento connect (updating the mage_all_latest)

But when i log in for the first time on the webshop it's trying to update the mysql table.

But i get error after error.

Here a list of the errors:

a:5:{i:0;s:237:"Error in file: "/var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'salesrule_website' already exists";i:1;s:1122:"
#0 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')

and the same for:

  • catalog_product_entity_group_price
  • salesrule_customer_group
  • report_viewed_product_aggregated_daily
  • report_viewed_product_aggregated_monthly
  • report_viewed_product_aggregated_jearly
  • oauth_consumer

To solve this i deleted these keys. (although this doesn't seem right)

But the last key i can't remove. I get #1217 - Cannot delete or update a parent row: a foreign key constraint fails

Who can tell me what i am doing wrong ...

UPDATE 01-08-2012

I repaired the database using the reapir tool of magento. Afterward i updated magento through updating the mage_all_latest to 1.7.0.2.

All works fine except in the end i get: "Exception during cache and session cleaning", but there are no other errors during installing.

Then i return to the admin i get a white screen. After waiting a while i cleared the var/cache and apc.

Now i get this message:

a:5:{i:0;s:255:"Error in file: "/var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'catalog_product_entity_group_price' already exists";i:1;s:1132:"
#0 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.0.0.8', '1.6.0.0.14')
#2 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.0.0.8', '1.6.0.0.14')
#3 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /var/www/vhosts/liefstoereigenwijs.nl/site1/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /var/www/vhosts/liefstoereigenwijs.nl/site1/index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I do notice that after the upgrade the file permissions of a lot of files have changed, like index.php changed to 666.

Who can help me?

like image 231
Ronny Avatar asked Jul 29 '12 09:07

Ronny


1 Answers

Based on your install it seems that it doesn't have a DROP TABLE IF EXISTS command preceeding it. This is actually helping you. I would log in to the db server as admin or root and execute the following commands:

create table catalog_product_entity_group_price_backup like catalog_product_entity_group_price;

insert into catalog_product_entity_group_price_backup select * from catalog_product_entity_group_price;

drop table catalog_product_entity_group_price;

This should create everything from the catalog_product_entity_group_price table into a backup, and drop it so that Magento can complete the upgrade. After the upgrade is complete you can compare the two tables and merge the information in - if the table isn't structurally different you may even be able to execute an insert into catalog_product_entity_group_price select * from catalog_product_entity_group_price_backup;

Cheers.

like image 166
philwinkle Avatar answered Oct 12 '22 08:10

philwinkle