We have developed devlopment site in magento 1.8 for our live site. We have added the required plugins and designed the home page in dev site. Then we have updated the database from live to development server. (which is 1.7) While clear the cache, shows the error. The error is:

"Error in file: "/home/cardsd/public_html/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'paypal_reversed' for key 'PRIMARY'"
#0 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(407): Mage_Core_Model_Resource_Setup->_modifyResourceDb('data-upgrade', '', '')
#2 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(286): Mage_Core_Model_Resource_Setup->_upgradeData('', '')
#3 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(269): Mage_Core_Model_Resource_Setup->applyDataUpdates()
#4 /home/cardsd/public_html/app/code/core/Mage/Core/Model/App.php(351): Mage_Core_Model_Resource_Setup::applyAllDataUpdates()
#5 /home/cardsd/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /home/cardsd/public_html/index.php(87): Mage::run('', 'store')
#7 {main}";s:3:"url";s:66:"/index.php/admin/cache/index/key/ddb59108c0b38a2c9c5972afb1c2a499/"

Also, my home page sale.phtml and new.phtml files are displayed without products.

Any help is appreciated.


First of all the error in script occurs because in sales_order_status table you already have record with status "paypal_reversed". Remove this row.

As for home page sale.phtml and new.phtml.

Probably these are CMS pages. Check the content of these pages before upgrade and after. Maybe this will help you to fix the problem.

Also check logs.

  • I think the issue is more global than that. Looks like the setup for Paypal stopped midway, so something is fundamentally wrong. As a general rule, if you have to access the database directly, it's usually a bad sign. – Mayers Jun 14 '16 at 14:49

There are problems with dumping and importing the database, previous we were using:

mysqldump -u user -p database > database.sql

but this type of export create problems with encoding, you should use:

mysqldump -u user -p database -r database.sql

Make sure all the database was imported.


This shows that your upgrade didn't run fully. I would advise reverting your 1.7 store and when you run the database upgrade, make sure you turn the caches off before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.