Zen Cart Logo
Forums / Basic Configuration / Clear All Products..

Clear All Products..

Locked

Views: 2,466

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
11 May 2006, 08:06
#1
gemohler avatar

gemohler

Zen Follower

Join Date:
Jul 2005
Location:
CA
Posts:
223
Plugin Contributions:
0

Clear All Products..

Im looking at some form of database corruption, or something..odd with it.

Howcan I clear all products & categories from the DB directly, and simply start adding new ones in empty tables?

I have my excel backups of what I want IN the store..but as it is now, I can see 600 products IN the store, but an EP download has 18000ish lines of products.

I want to clear em outta the DB

15 May 2006, 06:45
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Clear All Products..

First, only attempt this if you throughly understand what is contained in the DB tables, as there are several things installed in a fresh DB that you would not want to delete.

Backup you DB as the first step, this is a must!!

If you have phpMyadmin, go into your phpmyadmin app and load your DB. Select the tables that contain the information you want to clear out via the check boxes and then at the bottom there is a dropdown that is titled 'with selected'.

Dropping this down you will have several options and you want 'clear'. This will empty the contents retaining the structure.

Please proceed with caution...

15 May 2006, 18:44
#3
gemohler avatar

gemohler

Zen Follower

Join Date:
Jul 2005
Location:
CA
Posts:
223
Plugin Contributions:
0

Re: Clear All Products..

kobra:

First, only attempt this if you throughly understand what is contained in the DB tables, as there are several things installed in a fresh DB that you would not want to delete.

Backup you DB as the first step, this is a must!!

If you have phpMyadmin, go into your phpmyadmin app and load your DB. Select the tables that contain the information you want to clear out via the check boxes and then at the bottom there is a dropdown that is titled 'with selected'.

Dropping this down you will have several options and you want 'clear'. This will empty the contents retaining the structure.

Please proceed with caution...

This is what I ended up doing, it worked quite well.

delete from products where products_id > 129210;
delete from products_description where products_id > 129210;
delete from products_to_categories where products_id > 129210;
delete from categories where categories_id > 13383;
delete from categories_description where categories_id > 13383;

Now, when I do uploads to add new products I will be creating watermark products and categories to keep track of where things are in the DB..just in case.

16 May 2006, 10:28
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Clear All Products..

Just for the record, specify how you did this as this is not the method I described. You must have generated SQL statements for this. Please post your methid so that others do not get confused trying to follow this post. Thanks

05 Jul 2006, 17:53
#5
gnotapipe avatar

gnotapipe

New Zenner

Join Date:
May 2006
Location:
Oregon, USA
Posts:
33
Plugin Contributions:
0

Re: Clear All Products..

Since gemohler hasn't replied; It seems clear (to me, anyway) that he connected to his server via telnet or SSH & opened the mysqlmonitor command line interface, then issued the above sequence of SQL statements.

05 Jul 2006, 22:52
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Clear All Products..

One could also run these SQL statements from the admin sql patch option...

I do not recommend this unless you are completely familiar with what you are doing.
If you are then dis-regard.

05 Jul 2006, 22:53
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Clear All Products..

Especially be careful if you also have Attributes ... that includes a group of additional tables to clean up ...

Same with specials, featured, salemaker, discounts, etc.