Install nopCommerce on Existing DB for Version 4.0

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
How do I install nopCommerce on an existing DB in version 4.0?

Will creating `dataSettings.json` in `App_Data` with the proper connection string do it?

I've reviewed these posts but they are for previous versions...

https://www.nopcommerce.com/boards/t/38087/installing-nopcommerce-to-existing-database.aspx

https://www.nopcommerce.com/boards/t/12962/installing-nopcommerce-on-test-server-with-an-existing-database.aspx

https://www.nopcommerce.com/boards/t/12174/connecting-the-new-instance-of-nopcommerce20-to-existing-database.aspx
5 years ago
assuming the db has been updated to 4.0 and all else is good , that should work.
5 years ago
no it doesn't work, it gives below error

Sequence contains more than one element
5 years ago
Are you trying to do an "Install".  You should not if "Install nopCommerce on Existing DB".  As per above, just modify connection string to point to existing DB.
5 years ago
Even after creating `dataSettings.json` in `App_Data` with the proper connection string,it redirect to install page.
4 years ago
Hi,

I've been looking into using nopcommerce for demos during .Net related training workshops, as it is much more appealing than the "Hello World" examples :).

I started from the Dev version in Visual Studio, running it local and works fine, after completing the database install step (pointing to a Azure SQL resource).

when I then publish the source code to Azure Web Apps, it starts again with the install step. If I point to the existing Azure SQL resource, it errors out with

Setup failed: Sequence contains more than one element

seems like more users are complaining about this behavior. I wouldn't mind having it create a new database and running a restore from SQL, but feels weird since all settings remain the same.

thanks for helping, Peter
4 years ago
[email protected] wrote:
Hi,

I've been looking into using nopcommerce for demos during .Net related training workshops, as it is much more appealing than the "Hello World" examples :).

I started from the Dev version in Visual Studio, running it local and works fine, after completing the database install step (pointing to a Azure SQL resource).

when I then publish the source code to Azure Web Apps, it starts again with the install step. If I point to the existing Azure SQL resource, it errors out with

Setup failed: Sequence contains more than one element

seems like more users are complaining about this behavior. I wouldn't mind having it create a new database and running a restore from SQL, but feels weird since all settings remain the same.

thanks for helping, Peter

Did you uncheck Create database if not exist while installing?
4 years ago
Hi,

yes I did check, and both settings are off (create sample data and create db if not exist).

it still results in the error.

When checking the back-end, i noticed, during the first connection to the webapp URL, the datasettings.json gets reset, resulting in empty connection settings. If I edit the datasettings.json by pasting in the connection string info again, save it and reload the webapp using <url>/login, it works.

So this could be a valid workaround for my lab / demo scenarios.

However, I'm also considering moving the app into a Docker container from Visual Studio, which would making this file overwrite a harder process.

thanks, Peter
4 years ago
Hi,

This is an existing issue with nopCommerce. We tried to do this several times but every time it fails. When you try to install nopCommerce on an existing database, it never installs. We need to do that manually by providing existing database connection string in dataSettings.json file under App_Data.

Hope this would help you.

Thank you,
Atul
4 years ago
I've seen the same.  Trying to dockerize my existing install and it's been a real pain since the existing containers don't expose the App_Data directory so it isn't as simple as just "editing the connection string" since you don't have access to it.

Very annoying.

What I've been doing as a workaround:

1. Take SQL Backup
2. Drop Database
3. Do Fresh Install
4. Input connection string you want, let it create a new database.
5. Restore over created database.

This should get you working.

I'm not sure the checkbox is working to not create the database.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.