Skip to content

Configuration

This section explains the different settings you need in the DataSync's appsettings.json file in order to configure it.

Template options

To configure DataSync's templates you need to define the DataSyncTemplateOptions in the appsettings.json file. This configuration has the following structure:

JSON
1
2
3
"DataSyncTemplateOptions": {
    "TemplatesFolderPath": string
}

Where:

  • TemplatesFolderPath: is the directory path where DataSync has to search the template .json files.

Connections options

To configure each application's database connection, you need to define the ConnectionStringsOptions in the appsettings.json file. This configuration has the following structure:

JSON
1
2
3
"ConnectionStringsOptions": {
    "ConnectionPerApplication": ConnectionForApplication[]
}

Connection for application template

Each ConnectionForApplication contains the necessary data to get a valid connection string for an application's database. They have the following structure:

JSON
1
2
3
4
5
6
7
"ConnectionForApplication": {
    "ApplicationCode": string,
    "Version": int,
    "ConnectionString": string,
    "Password": string,
    "PasswordIsEncrypted": boolean,
}

Where:

  • ApplicationCode: is the code of the application.
  • Version: is the version of the application.
  • ConnectionString: is the base connection string to connect the application's database.
  • Password: is the password to be set in the connection string to be able to connect to the database. If it has any value, it will override any password specified in the base `ConnectionString.
  • PasswordIsEncrypted: is a value that indicates whether the provided Password is encrypted or not. It is false by default.

Data gathering options

To configure DataSync's Data-gathering you will need to add the configurations according to the provider you need:

Core Services provider

To use Core Services as provider:

JSON
1
2
3
4
5
6
"DataGatheringCoreServicesProviderModuleOptions": {
    "CoreUrl": string,
    "ClientId": string,
    "Scopes": string[],
    "CoreVersion": string
}

Where:

  • CoreUrl: is the url to communicate with Core Services.
  • ClientId: is the DataSync application client Id, which you can check on Core Administration.
  • Scopes: the list of scopes needed by DataSync to use Core Services.
  • CoreVersion: version of the Core Services' API to use.

Gateway options

To configure DataSync's Gateway you will need to add the configurations according to the provider you need:

File system

To use File system gateway provider:

JSON
1
2
3
4
"GatewayFileSystemProviderModuleOptions": {
    "BasePath": string,
    "MaxFileSize": number
}

Where:

  • BasePath: is the directory path where DataSync will create different sub-folders to hold its files.
  • MaxFileSize: is the max size in bytes that the files to transport are allowed to have, this affects how File Splitting will behave. The default value is 100MB

Scheduling options

To configure DataSync's schedules you need to define the DatasyncSchedulingOptions in the appsettings.json file. This configuration has the following structure:

JSON
1
2
3
"DatasyncSchedulingOptions": {
    "ScheduledJob": ScheduledReplicationTemplate[]
}

Scheduled replication template

Each ScheduledReplicationTemplate has the necessary information for initialize replication operations and must follow the format below:

JSON
1
2
3
4
5
6
7
{
    "Id": string,
    "Applications": string[],
    "Sites": string[],
    "ProcessType": string,
    "IgnoreSequenceNumber": bool,
}

Where:

  • Id: is the Id of the ScheduledReplicationTemplate.
  • Applications: is a list of applications that will perform the replication process.
  • Sites: is a list of Sites which will be replicated.
  • ProcessType: is the type of the replication that will perform. It can be Export, Import or ImportExport (which performs first an import and then an export).
  • IgnoreSequenceNumber: this field indicates when the sequence number in an Import Replication will be ignored. Use false by default.

Example:

JSON
{
    "DatasyncSchedulingOptions": {
        "ScheduledJob": [
            {
                "Id": "1",
                "Applications": ["10001", "10002"],
                "Sites": ["001", "002"],
                "ProcessType": "Export"
            },
            {
                "Id": "2",
                "Applications": ["10001", "10002"],
                "Sites": ["001", "002"],
                "ProcessType": "Import",
                "IgnoreSequenceNumber": "false"
            },
            {
                "Id": "3",
                "Applications": ["10001", "10002"],
                "Sites": ["001", "002"],
                "ProcessType": "ImportExport",
                "IgnoreSequenceNumber": "false"
            }
        ]
    }
}

Notification options

To use Notifications service you need to define the DataSyncNotificationsModuleOptions in the appsettings.json file, adding notification configurations according to your needs:

JSON
1
2
3
"DataSyncNotificationsModuleOptions":{
    "NotificationConfigurations": NotificationConfiguration[]
}

Notification configuration template

Each notification configuration represents a notification to be sent, and must follow this format:

JSON
1
2
3
4
5
{
    "Recipients": string[],
    "Applications": string[],
    "Events": string
}

Where:

  • Recipients: is a list with the emails of the notification recipients. It must not be null nor empty.
  • Applications: is a list with the Application Codes of interest for the notification. If null or empty, the notification will refer to all applications.
  • Events: is the kind of events that trigger this notification. It can be set to: All (any replication event) or Failure (only when an error happens). If null, the default value is Failure.

DbManager options

To configure the way DataSync performs import operations into the database you need to define the DbManagerOptions in the appsettings.json file. This configuration has the following structure:

JSON
1
2
3
4
5
{
    "BatchSize": int,
    "AllowBulkOperations": bool,
    "AllowTemporalTableUsage": bool
}

Where:

  • BatchSize: sets the amount of rows the DbManager will try to import at a time if bulk operations are enabled.
  • AllowBulkOperations: enables/disables bulk operations.
  • AllowTemporalTableUsage: allows or prevents the use of temporal tables to perform the import operations if bulk operations are enabled. It greatly improves the performance but may be limited by the underlying database engine.

Warning

The BatchSize must be a value greater than 0, and if the value is less than 10 then no bulk operations will be performed.

Warning

AllowTemporalTableUsage should be disabled for databases in SQLServer versions lower than 2016.