Site synchronization key
When you use the SiteSync module to promote content form one environment to another, SiteSync takes care of creating the items on the destination environment with the same ID that they have on the source environment. However, if you have enabled user input on your website frontend, for example by using Forums or Forms modules, new content items will be created in parallel on the destination environment. Each of these items will have a new unique ID assigned. There is a risk that some of these user-generated items end up having the same ID as other content items which have been generated on the source environment. When promoting content via SiteSync, if an item with the same ID already exists in the destination environment database this will cause conflicts and unexpected behavior.
To address this risk SiteSync introduces the concept of a Site key, which is a number between 0 and 100. The site key participates in the Sitefinity CMS incremental GUID generation algorithm, ensuring that any GUID generated with one site key is different from any GUID generated with any other key. Thus, when you configure different Site key on each environment, items created on your staging environment have IDs that are guaranteed to be different from the IDs of the items created in parallel on your production environment. This mechanism guarantees no ID clashes during synchronization.
By default, the source environment does not need to have a Site key explicitly configured (it defaults to 0), unless it serves as both source and destination (for example a Staging environment in a setup like Content authoring -> Staging -> Production). You must configure a Site for any of the environments that serve as destination for content promotion via SiteSync. The Site key of the next destination environment must always be incremental to the one configured on the previous destination environment. For example, if you have Content authoring -> Staging -> production, and you have configured Staging to have a Site key value 1, the value on Production must be 2.
IMPORTANT: By default, the Site key is stored in the Sitefinity CMS configuration files (DataConfig.config). If you need to restore your website database from a destination environment to the source environment (for example Production to Staging), or to a previous destination environment (in cases of multiple destinations, like Content Authoring -> Staging -> Production), by default you don't need to re-configure the Site key on your environments. The only exception is if you are using configuration storage mode Database, which instructs Sitefinity CMS to store it in the database, or if you are restoring both the database and configuration files (this approach should not be used when you have Continuous Delivery process). In such cases you must set a unique Site key, immediately (before creating any new content) after the restore. Otherwise, you allow for a period of time during which both servers can generate identical IDs for different objects. Make sure to follow the requirement for Site key to be incremental for each destination environment, as described in the instructions in this article. No matter how many times you restore the database and configuration files, you can set the same site keys. The only requirement is for them to be unique for each environment, and be incremental for each destination environment.