InstallationDeveloper Workstation Installation

Developer Workstation Installation

Setup the SQL Database

Sana Commerce uses a SQL database to store content, product enrichments, multi-site and multi-language information. Besides, it also contains membership tables in which user and password information of BackOffice users is stored. 
 
To be able to work with SQL Database Engine, your login should be a member of the sysadmin fixed server role. Members of this role can perform any activity in the Database Engine. By default, all members of the Windows BUILTIN\Administrators group (the local administrators group) are members of the sysadmin fixed server role. 
 
To setup this database, you should do the following steps:
  • Open the SQL Management Studio and connect to the SQL server instance where you want to install the database;
  • Expand the SQL server instance in the object explorer, click right on the 'databases' node and select 'Restore database';

     
    Beginning the Restoration of the Database 

  • Enter a database name in the Restore database window and select the Sana Commerce SQL backup file in the file system in the 'Source for restore > From device' section. In the directory where you have extracted the Sana Commerce zip file go to the 'Database\Full database' directory to locate the 'SanaCommerce.bak' SQL backup file;
  • Check the 'Restore' check box;

     
    Selecting the Sana Commerce Database for Restore Operation 

  • Go to the 'Options' page and set the destination of the new database and .log file by clicking the button next to the 'Restore As' column (we recommend to choose the SQL Server 'database' directory: 'Microsoft SQL Server\MSSQL.1\MSSQL\Data');

     
    Specifying Files for the Restored Database

  • Give the appropriate names to the database and .log files (their extensions should be '.mdf' and '.ldf' respectively);

     
    Saving the Database and .log Files

  • Check the 'Overwrite the existing database' check box in the 'Restore options' section;
  • Click 'OK' to create the database.

     
    Successful Restoration of the Database 
Since the Sana Commerce database has a limited size (5MB out of the box), we advise you to set the Recovery model to 'Full' ('Database Properties > Options page > Recovery model' dropdown) in order to guarantee the integrity of your data. 

There are two ways to make sure the database is accessible from the Sana Commerce webshop and backoffice:

Use SQL Authentication 
If you are going to use this type of authentication, please check if it is enabled in SQL Server. Click right on the SQL server instance and select 'Properties > Security'. Make sure that the 'SQL Server and Windows Authentication mode' is selected in the 'Server authentication' section: 
 
   
Enabling the SQL Server and Windows Authentication Mode 
  • Open the 'SQL server instance > Security', right-click on the 'Logins' folder and select 'New login';
  • Enter a new username and switch to the 'SQL Server authentication' option;
  • Enter a password and confirm it in the second textbox;
  • Select the new created Sana Commerce database as the Default database;
 
 
SQL Server password complexity policies are designed to deter brute force attacks by increasing the number of possible passwords.
  • When the check box 'Enforce password policy' is checked new passwords must meet the following guidelines:
    • The password does not contain all or a 'part' of the user's account name. A 'part' of an account name is defined as three or more consecutive alpha-numeric characters delimited on both ends by 'white space' (space, tab, return) or any of the following characters: , . - _ #.
    • The password is at least six characters long
    • The password contains characters from three of the following four categories:
    • English uppercase letters (A - Z)
    • English lowercase letters (a - z)
    • Base 10 digits (0 - 9)
    • Non-alphanumeric (For example: !, $, #, or %).
  • Password expiration policies are used to manage the lifespan of a password. When the check box 'Enforce password policy' is checked, users are reminded to change old passwords and accounts with expired passwords are disabled.
  • When the check box 'User must change password at next login' is checked, the SQL Server will prompt the user for a new password the first time the new login is used.
Please note that password policies for SQL logins require Windows Server 2003 or later versions. If a Sana Commerce project is installed on a workstation with Windows XP,  you need to uncheck the 'Enforce password policy' check box. 
 
               
              Selecting the 'SQL Server' Option 
  • Go to the 'User Mapping' page, Check the Map-check box in the Sana Commerce database and check the 'db_owner' role in the membership role list;

     
    Specifying the Database and Roles for New Login

  • Click the 'OK' button to finish the setup.

Use Windows Authentication 

  • Open the 'SQL server instance > Security, click right on the logins folder and select 'New login'. (If the windows user already has rights for the SQL server instance, please select the properties of this user instead of creating a new one);
  • Enter the windows username in the 'Login name' textbox. You can use 'search' to lookup users (e.g. in Active Directory);
  • Select the created Sana Commerce database as the 'Default' database;

     
    Selecting the 'Windows Authentication' Option 

  • Go to the 'User Mapping' option, check the Map-check box in the Sana Commerce database and check the 'db_owner' role in the membership role list;

     
    Specifying the Database and Roles for New Login 

  • Click the 'OK' button to finish the setup. 
InstallationDeveloper Workstation Installation