DocumentationDataMigrate ProReference

DataMigrate ProReference

DataMigrate Pro - Extended Switches and BuildMapping Entry Points

This page covers extended switches and BuildMapping entry points in DataMigrate Pro, such as --buildmapping, --buildlocalmapping and --mappingtoazure.

This document complements the quick overview in docs/DataMigratePro-Parameters-Quick-Overview.md. It focuses on additional switches and advanced entry points that are not fully covered there.

1) Additional root entry switches

These switches can start workflows without using -t.

Switch Purpose Notes
--mappingfromazure Pull mapping/config fields from Azure into migration tables Optional: -o export file, -i import file
--mappingtoazure Push migration mapping/config to Azure Upload mode requires --clientid and --clientsecret
--buildmapping Full buildmapping workflow (build + enrich + publish) Main end-to-end mapping pipeline
--buildlocalmapping Local/BC preparation pipeline without final publish+recordcount send Useful for staged operations. For NAV 2009 and older (database version < 7.0) the metadata step uses the rows imported with -t importsourcemetadata; see NAV2009-Source-Metadata-Excel-Import.md
--buildquickautomapping Run quick auto-mapping only Can be scoped and dry-run
--repairrealdbfieldnames Re-resolve stored physical source field names against the source schema Repairs incorrect names; fields whose name exists in no variation in the physical source table are set to Skip (including former primary key fields, whose Primary Key flag is cleared); optional -s <SourceTableNo> limits the operation
--applyconfigurationchanges Apply ConfigurationChangeApplier Standalone step
--sendrecordcounts Send table record counts to BC Standalone step
--checkgetstructurefield Execute structure-field consistency checks Maintenance/diagnostics
--refreshbcstructurestrict Force strict BC structure refresh Maintenance/diagnostics
--applytransformations Run mapping transformation orchestrator only No rebuild, no publish
--analyzetransformations Analyze transformations/report Diagnostics
--comparestructureperformance Compare old/new structure-resolution performance Supports --iterations
--maintaintransfer Maintain $Transfer tables and related SQL artifacts Maintenance
--queuehandling Run queue handling once Returns immediately after processing
--editmapping Open the dedicated mapping editor GUI Starts desktop UI mode for mapping/config editing
--ledgercutoff Open the standalone Ledger Cutoff & Entry Offset window All existing cutoff tabs and functions; separate from mapping editor navigation. Connection options override settings.json. Does not require -t; existing -t ledgercutoffanalyse, ledgercutoffdistribute and ledgercutoffverify remain available. See Ledger Cutoff handbook.
--demo Set up a complete local demo environment Local SQL engine (or LocalDB install), demo database DMP_Demo with finished mapping, demo company in the managed demo sandbox, settings.json, registration. Sub switches: --yes, --gui, --instance <DataSource>, --company <Name>, --refresh. See DataMigratePro-Demo-Mode.md

These switches are used with buildmapping-related entry points.

Switch Used with Purpose
--dryrun --buildquickautomapping Preview affected rows, no write
--scope <t:f,t:f> --buildquickautomapping Limit auto-mapping to source table/field pairs
--mapall --buildquickautomapping Recalculate all rows (not only missing/invalid)

Examples:

PowerShell
DataMigratePro.exe --repairrealdbfieldnames
DataMigratePro.exe --repairrealdbfieldnames -s 18

The command updates field names only when the corresponding physical source column is found. For a source table that can be resolved but has no matching column, an existing invalid field name is cleared and counted as unresolved. If the physical source table itself cannot be resolved, its field names are left unchanged and counted as unresolved. The command does not change Real DB Table Name.

2.1) Mapping editor startup mode

The --editmapping switch starts the dedicated mapping editor GUI and does not require -t.

PowerShell
DataMigratePro.exe --editmapping

Behavior summary:

  • Opens the mapping maintenance UI with navigation for migration tables, destination tables, value mappings, and configuration.
  • Keeps all existing non-UI startup paths unchanged when the switch is not provided.
  • Requires valid data-source connectivity; startup failures are surfaced in the UI to prevent invalid edits.

For detailed functional requirements, see docs/Requirement-editmode-UI.md.

2.2) Demo mode

--demo prepares everything needed to try DataMigrate Pro on one computer and does not require -t:

