Delete all products from database

  • Posts: 152
  • Thank you received: 0
11 years 4 months ago #83338

I'd like to delete all products from Hikashop and "start again" (with product IDs reset to 0 etc). I just wanted to check which database tables do I need to flush to achieve this?


Create your own style of luxury bespoke furniture online

Please Log in or Create an account to join the conversation.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 4 months ago #83358

Hi,

You need to flush:
#__hikashop_product
#__hikashop_price
#__hikashop_product_category
#__hikashop_product_related

And
#__hikashop_order
#__hikashop_order_product
#__hikashop_history

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: SG

Please Log in or Create an account to join the conversation.

  • Posts: 101
  • Thank you received: 12
10 years 11 months ago #103820

Hi,

And #__hikashop_file too if I'm not mistaken, where file_type is equal to 'product'.

Greets

The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

  • Posts: 263
  • Thank you received: 11
10 years 8 months ago #119092

I suggest this SQL code to do the job :

-- -----------------------------
-- Delete all products (and not categories) from database.
-- -----------------------------

TRUNCATE TABLE  `tosdq_hikashop_product`;
ALTER TABLE `tosdq_hikashop_product` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_price`;
ALTER TABLE `tosdq_hikashop_price` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_product_category`;
ALTER TABLE `tosdq_hikashop_product_category` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_product_related`;
ALTER TABLE `tosdq_hikashop_product_related` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_order`;
ALTER TABLE `tosdq_hikashop_order` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_order_product`;
ALTER TABLE `tosdq_hikashop_order_product` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_history`;
ALTER TABLE `tosdq_hikashop_history` AUTO_INCREMENT=0;

DELETE FROM `tosdq_hikashop_file` WHERE file_type='product';
ALTER TABLE `tosdq_hikashop_file` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_variant`;
ALTER TABLE `tosdq_hikashop_variant` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_cart`;
ALTER TABLE `tosdq_hikashop_cart` AUTO_INCREMENT=0;

TRUNCATE TABLE  `tosdq_hikashop_cart_product`;
ALTER TABLE `tosdq_hikashop_cart_product` AUTO_INCREMENT=0;

The following user(s) said Thank You: SG

Please Log in or Create an account to join the conversation.

Time to create page: 0.087 seconds
Powered by Kunena Forum