Duplicate entry for key UNQ_CORE_FILE_STORAGE_FILENAME_DIRECTORY_ID in core_file_storage when updating magenta

StackOverflow https://stackoverflow.com/questions/20974549

  •  25-09-2022
  •  | 
  •  

Question

When updating Magento version 1.5 to version 1.8 the following error occurs:

a:5:{i:0;s:321:"Error in file: "/var/www/vhosts/mysitename/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'article_2_1_1_1_1_2_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1' for key 'UNQ_CORE_FILE_STORAGE_FILENAME_DIRECTORY_ID'";i:1;s:1072:"#0 /var/www/vhosts//app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /var/www/vhosts//app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '0.8.28', '1.6.0.4')
#2 /var/www/vhosts//app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('0.8.28', '1.6.0.4')
#3 /var/www/vhosts//app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /var/www/vhosts//app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /var/www/vhosts//app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /var/www/vhosts//app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /var/www/vhosts//index.php(87): Mage::run('', 'store')

I cannot find any duplicates however in the core_file_storage?

Was it helpful?

Solution

What I did to solve this problem:

  • Switched to file based storage instead of database based: Configuration \ Advanced \ System \ Storage Configuration for Media
  • Cleared the core_file_storage table

After this the migration went trough.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top