Set up a Commerce Server site
When you set up a Commerce Server site, you perform the following tasks:
The commands in the following tasks require PowerShell 4.0 or later.
Initialize the Commerce Server site and web services
To initialize the Commerce Server site:
- Open a PowerShell window.
- Set the PowerShell script execution policy to
unrestricted:
Set-ExecutionPolicy Unrestrictedand selectY. - Navigate to your Sitecore website directory. For example:
C:\> cd C:\inetpub\CFRefStorefront\Website - Run the
Initialize-CSSitecommand:C:\inetpub\CFRefStorefront\Website> Initialize-CSSite - Create the Commerce Server Web Services. Make sure the app pool identity for each Web
Service is set to
'.\CSFndRuntimeUser'.- Run the following command to create the Commerce Server Catalog Web Service:
New-CSWebService -Name "CFSolutionStorefrontsite" -Resource Catalog -IISSite "CSServices" -AppPool "CSServices" -Identity 'CSFndRuntimeUser' -Password 'YourPassword' - Run the following command to create the Commerce Server Profiles Web
Service:
New-CSWebService -Name "CFSolutionStorefrontsite" -Resource Profiles -IISSite "CSServices" -AppPool "CSServices" -Identity 'CSFndRuntimeUser' -Password 'YourPassword'
- Run the following command to create the Commerce Server Catalog Web Service:
- Configure role-based permissions for each Web Service identity (via the Windows
Authorization Store):
- Configure administrator permissions for the Catalog Web Service
identity:
Grant-CSCatalogWebServicePermissions –File "C:\inetpub\csservices\CFSolutionStorefrontsite_CatalogWebService\CatalogAuthorizationStore.xml" -Identity "CSFndRuntimeUser" -Role "Administrator" - Configure administrator permissions for the Profile Web Service identity:
Grant-CSProfilesWebServicePermissions –File "C:\inetpub\csservices\CFSolutionStorefrontsite_ProfilesWebService\ProfilesAuthorizationStore.xml" -Identity "CSFndRuntimeUser" -Role "ProfileAdministrator"
- Configure administrator permissions for the Catalog Web Service
identity:
- Set the inventory subsystem to display out of stock SKUs by running the following
command:
Set-CSSiteResourceProperty -Name "CFSolutionStorefrontSite" –Resource "Inventory" -PropertyName "f_display_oos_skus" -PropertyValue $true
Update the Commerce Server Profile Schema
- Open a new command prompt window.
- Create encryption keys for the CFSolutionStorefrontSite.
- Run the
ProfileKeyManager.exeto generate encryption keys:ProfileKeyManager.exe /kn /o "c:\profileEncryptionKeys.xml" /fNote: By default, theProfileKeyManager.exefile is installed underC:\Program Files (x86)\Commerce Server 11\Tools. - Add the encryption keys to the Windows registry:
ProfileKeyManager.exe /ke /kf "c:\profileEncryptionKeys.xml" /reg HKEY_LOCAL_MACHINE\SOFTWARE\CommerceServer\Encryption\Keys\CFSolutionStorefrontSite /fNote: You can confirm that the correct registry path is configured in theWebsite\App_Config\CommerceServer.Core.configfile, under the Sitecore folder.
- Run the
- Update the Commerce Server Profile schema by deploying the Commerce Storefront Profile
Database DAC package, using the following command:
"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:".\Database\Profiles\Commerce.Storefront.ProfileDatabase.dacpac" /TargetDatabaseName:CFSolutionStorefrontSite_profiles /TargetServerName:"127.0.0.1"Note: You must delete any existing data inside the Commerce Server Profile databases before deploying the DAC package. Otherwise, the command fails.Note: Adjust the path to thesqlpackage.exetool (and the target server) if different from the path shown above. - If you received an error message while installing the
Sitecore.Reference.Storefront.Powered.by.SitecoreCommerce.10.0.xxx.updatepackage, reinstall the package.