Follow me on twitter @yodasmydad
Ahhhh #Fringe can't finish like that!! Latest Tweet:

Hey I'm Lee. My blog was put up to house my strange thoughts, ramblings, nuggets of information I can refer back to and document my learning curves on new dev stuff like Umbraco v5 and other .NET related things.

All thoughts and comments on here are my own, and in no way reflect my employer - I also take no responsibility for spelling, grammar or terminology, so read at your own risk!

Blogs I Read

Sites I Like

Copying NopCommerce Stores Tip

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)
Back to top