How can I change the DB in Nopcommerce 4.5?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 year ago
I'm working on nop 4.5. I have 2 databases (both in ms SQL server management studio). I want to change the database from db1 to db2. Both are DBs compatible with Nop as  I was working on 2 similar projects.
1 year ago
ckvigneshccts wrote:
I'm working on nop 4.5. I have 2 databases (both in ms SQL server management studio). I want to change the database from db1 to db2. Both are DBs compatible with Nop as  I was working on 2 similar projects.


If you simply want to change db then you can change from connection string from app setting file or app setting from admin side.
1 year ago
forefront wrote:
I'm working on nop 4.5. I have 2 databases (both in ms SQL server management studio). I want to change the database from db1 to db2. Both are DBs compatible with Nop as  I was working on 2 similar projects.

If you simply want to change db then you can change from connection string from app setting file or app setting from admin side.


Thanks a lot for that. Can you please tell me where I can see the app setting file? a path for it would be great? I could not fine the app settings txt/json which was mentioned in the older versions of nop.
1 year ago
In v4.5 the Connection string is in appsettings.json
src\Presentation\Nop.Web\App_Data\appsettings.json
1 year ago
Yidna wrote:
In v4.5 the Connection string is in appsettings.json
src\Presentation\Nop.Web\App_Data\appsettings.json


Thanks a lot
1 year ago
Yidna wrote:
In v4.5 the Connection string is in appsettings.json
src\Presentation\Nop.Web\App_Data\appsettings.json


Hi @Yidna, This  is the folder I see. Could not locate the json file.



Is it under a different directory or name?
1 year ago
1. Can you check on file explorer level ?
2. Make sure your open correct project ? looks like you didn't run this project before? run it and see which screen you are seeing in browser? share screenshot here.

Thanks,
Jatin
1 year ago
forefront wrote:
1. Can you check on file explorer level ?
2. Make sure your open correct project ? looks like you didn't run this project before? run it and see which screen you are seeing in browser? share screenshot here.

Thanks,
Jatin


Hi Jatin.  I got it. Thanks. Found it from my file explorer. Couldn't see it in the VS solution explorer...that cause confusion. Apologies. @Yidna
1 year ago
Yes, as per the Nop.Web's .csproj file, it's excluded purposely (because it should not be "published" to production, etc.)

  <ItemGroup>
    <!-- We copy the entire \App_Data directory. But we ignore JSON files and data protection keys  -->
    <Content Include="App_Data\**" CopyToPublishDirectory="PreserveNewest" Exclude="App_Data\*.json" />
    <Content Remove="App_Data\*.json" />
1 year ago
New York wrote:
Yes, as per the Nop.Web's .csproj file, it's excluded purposely (because it should not be "published" to production, etc.)

  <ItemGroup>
    <!-- We copy the entire \App_Data directory. But we ignore JSON files and data protection keys  -->
    <Content Include="App_Data\**" CopyToPublishDirectory="PreserveNewest" Exclude="App_Data\*.json" />
    <Content Remove="App_Data\*.json" />


Thanks! Much appreciated!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.