Advanced Installation TopicsSana Commerce Task Service

Sana Commerce Task Service

Sana Commerce 9.0
Your connector

How to Install Task Service?

Sana Commerce scheduled tasks can be installed within the system or as a Windows service.

To install Sana Commerce Task Service:

Step 1: Copy the TaskService folder from the Sana Commerce release package to the server where the Sana Commerce Task Service should be installed.

Step 2: Open the 'Sana.Commerce.TaskService.exe.config' configuration file.

Step 3: In the 'Sana.Commerce.TaskService.exe.config' configuration file you need to enter connection string to the SQL database and the AesKey and AesVector security keys. They can be copied from the 'Web.config' file of the Sana Commerce frontend. As the connection string to the SQL database and security keys are encrypted in the 'Web.config' file of the Sana Commerce frontend, thus you need to decrypt them at first.

  1. Decrypt the following configuration sections of the 'Web.config' file of the Sana Commerce frontend: "connectionStrings" and "sanaCommerce/securityKeys".

    Execute the following command from the command prompt to decrypt each configuration section of the 'Web.config' file:
    aspnet_regiis -pdf [configuration section] [path to the Sana Commerce 'Web.config' file]
    

    Before executing the command enter the configuration section name you are going to decrypt and the path to the 'Web.config' file of the Sana Commerce frontend.

    Example:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pdf "sanaCommerce/securityKeys" C:\inetpub\wwwroot\SanaStoreEnterprise\Frontend
    
  2. When the connection string to the SQL database and security keys are decrypted, copy them to the 'Sana.Commerce.TaskService.exe.config' configuration file.

  3. Now you need to encrypt the following configuration sections of the 'Web.config' file of the Sana Commerce frontend and the 'Sana.Commerce.TaskService.exe.config' configuration file: "connectionStrings" and "sanaCommerce/securityKeys".

    Execute the following command from the command prompt to encrypt each configuration section of the 'Web.config' file of the Sana Commerce frontend and the 'Sana.Commerce.TaskService.exe.config' configuration file:
    aspnet_regiis -pef [configuration section] [path to the 'Web.config' file of the Sana Commerce frontend or path to the 'Sana.Commerce.TaskService.exe.config' configuration file]
    

    Before executing the command enter the configuration section name you are going to encrypt and the path to the 'Web.config' file of the Sana Commerce frontend or path to the 'Sana.Commerce.TaskService.exe.config' configuration file.

    Example:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pef "sanaCommerce/securityKeys" C:\inetpub\wwwroot\SanaStoreEnterprise\Frontend
    
If you install the Sana Commerce Task Service for the Sana Enterprise edition you should also change:
  • The path to the shared index directory.
  • The path to the shared logs directory.

For more information, see 'Install Sana Enterprise'.

Step 4: Open the command prompt, navigate to the 'Sana.Commerce.TaskService.exe' application file and install the Sana Commerce Task Service using the -i parameter:

Sana.Commerce.TaskService.exe -i

When you execute this command it will install the Sana Commerce Task Service.

The table below provides the description of the available parameters:

Parameters Description
-i Install the Windows service with the default name 'Sana Commerce Task Service'.
-i [service name] Install the Windows service with the specified name.
-u Uninstall the Windows service with the default name 'Sana Commerce Task Service'.
-u [service name] Uninstall the Windows service with the specified name.
-run <task name> Run the exact task.
-help View help.

Step 5: Open the 'Web.config' file of the Sana Commerce frontend. Change the value of the TaskServer parameter to 'false' in the <appSettings> configuration section.

Step 6: Copy the Sana license file from the 'bin' folder of the Sana Commerce Frontend to the Task Service folder. This is needed for the 'Sitemap export' task, otherwise it will not work.

Step 7: Open the Microsoft Services Management Console and start the Sana Commerce Task Service.

By default the Sana Commerce Task Service is running under Local Service.

If you install the Sana Commerce Task Service on the same Web server where Sana Commerce is installed you can run it under the same user that is used to run the Sana Commerce application pool.

If the Sana Commerce Task Service is installed on a separate server you can run it under a separate account. If you setup the Sana Commerce Task Service to run under a separate account make sure that this user has read/write permissions to the '@data' folder of the Sana Commerce solution and access to the Sana Commerce database.

When the Sana Commerce Task Service (Windows service) is installed, it will be used to periodically send the request to Sana Admin to keep the connection between the scheduled tasks and Sana Admin instead of the Sana Commerce system task (System - task scheduler).

For more information about Sana Commerce tasks, see 'Scheduled Tasks'.

Scheduled tasks can run on a separate server than the Web server. This allows to distribute the workload across multiple servers. If you install Sana Commerce on multiple servers, in Sana Admin you can configure on which server scheduled tasks should run. For more information, see 'Server Management'.

Advanced Installation TopicsSana Commerce Task Service