DocumentationDataMigrate ProOperation

DataMigrate ProOperation

DataMigrate Pro Synch Service

The Synch Service runs the DataMigrate Pro Service Bus listener as a Windows service. This page explains installation, registration and operation.

This documentation describes how to install and operate the DataMigrate Pro Service Bus listener as a Windows service named "DataMigrate PRO Synch-Service". The guide is based on the available CLI references and the requirements for settings.json.

Overview

The command

PowerShell
DataMigratePro -t listen --install "DataMigrate PRO Synch-Service" --registration "<registration-key>" --tenantid "<TenantID>"

performs the following steps in sequence:

  1. -t listen starts the DataMigrate Pro Azure Service Bus listener. For productive operation, the connection settings are loaded from settings.json.
  2. --install "DataMigrate PRO Synch-Service" installs the listener in the Windows service wrapper (launcher) and sets up the specified service name.
  3. --registration ... --tenantid ... validates and stores the registration/license key and the Azure AD tenant. Without a valid registration, the tool refuses to run the service after a short time.

For the scheduled service mode with serviceSchedule, the following also applies: The service can run as a Windows service even if it was installed directly with sc.exe create. In this case, however, the respective copy of the program must contain a matching settings.json in the same folder.

Prerequisites

  • Windows server with administrator rights (required for the service installation).
  • .NET Desktop Runtime matching the DataMigrate Pro version.
  • Copy of the DataMigrate Pro program folder (including DataMigratePro.exe, DataMigratePro.Launcher.exe, settings.json).
  • Network access to:
  • Registration key (--registration) and Azure AD tenant ID (--tenantid).

Installation steps

  1. Prepare the folder

    • Copy the entire delivery package to C:\Programme\DataMigratePro (or another location without spaces in the path).
    • Make sure that DataMigratePro.exe and DataMigratePro.Launcher.exe are writable so that logs and settings.json can be written.
  2. Create/adjust settings.json

    • Create or update settings.json in the installation folder according to the example in the section Example configuration.
  3. Prepare the registration

    • Open an administrative PowerShell.
    • Navigate to the installation folder: cd C:\Programme\DataMigratePro.
  4. Run the registration

    • Run the command above, but without --install, to validate the license and Service Bus data:
      PowerShell
      .\DataMigratePro.exe -t listen --registration "<registration-key>" --tenantid "<TenantID>"
    • On success, the Service Bus parameters (queue names, connection string) are added to settings.json.
  5. Install the service

    • Then start the final installation:
      PowerShell
      .\DataMigratePro.exe -t listen --install "DataMigrate PRO Synch-Service" --registration "<registration-key>" --tenantid "<TenantID>"
    • The launcher registers a Windows service. The log output is redirected to the Windows event log.
    • For the scheduled service mode with serviceSchedule, a direct sc.exe create installation is also sufficient. What matters then is that the service copy has a matching settings.json in the same folder.
  6. Start the service

    • Open services.msc, find DataMigrate Pro Synch-Service, set the startup type to Automatic, and start the service.

How the Service Bus listener works

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

Flow overview

Diagram 1

Scheduled service mode (serviceSchedule)

This mode is intended for time-controlled single or interval runs that are executed directly in the Windows service. Unlike -t listen, the service does not wait for Service Bus messages but reads the CLI arguments to be executed from settings.json.

Example configuration

JSON
{
   "ServiceSchedule": {
   "CommandArguments": "-t printerdiscovery --listenerconnectionid \"7A7B2D10-8A7A-4C61-9A9A-3C2F5A1C8D2E\" --transactionid \"9D3E5B2C-1A2F-4B7D-9C5E-4A1B2C3D4E5F\"",
      "StartDate": "2026-07-01",
      "EndDate": "2026-12-31",
      "RecurringType": "Interval",
      "RecurringInterval": "01:00:00",
      "StartingTime": "18:00:00",
      "EndingTime": "06:00:00",
      "Days": "Mo,Tu,We,Sa,Su"
   }
}

