Start a new topic
Answered

Running multiple databases

Is there a way to have two VC databases on the same instance of SQL Server? I would like to setup my dev machine to have both the demo store available and an empty database to start developing new store.


Since the setup_database.ps1 runs a DLL module, I am not sure how to change it so that a different database name would be used for another database (since VirtoCommerce is already in use by the demo store).


Preferrably it should be also possible to switch between the two both in web and admin frontends.




Best Answer

Yes, you can setup as many databases as you want. 


you can pass parameters to setup-database.ps1, for example you can pass:

./setup-database.ps1 -dbconnection "Server=(local);Database=VirtoCommerce2;Integrated Security=True;"


which will create db with a name VirtoCommerce2, you will then need to modify connectionstring.config file on your website to point to that database. 


You can also do all that using SDK by creating several projects.


Thanks Sasha, that worked.

Answer

Yes, you can setup as many databases as you want. 


you can pass parameters to setup-database.ps1, for example you can pass:

./setup-database.ps1 -dbconnection "Server=(local);Database=VirtoCommerce2;Integrated Security=True;"


which will create db with a name VirtoCommerce2, you will then need to modify connectionstring.config file on your website to point to that database. 


You can also do all that using SDK by creating several projects.

Login or Signup to post a comment