Magento Forum

   
Error after moving Magento
 
whaverhals
Jr. Member
 
Total Posts:  1
Joined:  2009-01-19
 

Hi,
I get this error after moving Magento to our new server:

a:5:{i:0;s:240:"Error in file: "/var/www/vhosts/domain.tld/store/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'foc9_coupon_aggregated_updated' already exists";i:1;s:1042:"#0 /var/www/vhosts/domain.tld/store/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /var/www/vhosts/domain.tld/store/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.0.0', '1.6.0.1')
#2 /var/www/vhosts/domain.tld/store/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.0.0', '1.6.0.1')
#3 /var/www/vhosts/domain.tld/store/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /var/www/vhosts/domain.tld/store/app/code/core/Mage/Core/Model/App.php(412): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /var/www/vhosts/domain.tld/store/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules()
#6 /var/www/vhosts/domain.tld/store/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /var/www/vhosts/domain.tld/store/index.php(80): Mage::run('', 'store')
#8 {main}"
;s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Has anyone a solution?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

From this error I understand that Magneto is trying to upgrade the SalesRule module from version 1.6.0.0 to 1.6.0.1.
I don’t understand why is this happening.
Did you move the database also or just the files.
The version of each module is kept in the database. So if it does not do this on dev server and it’s the same database it shouldn’t do it on live server either.

Anyway.
From what I see in the file it is trying to run, the only thing it does is to create the tables ‘salesrule_coupon_aggregated’, ‘salesrule_coupon_aggregated_updated’.
If you already have these tables you don’t need to run this file.
So go in the database, table core_resource, search for the entry with `code` = ‘salesrule_setup’ and update the values for `version` and `data_version` to 1.6.0.1.

Clear the contents of var/cache and shoot again.

Let’s hope it works. Well...at least the error should change.

Marius.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rockeyfreak
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2012-02-12
 

replace in the file magento\\app\\code\\core\\Mage\\SalesRule\\sql\\salesrule_setup\\install-1.6.0.0.fp
lines 333-335:

-> addColumn (’period’, Varien_Db_Ddl_Table :: TYPE_DATE, null, array (
‘nullable’ => false,
), ‘Period’)

on

-> addColumn (’period’, Varien_Db_Ddl_Table :: TYPE_DATE, null, array (
‘nullable’ => true,
), ‘Period’)

good luck.

Regards
[Rahul Dhamehca]

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top