Reset store: Delete all orders, customers, etc.
Hello
I want to setup a new ZC store by copy-pasting the files and database of my other running ZC store.
Of course, copy-pasting not only sets up an identical second store but also includes old orders, old customers, ect. of the old store into the new store.
Does anyone have an idea how I would be able to set my new copied store "to zero", i.e. to delete all old orders, customers, etc. from it?
I suppose you would be able to do that via deleting tables in the database, but I am not sure this would be a wise thing to do since this may break referencial integrity of the database ...
And deleting every order etc. by hand is just too exhaustive.
Any advice would be greatly appreciated!!!
Thanks!
Re: Reset store: Delete all orders, customers, etc.
Quote:
you would be able to do that via deleting tables in the database, but I am not sure this would be a wise thing to do since this may break referencial integrity of the database
You do not delete them
You can empty them and this retains the table & structure
There are many that will require being emptied as orders are indexed to customer, products purchased, etc....
Re: Reset store: Delete all orders, customers, etc.
Quote:
Originally Posted by
kobra
There are many that will require being emptied as orders are indexed to customer, products purchased, etc....
Hi Kobra
In my view, this is exactly the issue. If I delete the content of some tables like orders and customers, I expect that many other tables having references to these emptied tables would need to be adapted/emptied as well. If I don't find all of these references, I would expect that this could damage my database in a pretty unpredictable way.
And I have actually neither a clue which tables I would have to empty/adapt nor have I found a list of such tables anywhere on the web.
But on the other hand, I can not believe that there is no elegant solution to this issue (e.g. a cute sql script setting back the database would be nice...).
Has anyone solved this issue in an elegant manner???
Re: Reset store: Delete all orders, customers, etc.
Quote:
I would expect that this could damage my database in a pretty unpredictable way.
This is why one should always BACKUP BACKUP BACKUP
Re: Reset store: Delete all orders, customers, etc.
Quote:
Originally Posted by
flix
But on the other hand, I can not believe that there is no elegant solution to this issue (e.g. a cute sql script setting back the database would be nice...).
Has anyone solved this issue in an elegant manner???
Sorry for bumping this old thread but I have the same issue.
I need to setup a new identical store. I've worked hard installing all modules and modifications and do not wish to start from scratch again :).
Is my only option here to manually empty the required database fields?
If so, maybe it's easier to setup a new store from scratch anyways.
Hmmm...
Re: Reset store: Delete all orders, customers, etc.
Hey, I was looking for some time on how to delete all the orders and customers from my installation of zencart, after no luck in finding it online, I just created an sql script to do this.
This is pretty much it here, it's helped me. Hopefully it will help you.
NOTE: this won't touch any of the products or artists, or admin accounts, etc...
Just the Orders and Customers. And any session entries related to them.
Use at your own risk, of course:
Code:
DELETE FROM zc_address_book;
DELETE FROM zc_coupon_email_track;
DELETE FROM zc_coupon_gv_customer;
DELETE FROM zc_coupon_gv_queue;
DELETE FROM zc_coupon_redeem_track;
DELETE FROM zc_customers;
DELETE FROM zc_customers_basket;
DELETE FROM zc_customers_basket_attributes;
DELETE FROM zc_customers_info;
DELETE FROM zc_customers_wishlist;
DELETE FROM zc_email_archive;
DELETE FROM zc_files_uploaded;
DELETE FROM zc_orders;
DELETE FROM zc_orders_products;
DELETE FROM zc_orders_products_attributes;
DELETE FROM zc_orders_products_download;
DELETE FROM zc_orders_status_history;
DELETE FROM zc_orders_total;
DELETE FROM zc_paypal;
DELETE FROM zc_paypal_session;
DELETE FROM zc_paypal_testing;
DELETE FROM zc_reviews;
DELETE FROM zc_reviews_description;
DELETE FROM zc_sessions;
DELETE FROM zc_whos_online;
Re: Reset store: Delete all orders, customers, etc.
Has anyone else tried this? I'd in the same situation, but I really would hate to cause a massive problem if there's a flaw in this.
BTW - I'm amazed that someone hasn't come up with a more elegant solution to this problem -- I would think that the ability to clear out customer and order data in an efficient manner would be key to an ecommerce system.
(I know that sounds snarky, but I don't mean it to -- I'm just surprised that ZC doesn't have this function).
Re: Reset store: Delete all orders, customers, etc.
I had copied my files over to create another store so that I wouldn't have to add all my stock again.
I took a chance, tried this and it worked! I just need to reset the hit counter.
Thank you!
Re: Reset store: Delete all orders, customers, etc.
same here 6000 orders and 1000s of customers deleted and new orders now taken and everything great
thanks eastsideangus great quick delete
bn
Re: Reset store: Delete all orders, customers, etc.
There is AT LEAST one glaring flaw with eastsideangus' method: all your product and customer and order numbers in the new store will start at the number where the old store left off, and NOT at 1.
REMEMBER: USE AT OWN RISK