DataMigrate PRO Synch Service

This documentation describes the installation and operation of the DataMigrate PRO Service Bus Listener as a Windows service under the name “DataMigrate PRO Synch Service”. The instructions are based on the available CLI references and the specifications for settings.json.

Overview

The command

DataMigratePro -t listen --install "DataMigrate PRO Synch-Service" --registration "<dein-registrierungsschlüssel>" --tenantid "<deine-tenant-id>"

Carry out the following steps one after the other:

  1. -t listen starts the Azure Service Bus Listener of DataMigrate PRO. For productive operation, the connection settings are loaded from settings.json.
  2. --install "DataMigrate PRO Synch-Service DWP" installs the listener in the Windows service wrapper (launcher) and sets up the specified service name.
  3. --registration ... --tenantid ... checks and saves the registration/license key and the Azure AD client. Without a valid registration, the tool will refuse service operation after a short time.

Prerequisites

  • Windows server with administrator rights (required for service installation).
  • Copy of the DataMigratePro program folder (incl. DataMigratePro.exe, settings.json).
  • Network access to:
    • SQL Server of the Business Central databases.
    • Business Central OData endpoint (Upload_LoadData).
    • Azure Service Bus namespace for incoming orders.
  • SQL authorizations for the service User
    • At least db_reader on Business Central databases
    • If the migration and mapping database has been created, give authorization to this db_owner
  • Registration key (--registration) and Azure AD Tenant ID (--tenantid).

Installation steps

  1. Prepare folder
    • Copy the entire scope of delivery to C:\Programme\DataMigratePro (or another destination without spaces in the path).
    • Make sure that DataMigratePro.exe and settings.json are accessible and that the service user is authorized to create the logs directory in the path and write log files there.
  2. create/customize settings.json
    • Create or update settings.json in the installation folder according to the example in the Example configuration section.
  3. Prepare registration
    • Open an administrative PowerShell.
    • Navigate to the installation folder: cd C:\Programme\DataMigratePro.
  4. Execute registration
    • Execute the command above, but without --install, to validate license and service bus data:
    • .\DataMigratePro.exe -t listen –registration “” –tenantid “
    • If successful, the service bus parameters (queue name, connection string) are added to settings.json.
  5. Install service
    • Then start the final installation:.\DataMigratePro.exe -t listen –install “DataMigrate PRO Synch-Service” –registration “” –tenantid “
    • The launcher registers a Windows service. The log output is redirected to the Windows event log.
  6. Start service
    • Open services.msc, search for DataMigrate PRO Synch-Service DWP, set the start type to Automatic and start the service.

Functionality of the service bus listener

  • The listener monitors the configured RequestQueueName for incoming messages. Each message triggers the DataMigrate PRO data processing pipeline.
  • Replies and status messages are written on ResponseQueueName.
  • The loop runs continuously and uses short polling intervals (approx. 1 second) to detect new messages.
  • Errors are written to the Windows event log; in the event of serious errors, the service stops with a corresponding error code.

Configuration in Business Central

  • n the Business Central extension, the same connectionId must be stored as in the settings.json so that messages are clearly assigned to the listener.
  • If possible, use a uniquely generated identifier (e.g. GUID or generated password) as connectionId to prevent overlaps with other integrations.
  • The endpoint of the prepared Azure function, including the access key generated in Azure, is also stored in the Business Central configuration. This is the only way the application can successfully place messages in the service bus queue.

Example configuration (settings.json)

{
  "SqlConnectionString": "Data Source=SQLSERVER;Initial Catalog=BC_PROD;Integrated Security=SSPI;",
  "SourceCompany": "CRONUS AG",
  "DestinationCompany": "CRONUS AG",
  "SourceDatabase": "BC_PROD",
  "MappingDatabase": "BC_PROD",
  "MigrationDatabase": "BC_MIGRATION",
  "EndpointUrl": "https://api.businesscentral.dynamics.com/v2.0/<deine-tenant-id>/Production/ODataV4/Upload_LoadData?company=CRONUS%20AG",
  "BlobMagicSignature": [2, 69, 125, 91],
  "IsSaaS": true,
  "Environment": "Production",
  "TenantInfo": {
    "TenantId": "<deine-tenant-id>",
    "ClientId": "<Azure AD App ID>",
    "ClientSecret": "<Azure AD App Secret>"
  },
  "HttpClientTimeoutSeconds": 100,
  "ServiceBus": {
    "ServiceBusConnectionString": "Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=<Name>;SharedAccessKey=<Key>",
    "RequestQueueName": "<deine-request-queue>",
    "ResponseQueueName": "<deine-response-queue>",
    "connectionId": "<deine-connection-id>"
  }
}

Notes:

  • The ServiceBus section is mandatory for -t listen. Missing values lead to a validation exception when the service is started.
  • Match the connectionId entered here with the configuration in Business Central. Use a unique identifier to avoid incorrect assignments.
  • TenantInfo is required for SaaS/OAuth. For on-premises operation, use IsSaaS on false and use BCUser/BCPassword instead of TenantInfo.
  • BlobMagicSignature can be adopted if there are no individual specifications.
  • Further optional settings such as SqlConnectionStringMigration or AppSourceEnabled can be added if required.

Inspection and maintenance

  1. Check service status
    • Get-Service "DataMigrate PRO Synch-Service" in PowerShell.
  2. Check log outputs
    • Event Viewer → Application and Service LogsDataMigratePro.
  3. Adjust settings
    • Stop the service beforehand, edit settings.json, restart the service.
  4. Uninstall service
    • DataMigratePro.exe --uninstall "DataMigrate PRO Synch-Service" execute.

Troubleshooting

SymptomCauseSolution
Service starts and stops immediatelyInvalid or missing ServiceBus entriessettings.json check, execute registration again
Error message “Registration invalid”Incorrect key or tenant IDCheck values, contact support if necessary
No message processingIncorrect RequestQueueName or missing authorizationsCheck queue names and SAS policy
OAuth authentication failsTenantInfo Incomplete or app registration without BC authorizationsCheck Azure AD app, renew secret