Zen Cart Logo

deleting all data

Locked

Views: 966

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
23 Apr 2010, 4:31 PM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

deleting all data

I don't suppose anyone has a batch file that deletes all customers, customer orders and products from a zen cart install?

I've used another site as a template, which is good, but all the customers and products need to go and I don't want to leave fragments behind in related tables.

Anyone?

23 Apr 2010, 5:33 PM
#2
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: deleting all data

OK, finally figured this out, been at it all day!

These are the tables to delete when you copy an existing site to a new server as a template. to get rid of the existing customers, existing orders and existing products (and all the loose ends that are associated with them) just run this querry from PHPmyADMIN:

DELETE FROM customers;
DELETE FROM customers_admin_notes;
DELETE FROM customers_basket;
DELETE FROM customers_basket_attributes;
DELETE FROM customers_info;
DELETE FROM customers_wishlist;
DELETE FROM products;
DELETE FROM manufacturers;
DELETE FROM manufacturers_info;
DELETE FROM paypal;
DELETE FROM paypal_payment_status;
DELETE FROM paypal_payment_status_history;
DELETE FROM paypal_session;
DELETE FROM paypal_testing;
DELETE FROM nochex_apc_transactions;
DELETE FROM nochex_sessions;
DELETE FROM orders;
DELETE FROM orders_status_history;
DELETE FROM orders_products_download;
DELETE FROM orders_total;
DELETE FROM orders_products;
DELETE FROM orders_products_attributes;
23 Apr 2010, 5:39 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: deleting all data

limelites,
That list will DEFINITELY cause you problems.

You've forgotten the address-book, all the product-related tables, all the attribute-related tables, and you've listed several tables that don't exist in a clean ZC install.

Also, TRUNCATE TABLE is better than DELETE FROM

http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema

23 Apr 2010, 6:24 PM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: deleting all data

Thanks Dr. Byte, I'll take a look at those now...

12 May 2010, 1:29 PM
#5
crafterscafe avatar

crafterscafe

New Zenner

Join Date:
May 2009
Posts:
38
Plugin Contributions:
0

Re: deleting all data

I am looking at selling shop and do not want to transfer over old order data - however want to transfer all products & customers. any way to do this?

I have lots of orders so going through and using the "delete" order would be crazy. so i was trying to figure out just what happens when you click that "delete" button. Then rather then makiing it for just that order I could use * in the sql command.

Help please.