Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Self-managed start with Configured Commerce

Add the domain to the Admin Console

For the Admin Console to display the contents of the website within the newly created domain, it needs to be added to the Admin Console. Complete the following steps to add the domain to the Admin Console:

  1. Go to Admin Console > Websites.
  2. Click Edit for the desired Website or click Add Website.
  3. On the Details finger tab, enter the appropriate domains in the Domain Name(s) field.
  4. Click Save.

At the time the Admin Console is first accessed, after configuration of the Domain Name(s) field (Admin Console > Websites), the service will make a call to the Configured Commerce licensing server. If the domain exists in the registry, it will perform a date check. If it passes, the user will be authenticated into the Admin Console. If the domain does not exist in the registry, it will be created with a 30 day temporary license. This procedure allows the use of Configured Commerce for 30 days. Following this process allows development teams to use additional domains such as qa.yourdomain.com, dev.yourdomain.com and so forth. Each domain respectively will be registered with a 30 day temporary license when the Admin Console is accessed for the first time.

If an error occurs during the call to Configured Commerce, it will issue at Temporary license and recheck in 10 days.

To support ongoing development, it is common for development teams to submit tickets to Optimizely Customer Success requesting that development environment domains be converted to permanent domains. Use the Submit a Ticket link at the top of page to make this request.

Additionally, Configured Commerce provides developers with a test URL of the format *.local.com which has a permanent license.

Move content between pilot sandbox and production environment

When a customer is working on a new site, they are generally creating and modifying their content in the pilot/sandbox environment until they are ready to go live. During that process, it is common to want to move the content from one site to another.

This data is contained within several tables: ContentItem, ContentItemField, and ContentPageState.

This document will outline the general approach to migrating this data from one place to another. There is an assumption that the database lives on separate servers.

In general, the approach is to create a transfer database, populate it with the data to move, move the db to the new environment and merge the data. The scripts and documentation below adhere to this approach.