PowerShell
DataMigratePro.exe --demo            # console wizard with confirmations
DataMigratePro.exe --demo --yes      # unattended
DataMigratePro.exe --demo --gui      # same steps in a window (also: Configuration › Demo setup…)
DataMigratePro.exe --demo --instance .\SQLEXPRESS --company DEMO-SALES --refresh
Sub switch Purpose
--yes Answer all confirmation prompts (LocalDB installation, replacing settings.json) with yes
--gui Show the setup window instead of the console
--instance Use this SQL engine, e.g. .\SQLEXPRESS or (localdb)\MSSQLLocalDB, instead of automatic detection
--company Name of the demo company in the demo sandbox (max. 30 characters; default DEMO-<COMPUTER>-<yyyyMMdd>)
--refresh Download and restore the demo database again even if DMP_Demo exists

The setup is idempotent and transfers no data. The Business Central target of the demo is recorded in settings.json only as "DemoTarget": true; tenant and credentials stay inside the application. Exit codes: 0 success, 1 failure, 2 cancelled.

3) Additional operational switches

These are valid command-line switches parsed by runtime, beyond the quick overview.

3.1 Performance and runtime behavior

Switch Purpose Typical context
--benchmark / --bm Enable benchmark run output putdata, putalldata
--benchmarkjson Force benchmark JSON output mode Benchmark automation
--benchmarkmode Tag benchmark mode label Benchmark comparison
--skipscan Skip pre-scan record metrics putalldata startup acceleration
--mappingparallel Mapping prebuild parallelism putalldata
--putdataretries Override retry attempts for putdata chunk send unstable networks/endpoints
--nobr / --nobrotli Disable Brotli content encoding preference troubleshooting HTTP compression
--parallel Internal putdata parallelism parameter advanced/internal

Note: If ForceSequentialPutDataChunks is set to true in settings.json, effective putdata chunk parallelism is always 1 (sequential), regardless of --parallel.

3.2 Mapping behavior

Switch Purpose Typical context
--usemapping Force use of -m mapping file even when automapping default would apply putdata
--newpayload Prefer new putdata payload format compatibility rollout
--prefernewpayload Alias for new payload preference compatibility rollout
--putdatanew Alias for new payload preference compatibility rollout

3.3 Data target and transport tuning

Switch Purpose Typical context
-ndb Target database name when getdata writes to SQL table via -n getdata
-o getdata: write each received chunk to <dir>/<base>_<n>.json instead of SQL; skips the SQL write, same format as putdata -o; wins over -n/-ndb getdata, putdata
-f canonical With -o: JSON whose field values are rendered in one canonical text form per BC field type (Decimal 14.5, Date 2017-01-26, DateTime 2017-01-26T10:20:30Z, Time 10:20:30.123, DateFormula <30D>, GUID {UPPER}, Boolean true/false, blank dates ''), so putdata and getdata files of the same record compare equal; types come from the mapping DB [BC Field]. Accepted by putdata -i like json getdata, putdata
--batchsize Positive integer record count per batch. For putdata and feature putalldata, overrides byte-based chunking or the feature default of 500; for delete operations, controls records per request. Not a byte size or total-record limit. putdata, deletedata, deletealldata, putalldata feature
--connectionid Explicit service bus/connection context override listener/service scenarios
--sqlconnectionmigration Dedicated migration SQL connection string split SQL topologies
--sourcedbtableprefix Explicit NAV table prefix override special source naming
--blobmagicsignature Override blob magic signature bytes advanced blob staging compatibility

3.4 Legacy compatibility aliases (still accepted)

Switch Purpose Recommended replacement
--azuresqlchunksize Legacy alias for blob staging chunk size --azureblobchunksize
--azuresqlcodeunitid Legacy alias for blob transfer codeunit --azureblobcodeunitid
--subscriptionid Alias for Azure subscription --subscription

3.5 Run-only connection overrides

--environment, --destinationcompany, --mappingdatabase and --migrationdatabase can be combined with any task or root switch. They override the corresponding settings.json values for the current process only and are never written back; all other connection options (--sqlconnection, --sourcecompany, -w, tenant/client/secret, ...) remain persisted.

Switch Effect for this run
--environment SaaS/OAuth: environment segment of the canonical api.businesscentral.dynamics.com/v2.0/{tenant}/{environment}/ODataV4/... endpoint. On-prem: replaces the server-instance segment directly before ODataV4 (e.g. BC230 → BC240).
--destinationcompany Replaces the company= query value of the BC endpoint (SaaS and on-prem).
--mappingdatabase Mapping database used for all SQL access and the schema cache.
--migrationdatabase Migration helper database ($Transfer, listener activity, schema cache tables).

