Skip to content
Last update: January 30, 2024

Configuring VC with DB Providers

Virto Commerce is built on a DB agnostic architecture. The following databases are supported out of the box:

  • Microsoft SQL Server.
  • MySql Server.
  • PostgreSQL.

At the same time, Virto Commerce Architectire allows you add custom database provider on top of Entity Framework for solution as well as for a specific module.

Select the tab with the required provider setup information.

Supported version: Microsoft SQL Server 2019 or higher

To setup DB Provider:

  1. Install and configure database. Run the SQL command CREATE DATABASE [database_name]; to create a new database.
  2. Create a user with access to the database.
  3. Open the appsettings.json file in Visual Studio or other text editor.
  4. Change DatabaseProvider to "SqlServer".
  5. Change ConnectionStrings as follows:

    "DatabaseProvider": "SqlServer",
    "ConnectionStrings": {
    "VirtoCommerce": "Data Source=(local);Initial Catalog=VirtoCommerce3;Persist Security Info=True;User ID=virto;Password=virto;Connect Timeout=30;TrustServerCertificate=True;"
    },
    

Supported version: MySql Server 5.7 or higher.

To setup DB Provider:

  1. Install and configure database. Run the SQL command CREATE DATABASE [database_name]; to create a new database.
  2. Create a user with access to the database.
  3. Open the appsettings.json file in Visual Studio or other text editor.
  4. Change DatabaseProvider to "MySql".
  5. Change ConnectionStrings as follows:

    "DatabaseProvider": "MySql",
    "ConnectionStrings": {
    "VirtoCommerce": "Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"
    },
    

    or

    "DatabaseProvider": "MySql",
    "ConnectionStrings": {
    "VirtoCommerce": "Server=127.0.0.1;Port=6306;Uid=root;Pwd=Password1;Database=VirtoCommerce3;"
    },
    

Supported version: PostgreSQL 12 or higher.

To setup DB Provider:

  1. Install and configure database. Run the SQL command CREATE DATABASE [database_name]; to create a new database.
  2. Create a user with access to the database.
  3. Open the appsettings.json file in Visual Studio or other text editor.
  4. Change DatabaseProvider to "PostgreSql".
  5. Change "ConnectionString" as follows:

    "DatabaseProvider": "PostgreSql",
    "ConnectionStrings": {
    "VirtoCommerce": "User ID=postgres;Password=password;Host=localhost;Port=5432;Database=virtocommerce3;"
    },