It is further presumed by this documentation that the user wishes to copy the content from the Sandbox (pilot) server to the Production server. We will be using the database named ContentTransfer for the transfer db and Insite.Commerce.SourceDB for the source database and Insite.Commerce.TargetDB for the targetDB. It is more likely that the source and target databases will be named the same, just reside on different servers.

  1. Create an empty transfer database on the Sandbox server.

  2. The scripts will resolve any differences in native IDs for the language, user, and persona but the website ID MUST MATCH EXACTLY between the two systems. If they don't once you have the data in the ContentTransfer tables, update the WebsiteId.

  3. The personas and language must exist in the target db even if they may not have the same ID values- the script will use the natural keys to find the corresponding language and persona and reassign it.

  4. Because content has users, language and persona associated with it, we will need to isolate the associated data in the content tables and insure it is available as we post it over ot the target db. Use the following:

    USE [ContentTransfer]
    IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ContentPageState')  DROP TABLE ContentPageState
    IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ContentItemField') DROP TABLE ContentItemField
    IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ContentItem') DROP TABLE ContentItem
    IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'UserProfile') DROP TABLE UserProfile
    IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Language') DROP TABLE Language
    IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Persona') DROP TABLE Persona
    GO
    USE [Insite.Commerce.SourceDB]
    SELECT * INTO ContentTransfer.dbo.ContentItem FROM ContentItem
    SELECT * INTO ContentTransfer.dbo.ContentItemField FROM ContentItemField
    SELECT * INTO ContentTransfer.dbo.ContentPageState FROM ContentPageState
    SELECT * INTO ContentTransfer.dbo.Language FROM Language
    SELECT * INTO ContentTransfer.dbo.Persona FROM Persona
    SELECT * INTO ContentTransfer.dbo.UserProfile FROM UserProfile WHERE ID IN
    (SELECT DISTINCT CreatedById FROM ContentItem WHERE CreatedById IS NOT NULL
    UNION
    SELECT DISTINCT ApprovedById FROM ContentItem WHERE ApprovedById IS NOT NULL
    UNION
    SELECT DISTINCT CreatedById FROM ContentItemField WHERE CreatedById IS NOT NULL
    UNION
    SELECT DISTINCT ApprovedById FROM ContentItemField WHERE ApprovedById IS NOT NULL)
                          ```
    
  5. The steps above effectively gather all the data required to transfer the data. Next take a backup of the ContentTransfer db and restore it in the target environment and run the following script to replace the target data with the source data.

    📘

    Note

    This will overwrite any existing CMS content with the new data. Make sure to have a backup of the target db in case there is an issue and do this in off hours so that you can restore the db if there is a problem.

    Product content, dealer content, specifications and category content are stored in different tables and this is not going to affect that data.

    -- Script to reset any IDs in the source tables
    BEGIN TRANSACTION
    USE ContentTransfer
    ALTER TABLE Persona ADD  NewId uniqueidentifier NULL
    ALTER TABLE Language ADD  NewId uniqueidentifier NULL
    ALTER TABLE UserProfile ADD  NewId uniqueidentifier NULL
    GO
    UPDATE Persona SET NewId = (SELECT Id from [Insite.Commerce.TargetDB].dbo.Persona np WHERE np.Name = Persona.name)
    UPDATE Persona SET NewId = (SELECT Id from [Insite.Commerce.TargetDB].dbo.Persona np where np.IsDefault = 1) WHERE Persona.NewId IS NULL
    UPDATE Language SET NewId = (SELECT Id from [Insite.Commerce.TargetDB].dbo.Language nl WHERE nl.LanguageCode = Language.LanguageCode)
    UPDATE Language SET NewId = (SELECT Id from [Insite.Commerce.TargetDB].dbo.Language nl where nl.IsDefault = 1) WHERE Language.NewId IS NULL
    UPDATE UserProfile SET NewId = (SELECT Id from [Insite.Commerce.TargetDB].dbo.UserProfile nup WHERE nup.Id = UserProfile.Id)
    UPDATE UserProfile SET NewId = (SELECT Id from [Insite.Commerce.TargetDB].dbo.UserProfile nup WHERE nup.UserName = UserProfile.UserName) WHERE UserProfile.NewId IS NULL
    INSERT INTO [Insite.Commerce.TargetDB].dbo.UserProfile (Id, FirstName,LastName,Phone,UserName,IsGuest,IsDeactivated)
    (SELECT Id, FirstName,LastName,Phone,UserName,IsGuest, 1 FROM UserProfile WHERE NewId IS NULL)
    UPDATE UserProfile SET NewId = Id WHERE NewId IS NULL
    GO
    -- Copy IDs back into target tables
    UPDATE ContentPageState SET LanguageId = (SELECT NewId FROM Language WHERE Language.Id = ContentPageState.LanguageId)
    UPDATE ContentPageState SET PersonaId = (SELECT NewId FROM Persona WHERE Persona.Id = ContentPageState.PersonaId)
    UPDATE ContentItemField SET LanguageId = (SELECT NewId FROM Language WHERE Language.Id = ContentItemField.LanguageId)
    UPDATE ContentItemField SET PersonaId = (SELECT NewId FROM Persona WHERE Persona.Id = ContentItemField.PersonaId)
    UPDATE ContentItemField SET CreatedById = (SELECT NewId FROM UserProfile WHERE UserProfile.Id = ContentItemField.CreatedById)
    UPDATE ContentItemField SET ApprovedById = (SELECT NewId FROM UserProfile WHERE UserProfile.Id = ContentItemField.ApprovedById)
    UPDATE ContentItem SET CreatedById = (SELECT NewId FROM UserProfile WHERE UserProfile.Id = ContentItem.CreatedById)
    UPDATE ContentItem SET ApprovedById = (SELECT NewId FROM UserProfile WHERE UserProfile.Id = ContentItem.ApprovedById)
    GO
    -- Reform transfer files to original mode
    UPDATE Language SET Id = NewId
    UPDATE Persona SET Id = NewId
    UPDATE UserProfile SET Id = NewId
    ALTER TABLE Language DROP COLUMN NewId    ALTER TABLE Persona DROP COLUMN NewId
    ALTER TABLE UserProfile DROP COLUMN NewId
    GO
    -- Script to repopulate the data
    USE [Insite.Commerce.TargetDb]
    DELETE FROM ContentPageState
    DELETE FROM ContentItemField
    DELETE FROM ContentItem
    INSERT into ContentItem SELECT * FROM [ContentTransfer].dbo.ContentItem
    INSERT INTO ContentItemField SELECT * FROM [ContentTransfer].dbo.ContentItemField
    INSERT INTO ContentPageState SELECT * FROM [ContentTransfer].dbo.ContentPageState
    GO
    COMMIT TRANSACTION
                          ```
    

Work with favicons

A favicon (favorite icon) is the small image associated to the website displayed in various locations: browser tabs, address bar, browser history, and so on. Favicons are important to a website for many reasons which includes helping drive brand awareness by displaying the company logo and colors in multiple locations, as well as making your website easier to distinguish when working with multiple webpages in a browser.

Favicons can be found in multiple sizes and formats: 16 x 16, 32 x 32, 48 x 48, or 64 x 64 pixels in size, and 8-bit, 24-bit, or 32-bit in color depth; however, the recommended size is 16 x 16. They can also be created in multiple formats: .gif, .png, jpeg. However, the industry standard for sometime now is the .ico format.

Add a favicon to a site

  1. Access the Admin Console.

  2. Go to Websites select a website.

  3. Click Edit.

  4. Within the Details tab, click Browse adjacent to the Website Favicon field.

  5. Select the desired image.

    📘

    Note

    There are multiple favicon generators available online if you don't have access to an existing favicon image file.

  6. Click Save to accept changes.

📘

Note

It may take several minutes for the Favicon to appear on the website's tab.