TDLWebs Posted December 6, 2019 Share Posted December 6, 2019 After my issues with missing images I had to restore the CubeCart_filemanager table in the database by merging two backup files. However, this has created duplicate entries with the result that there is no primary key etc. Images can no longer be allocated to products in admin. I have located the duplicates using the query: SELECT filename, COUNT(filename) FROM CubeCart_filemanager GROUP BY filename HAVING COUNT(filename) > 1; But some images are used twice; once by a product and once by a category - as seen when I search for a particular image filename which is duplicated (see db-image1.jpg below) They also have identical md5hash entries. The phpmyadmin screenshot taken from a healthy CubeCart_filemanager table should have the structure seen in db-image2.jpg below: Any idea how can I remove the unnecessary duplicates and restore the integrity of the CubeCart_filemanager table???? Link to comment Share on other sites More sharing options...
TDLWebs Posted December 6, 2019 Author Share Posted December 6, 2019 Further investigation of the table shows: #1062 - Duplicate entry '17942' for key 'PRIMARY' Link to comment Share on other sites More sharing options...
bsmither Posted December 6, 2019 Share Posted December 6, 2019 Restored the CubeCart_filemanager table by merging two backup files? Which two? Having duplicate primary values seems to suggest that two backups of that one table was used, when only the latest should have been used. Link to comment Share on other sites More sharing options...
TDLWebs Posted December 9, 2019 Author Share Posted December 9, 2019 On 12/6/2019 at 7:15 PM, bsmither said: Having duplicate primary values seems to suggest that two backups of that one table was used, when only the latest should have been used. Yes, that's it. My stupid error. I was concerned at losing the latest product details which had been added since and tried to be clever but failed miserably. Thanks again for your expert advice bsmither! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.