On-prem example: configured EndpointUrl = https://host:7048/BC230/ODataV4/Upload_LoadData?company=CRONUS, started with --environment BC240 --destinationcompany "CRONUS AG" → effective endpoint https://host:7048/BC240/ODataV4/Upload_LoadData?company=CRONUS%20AG; the log/commit endpoints are derived from it. The overrides survive internal settings reloads during the run. When the configured URL has no ODataV4 segment, a warning is logged and the URL is left unchanged. An empty value (e.g. --environment without a name) aborts the run.

4) Listener-only control switches

Use with -t listen.

Switch Purpose
--killpendingtasks Delete pending listener tasks before startup
--finishincompleteasfinished Mark incomplete listener activities as finished at startup

5) BuildMapping phase model

The effective buildmapping pipeline in runtime is composed of these phases:

  1. Validate migration setup (BC Migration Tables/Mapping not empty)
  2. Local mapping build (MappingBuilder.BuildMappingAsync)
  3. Local source structure scan
  4. BC structure phase:
    • Ensure BC structure for buildmapping
    • Run quick auto-mapping
  5. Transformation phase:
    • ApplyAllTransformations
    • ApplyDimensionSetIdFieldPolicy
    • PromoteSynchronizationTypesForEligibleTables
    • ApplyNoMappingConfigurationSynchronizationPolicy
  6. Publish phase:
    • HandleSaveConfigurationAsync
    • SendRecordCountsForAllTablesAsync (for full --buildmapping path)

6) Entry points that reuse buildmapping parts

This is the requested mapping of entry points to buildmapping parts.

Entry point Reuses local build Reuses BC structure + quick automap Reuses transformation phase Reuses publish to BC
--buildmapping yes yes yes yes
--buildlocalmapping yes yes yes no
--buildquickautomapping no quick automapping only no no
Listener action: buildmapping yes yes yes yes
Listener action: buildlocalmapping yes yes yes no

7) Practical examples

Quick automapping dry run on selected fields

PowerShell
DataMigratePro.exe --buildquickautomapping --dryrun --scope "23:11000,39:5005396"

Full buildmapping via dedicated root switch

PowerShell
DataMigratePro.exe --buildmapping

Important:

  • This includes a publish step to BC configuration tables.
  • During publish, BC Migration Tables and BC Migration Mapping are cleared first and then reloaded from the local mapping database.
  • This is an overwrite workflow (replace), not a merge workflow.

Local buildmapping only (no publish)

PowerShell
DataMigratePro.exe --buildlocalmapping

Refresh and rebuild BC structure data (strict)

PowerShell
DataMigratePro.exe --refreshbcstructurestrict

This command reloads BC structure metadata with strict validation before downstream mapping/build steps.

Build local mapping pipeline including BC structure load

PowerShell
DataMigratePro.exe --buildlocalmapping

This runs the local build pipeline and includes BC structure loading plus quick auto-mapping.

Safe sequence when BC structure changed (with backup before overwrite)

1) Backup current BC configuration

PowerShell
DataMigratePro.exe -t loadconfiguration -o config-backup.zip

2) Refresh BC structure metadata strictly

PowerShell
DataMigratePro.exe --refreshbcstructurestrict

3) Rebuild local mapping (no publish yet)

PowerShell
DataMigratePro.exe --buildlocalmapping

4) Publish to BC only when validated

PowerShell
DataMigratePro.exe -t saveconfiguration

This keeps a restore point and avoids unintended data loss if the new structure or mapping needs review first.

PutAllData with benchmark and reduced startup latency

PowerShell
DataMigratePro.exe -t putalldata --tablegroup "1,2" --benchmark --benchmarkmode "full-master" --skipscan

Listener startup cleanup mode

PowerShell
DataMigratePro.exe -t listen --killpendingtasks

8) Stability guidance

  • Preferred for production automation: switches listed in ParameterHelper/CommandMetadata and used in CommandLineProcessor routing.
  • Advanced/internal flags in DataHandler are supported but may evolve faster (for example payload compatibility flags).
  • For scripts, pin executable version and validate against this document after upgrades.