Delete

Get all skus with SQL for clean Inbentorii database and media folders : SELECT * FROM `catalog_product_entity` where `entity_id` IN (select `product_id` from `catalog_category_product` where `category_id` = 173); Export XLS and extract sku column. Just run this request to clean catalog products (Be careful before DELETE) : DELETE FROM `catalog_product_entity` where `entity_id` IN (select `product_id` from `catalog_category_product` where `category_id` = 173); And just after (for delete simple un-associated) : DELETE FROM `catalog_product_super_link` WHERE parent_id NOT IN ( SELECT entity_id FROM catalog_product_entity ) DELETE FROM catalog_product_entity WHERE entity_id NOT IN ( SELECT product_id FROM catalog_product_super_link ) AND type_id = 'simple'; Puis desactiver et couper la liaison web et images sur Inbentorii avec une requete de ce type : UPDATE article SET active = 0, eshop_active = 0, eshop_picture = 0 WHERE reference IN (extracted_skus_from_magento_database); And after, clean Magento media folders with bye bye pic bye Boeki. And after, clean inbentorii database and media : run : SELECT CONCAT('cp -vf /var/www/INB/www.inbentorii.com/public/eshop_pictures/',`idsoc`,'_',`reference`,'_1.jpg /var/www/INB/www.inbentorii.com/public/imgnew;') AS '#!/bin/bash' FROM `article` WHERE `active` = 1 AND `eshop_active` = 1 UNION SELECT CONCAT('cp -vf /var/www/INB/www.inbentorii.com/public/eshop_pictures/',`idsoc`,'_',`reference`,'_2.jpg /var/www/INB/www.inbentorii.com/public/imgnew;') AS '#!/bin/bash' FROM `article` WHERE `active` = 1 AND `eshop_active` = 1 UNION SELECT CONCAT('cp -vf /var/www/INB/www.inbentorii.com/public/eshop_pictures/',`idsoc`,'_',`reference`,'_3.jpg /var/www/INB/www.inbentorii.com/public/imgnew;') AS '#!/bin/bash' FROM `article` WHERE `active` = 1 AND `eshop_active` = 1 UNION SELECT CONCAT('cp -vf /var/www/INB/www.inbentorii.com/public/eshop_pictures/',`idsoc`,'_',`reference`,'_4.jpg /var/www/INB/www.inbentorii.com/public/imgnew;') AS '#!/bin/bash' FROM `article` WHERE `active` = 1 AND `eshop_active` = 1; AND export in csv with entete de colonne and pas de separateur, rename in sh. Creer /var/www/INB/www.inbentorii.com/public/imgnew Lancer le script en BASH Et renommer l'ancien eshop_pictures en eshop_pictures_save Et renommer imgnew en eshop_pictures chown www-data:bn25189-1427 . chmod 777 . Et voila
Sorter
Filter
No products found