Deployments performed in switch mode require two databases, where repository assets are updated on the target site’s inactive database while its live database runs undisturbed. Both databases must begin with identical content. You can ensure this in one of two ways:

Definition files of target site repositories must not contain operation tags such as <add-item>, <update-item>, and <remove-item>. These tags cause switch deployments to fail.

Perform the following steps on the target site ATG servers:

Configure a SwitchingDataSource

Switch deployment uses a SwitchingDataSource (atg.service.jdbc.SwitchingDataSource) instead of a regular data source such as atg.service.jdbc.MonitoredDataSource. During deployment, it typically switches between two data sources. DataSource method calls are passed through to the data source that is specified by the SwitchingDataSource‘s currentDataSource property.

Caution: If you have multiple independent ATG clusters that share a single SDSRepository, each cluster must use a unique set of SwitchingDataSource names. Otherwise, the clusters interfere with each other during the switching process.

Set the following properties of the SwitchingDataSource component:




A ServiceMap of DataSources that maps the short names of data sources to their Nucleus component paths. For example:



The short name of the data source to use as the currentDataSource on the first deployment. On subsequent runs, the initial currentDataSource is obtained from the state recorded in the SDSRepository.


Set with a reference to /atg/dynamo/service/jdbc/SDSRepository.

Specifies the switching data source repository SDSRepository, which monitors which database the switching data source points to at any time.

The following example shows the default settings of the switching datasource used by the Commerce product catalog:

# A map from data source names to data sources

# The name of the data source that should be used on startup