I had a problem recently where I had spent a lot of development
time on a NopCommerce install, and needed to copy the store and
re-skin it for a new website. The main problem was that the
store I was copying had literally 1000's or products and
attributes, loads of categories and 1000's or orders.
And to remove all everything manually would have taken
HOURS! But after some asking on the forums and looking round
I found this great bit of SQL which literally clears the store,
ready for you to start building again (The only thing it leaves is
the customers). It makes creating a new store from an
existing one a breezeā¦
DELETE FROM Nop_ShoppingCartItem
DELETE FROM Nop_OrderNote
DELETE FROM Nop_OrderProductVariant
DELETE FROM Nop_Order
DELETE FROM Nop_ProductVariantAttributeCombination
DELETE FROM Nop_RelatedProduct
DELETE FROM Nop_ProductVariantAttributeValue
DELETE FROM Nop_ProductVariant_ProductAttribute_Mapping
DELETE FROM Nop_ProductAttribute
DELETE FROM Nop_ProductVariant
DELETE FROM Nop_ProductPicture
DELETE FROM Nop_Product_Category_Mapping
DELETE FROM Nop_Product
DELETE FROM Nop_Category
DELETE FROM Nop_Picture
DBCC CHECKIDENT (Nop_ShoppingCartItem, RESEED, 0)
DBCC CHECKIDENT (Nop_OrderNote, RESEED, 0)
DBCC CHECKIDENT (Nop_OrderProductVariant, RESEED, 0)
DBCC CHECKIDENT (Nop_Order, RESEED, 0)
DBCC CHECKIDENT (Nop_ProductVariantAttributeCombination, RESEED, 0)
DBCC CHECKIDENT (Nop_RelatedProduct, RESEED, 0)
DBCC CHECKIDENT (Nop_ProductVariantAttributeValue, RESEED, 0)
DBCC CHECKIDENT (Nop_ProductVariant_ProductAttribute_Mapping, RESEED, 0)
DBCC CHECKIDENT (Nop_ProductAttribute, RESEED, 0)
DBCC CHECKIDENT (Nop_ProductVariant, RESEED, 0)
DBCC CHECKIDENT (Nop_ProductPicture, RESEED, 0)
DBCC CHECKIDENT (Nop_Product_Category_Mapping, RESEED, 0)
DBCC CHECKIDENT (Nop_Product, RESEED, 0)
DBCC CHECKIDENT (Nop_Category, RESEED, 0)
DBCC CHECKIDENT (Nop_Picture, RESEED, 0)