Important rules

  • CommandArguments contains exactly the DMP call that is to be executed within the time window, for example -t printerdiscovery for a regular update of the printer inventory.
  • RecurringInterval defines the interval between two checks or executions.
  • Days accepts weekday abbreviations such as Mo, Tu, We, Th, Fr, Sa, Su.
  • If StartingTime is later than EndingTime, the window may cross midnight.
  • As usual, the service can be installed either with --install "service name" or directly with sc.exe create.
  • For several parallel instances, we recommend a separate folder per service, each with its own settings.json and its own service name.
  • To remove an installed service, use DataMigratePro.exe --uninstall "service name".

Installation by parameter

PowerShell
DataMigratePro.exe --install "DataMigratePro-Scheduled-Runner" --registration "<registration-key>" --tenantid "<TenantID>"

Installation with sc.exe

PowerShell
sc.exe create "DataMigratePro-Scheduled-Runner" binPath= "\"C:\Programme\DataMigratePro\DataMigratePro.exe\"" start= auto

Then start the service and check the execution in the Windows event logs. In this case, the service starts directly from the folder of the respective copy and reads settings.json from there.

Uninstallation

PowerShell
DataMigratePro.exe --uninstall "DataMigrate PRO Synch-Service"

The command stops the service if it is running and removes the Windows service registration.

Configuration in Business Central

  • The same connectionId must be stored in the Business Central extension as in settings.json, so that messages are unambiguously assigned to the listener.
  • Where possible, use a uniquely generated identifier (for example a GUID or generated password) as the connectionId to rule out overlaps with other integrations.
  • The Business Central configuration also stores the endpoint of the prepared Azure Function together with the access key generated in Azure. Only then can the application successfully place messages in the Service Bus queue.

Example configuration (settings.json)

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/<TenantID>/Production/ODataV4/Upload_LoadData?company=CRONUS%20AG",
  "BlobMagicSignature": [2, 69, 125, 91],
  "IsSaaS": true,
  "Environment": "Production",
  "TenantInfo": {
    "TenantId": "<TenantID>",
    "ClientId": "<Azure AD App ID>",
    "ClientSecret": "<Azure AD App Secret>"
  },
  "ServiceBus": {
    "ServiceBusConnectionString": "Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=<Name>;SharedAccessKey=<Key>",
    "RequestQueueName": "datamigratepro-requests",
    "ResponseQueueName": "datamigratepro-responses",
    "connectionId": "LISTENER"
  }
}

Notes:

  • Set EnableServiceBus to true if this service runs -t listen or listener-based file service, printer, or PowerShell functions. The ServiceBus section is then mandatory; missing values cause a validation exception when the service starts.
  • Align 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, set IsSaaS to false and use BCUser/BCPassword instead of TenantInfo.
  • BlobMagicSignature can be kept as is, unless there is an individual requirement.
  • SqlConnectionStringMigration, AppSourceEnabled, OnPrem, and NewNumbering are no longer added manually. IsSaaS controls SaaS or on-premises behavior and the object numbering.

Verification and maintenance

  1. Check the service status
    • Run Get-Service "DataMigrate PRO Synch-Service" in PowerShell.
  2. Check the log output
  3. Adjust the settings
    • Stop the service first, edit settings.json, and restart the service.
  4. Uninstall the service
    • Run DataMigratePro.exe --uninstall "DataMigrate PRO Synch-Service".

Troubleshooting

Symptom Cause Solution
Service starts and stops immediately Invalid or missing ServiceBus entries Check settings.json, run the registration again
Error message "Registration invalid" Wrong key or tenant ID Check the values, contact support if necessary
No message processing Wrong RequestQueueName or missing permissions Check the queue names and the SAS policy
OAuth authentication fails TenantInfo incomplete or app registration without BC permissions Check the Azure AD app, renew the secret

With this guide, you should be able to install and operate the DataMigrate Pro Synch Service reliably.