Copying a nopCommerce environment to a destination such as your local machine or to another environment requires two major steps:
- Copying the database
- Cloning the source code and configuring to use the copied database
Copy The Database
- Using SSMS, log in to the source database server using administrative credentials (usually the remote environment).
- On source database server, right-click on database and click Tasks -> Export Data-tier Application
- Save the .bacpac file to the destination machine.
- Connect to the destination database server (usually local).
- Right-click ‘Databases’ on the destination server and click ‘Import Data-tier Application’.
- Use the .bacpac file created from the source database.
Copy and Configure the Source Code
- Clone the source code to the destination machine.
- Create the /Presentation/Nop.Web/App_Data/dataSettings.json file with the following content:
Next, verify the site can be accessed.
Finally, make sure to change the store URL to the new URL being used.
Troubleshooting with Nop-templates
If you’re using nop-templates, you’ll run into some issues when trying to copy.
I had to delete all contents from the following SQL table:
delete from SS_C_Condition
Of course, this currently disables all HTML Widgets – so there must be a better way to do this. Take a look at https://www.nopcommerce.com/boards/t/50457/adding-or-editing-quick-tab-item-with-same-key-already-added.aspx