Setup nopCommerce 4.50 project with existing database

1 year ago
Hello NOP Teams,
I tried to install nopCommerce 4.50 project or solution with existing database. I picked new source code zip and extract it and run.
After running solution, I entered Store information and in Database information I select option for Enter raw connection string (advanced) then i will see there is textbox for Connection string.
I entered my connection strings as below:
Data Source=DESKTOP-MyPC;Initial Catalog=NOP450;Integrated Security=False;Persist Security Info=False;User ID=sa;Password=mypassword;Trust Server Certificate=True


And then i clicked on Install button, I got error for Setup failed: Sequence contains more than one element.

I have to make any changes in App_Data ? This is what happen please suggest solution for this.
1 year ago
You can't run the "Install" process on an existing database.  If your existing database is old, then you may need to manually upgrade it via the SQL Scripts.  If the old DB is 'compatible' (and only needs migrations), then you don't need the scripts.

To point your nopCommerce site to an existing DB ('compatible' version), you just need to copy these files from the \App_Data folder:
appsettings.json
plugins.json

(If you need to upgrade the DB, then see the docs.)
11 months ago
New York wrote:
You can't run the "Install" process on an existing database.  If your existing database is old, then you may need to manually upgrade it via the SQL Scripts.  If the old DB is 'compatible' (and only needs migrations), then you don't need the scripts.

To point your nopCommerce site to an existing DB ('compatible' version), you just need to copy these files from the \App_Data folder:
appsettings.json
plugins.json

(If you need to upgrade the DB, then see the docs.)


This is very correct. And if using Azure App service, ensure to restart your app so that changes take effect.
11 months ago
Even if not "using Azure App service", you need "to restart your app so that changes take effect"
11 months ago
Hello Kamlesh,

This is correct that you shouldn’t install nopCommerce on the existing database because it won’t work.

In this case you should manually configure the database connection string and the app settings file as well which you can copy from any similar nopCommerce installation.
Additionally, if you already know which plugins were installed with their tables then you should manually write the installed plugins information as well.

Hope this helps!

Best regards,
Atul
8 months ago
I don't have dataSettings.json with the latest version. i want install latest one with existing database.
8 months ago
The ConnectionString is in \App_Data\appsettings.json