View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007182 | OXID eShop (all versions) | 5. ------ UpdateApp / Update ------ | public | 2020-10-07 13:52 | 2020-10-09 11:40 |
Reporter | Pavel Stolba | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | 6.2.2 | ||||
Summary | 0007182: Migration for xxx2shop tables from PE to EE wrong | ||||
Description | There is a copy&paste bug in the migration script oxideshop\vendor\oxid-esales\oxideshop-ee\migration\data\Version20160919103142_pe_to_ee.php All the tables xxx2shop are filled with entries from oxarticles table, because the subquery is in all cases the same "SELECT OXSHOPID,OXMAPID from oxarticles". That can lead to a big problems after update to EE, because of data mixture. And it's not easy to find out the reason. The part of the code from Version20160919103142_pe_to_ee.php (Row 473): $this->addSql("INSERT INTO `oxdeliveryset2shop` (`OXSHOPID`, `OXMAPOBJECTID`) VALUES (1, 901)"); $this->addSql("INSERT INTO `oxdeliveryset2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxdelivery2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxarticles2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxdiscount2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxcategories2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxattribute2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxlinks2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxvoucherseries2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxmanufacturers2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxnews2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxselectlist2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxwrapping2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); $this->addSql("INSERT INTO `oxvendor2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); Also if you first add the $this->addSql("INSERT INTO `oxdeliveryset2shop` (`OXSHOPID`, `OXMAPOBJECTID`) VALUES (1, 901)"); query and then will be the next query started $this->addSql("INSERT INTO `oxdeliveryset2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxarticles"); that ends with a DB error: Duplicate entry '1-901' for key 'OXMAPIDX'. So in the oxdeliveryset2shop will land only the one entry (1, 901). | ||||
Steps To Reproduce | Run a migration in OXID 6 from PE to EE | ||||
Tags | No tags attached. | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
The second part i noticed with the "Duplicate entry '1-901' for key 'OXMAPIDX'" problem is coming only if there more then 900 articles at the time the migrations are running. So will not happend with demo datas. |
|
Here is a fix we used (in project_migration) $this->addSql("TRUNCATE TABLE `oxdeliveryset2shop`"); $this->addSql("INSERT INTO `oxdeliveryset2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxdeliveryset"); $this->addSql("TRUNCATE TABLE `oxdelivery2shop`"); $this->addSql("INSERT INTO `oxdelivery2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxdelivery"); $this->addSql("TRUNCATE TABLE `oxdiscount2shop`"); $this->addSql("INSERT INTO `oxdiscount2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxdiscount"); $this->addSql("TRUNCATE TABLE `oxcategories2shop`"); $this->addSql("INSERT INTO `oxcategories2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxcategories"); $this->addSql("TRUNCATE TABLE `oxattribute2shop`"); $this->addSql("INSERT INTO `oxattribute2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxattribute"); $this->addSql("TRUNCATE TABLE `oxlinks2shop`"); $this->addSql("INSERT INTO `oxlinks2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxlinks"); $this->addSql("TRUNCATE TABLE `oxvoucherseries2shop`"); $this->addSql("INSERT INTO `oxvoucherseries2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxvoucherseries"); $this->addSql("TRUNCATE TABLE `oxmanufacturers2shop`"); $this->addSql("INSERT INTO `oxmanufacturers2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxmanufacturers"); $this->addSql("TRUNCATE TABLE `oxnews2shop`"); $this->addSql("INSERT INTO `oxnews2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxnews"); $this->addSql("TRUNCATE TABLE `oxselectlist2shop`"); $this->addSql("INSERT INTO `oxselectlist2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxselectlist"); $this->addSql("TRUNCATE TABLE `oxwrapping2shop`"); $this->addSql("INSERT INTO `oxwrapping2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxwrapping"); $this->addSql("TRUNCATE TABLE `oxvendor2shop`"); $this->addSql("INSERT INTO `oxvendor2shop` (OXSHOPID, OXMAPOBJECTID) SELECT OXSHOPID,OXMAPID from oxvendor"); |
|
Dear Pavel Stolba, thank you for reporting this issue. Best regard QA - SG - |