Forums / Managing Customers and Orders / need to delete all customers

need to delete all customers

Locked

Views: 2,076

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
1 Mar 2007, 9:40 PM
#1
trillian avatar

trillian

Zen Follower

Join Date:
Jun 2005
Location:
London, UK
Posts:
141
Plugin Contributions:
0

need to delete all customers

I have just setup a new zencart using a copy of my prviosu database.

Now I need to delete all the customers. There are something like 1300 customers in there so I don't want to have to delete them one by one! What is an easy way to delete all the customers in one go ?

Thanks,
Sheryl

2 Mar 2007, 5:20 AM
#2
billc108 avatar

billc108

Zen Follower

Join Date:
Apr 2005
Location:
ATX
Posts:
108
Plugin Contributions:
0

Re: need to delete all customers

trillian:

Now I need to delete all the customers. There are something like 1300 customers in there so I don't want to have to delete them one by one! What is an easy way to delete all the customers in one go ?

Probably the quickest way to do so would be to open the db using phpMyAdmin and emptying everything from all the customers tables. Open the table, and you'll find a big red EMPTY tab at the upper right. Don't use DROP, or you'll have to add the table back in. Probably all the orders tables too.

Next time, you should probably just use a copy of the database structure from the old site using the Export function, and build the new one by running the SQL statements it generates, MINUS the customer- and order-specific inserts.

All this assumes you're using MySQL.

Member since 4/05.

2 Mar 2007, 1:07 PM
#3
trillian avatar

trillian

Zen Follower

Join Date:
Jun 2005
Location:
London, UK
Posts:
141
Plugin Contributions:
0

Re: need to delete all customers

Thanks Bill !

That's excellent. The only other thing I'd like to get rid of is the reports, which still show products viewed and products purchased.

I do not see anything obvious in the database where these are stored. Is it in 'Activity Log' ?

-S

2 Mar 2007, 8:07 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: need to delete all customers

For customer data, you need to be sure you purge all data related to customers. If you only emptied the "customers" table, you'll have big problems later.
You need to deal with the "customers_info" and "address_book" tables similarly.

As to resetting stats, there are some options to do that in Admin->Tools->Store Manager

For other database-related info, peek at the schema here:
http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema#Table_List_Ordered_by_Data

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Mar 2007, 4:28 AM
#5
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: need to delete all customers

Couldn't help myself over hearing there was no such functions integrated in the admin's customers page. It's alright - I built my own.

Here's the package if interested.

-- Compatible with Zen-Cart 1.3x ---

Good luck. :wink2:

****** attachment removed by request******

Note: Do NOT post in this thread for questions about the Delete All Customers MOD. If you have questions, please create a new topic and we'll remain there so that the topic we're currently on would not be considered off topic.

Let's give a chance to our DEV team. :cool:

4 Mar 2007, 4:55 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: need to delete all customers

TheOracle:

Couldn't help myself over hearing there was no such functions integrated in the admin's customers page. It's alright - I built my own.

Here's the package if interested.

-- Compatible with Zen-Cart 1.3x ---

Good luck. :wink2:Good grief. That code will purge customers, orders, cc transaction records, coupons, emails, paypal transaction history, reviews, and more. It also purges two critical system tables that should never be touched.
*** USE AT OWN RISK ***
Also, I disagree with any suggestion that putting a link to such a destructive tool (with or without errors) on any regular admin page such as the "customers" page. That should be tucked away more discreetly in another location or never displayed at all.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Mar 2007, 4:59 AM
#7
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: need to delete all customers

This is already mentionned in the installation inside the ZIP file. I don't like it either personally but I thought this was the point of this topic. If I was wrong about it, then - yes - perhaps removing it would be the best suggestion since it is not the most secured way for webmasters to consider by deleting all customers (even though by phpmyadmin).

In addition, since I can't modify my post - I cannot remove this attachment. If one of the DEV team could do it, I guess it would be for the best.

4 Mar 2007, 5:10 AM
#8
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: need to delete all customers

There, now it has been removed. :yes: