How can I make blank my whole Nop db?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 yıl önce
I want a fresh blank Nop db without default products. I have current version of 2.6. I have to make my Nop Db blank so that I can Insert my products. I don't want to delete products from admin panel. Even I don't want the existence of default products in my Nop Db.

How can I do that? Any one can advice me?

Thank you in advance.
11 yıl önce
krutal wrote:
I want a fresh blank Nop db without default products. I have current version of 2.6. I have to make my Nop Db blank so that I can Insert my products. I don't want to delete products from admin panel. Even I don't want the existence of default products in my Nop Db.

How can I do that? Any one can advice me?

Thank you in advance.


Running a SQL script should do the job isn't it? :)
11 yıl önce
DELETE FROM [YOURDB].[dbo].[Product]where ID Between 1 and 52;  (Your Id's)
  
GO

If you want to reseed the Db table back to a new Id of your choice

DBCC CHECKIDENT ( 'YOURDB.dbo.Product',RESEED, 1)
  
GO

Should do the trick The first script will also remove all ProductVariants and Product_Category_Mapping's which you can also reseed to a new Id.


Hope this helps

Richard
11 yıl önce
reinstall nop commerce
11 yıl önce
The easiest way I found around this is to delete your DB and start with a fresh copy of Nop.  I've had to repeatedly do so during the duration of my current project.  Here are the steps:

1.) In NopCommerce.sln, go to the Presentation folder and to Nop.Web.
2.) Open the App_Data folder.
3.) In the Solution Explorer, there should be a button with Alt Text called Show All Files.  Click it.
4.) Within App_Data, there should be a filed called Settings.txt.  Delete it.
5.) Launch NopCommerce and you'll be prompted for setting up Nop again.
6.) Below registering the admin account, there should be a checkbox labeled Create Sample Data.  It will be checked defaultly.  Uncheck it.
7.) Finish up making the settings for Nop.  Once done, you'll have an empty DB (with exception of necessary data for a few things but no Products).

Hope that helps.
11 yıl önce
Yeah, you can do it manually but there is more to the sample data than just Products.  You'd have to get the categories and attributes at least.  If you're not heavily invested it's probably easier to just reinstall.
11 yıl önce
That is true, I forgot about the sample data containing Categories, Attributes, etc.  I always restock my data through a conversion program once I have a fresh instance, so it never occured to me that may be an issue.  At any rate, like Andy said, if you're looking for completely empty, what I suggested would work, otherwise, SQL is the way you'll have to go.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.