How can I change the DB in Nopcommerce 4.5?

1 week 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 week 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 week 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 week ago
In v4.5 the Connection string is in appsettings.json
src\Presentation\Nop.Web\App_Data\appsettings.json
1 week 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 week 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 week 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 week 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 week 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 week 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!