Migrate Master Data
The second wizard loads the data rows from MDS into entities that already exist in Primentra. Run Migrate Models & Entities first.
Open Settings › Migration Wizards › Master Data Import, or click Import Data on the result screen of the first wizard.
The wizard has four steps: Instructions, Upload NDJSON, Preview and Done.
Step 1 — Export the data from MDS
- Copy the SQL script and save it as
C:\Temp\export_mds.sql. - Find
sqlcmd.exewith the locate command the wizard shows. - Run the
sqlcmdcommand with your server and database name, writing toC:\Temp\import_data.ndjson. - Click Next: Upload NDJSON.
The flags are the same as in the first wizard. -h -1 -y 0 -Y 0 are what keep long rows intact.
What the script does
The script loops over every entity that has a leaf member table and builds a SELECT for it:
- Only active members are exported (
Status_ID = 1), ordered byCode. - Every non-system attribute becomes a column.
CodeandNameare always included. - A domain attribute is joined to its target entity and exported as
{Code} Name. - Rows are written in batches of 200 to stay under the 1 MB output limit of
sqlcmd. - An attribute whose name contains a dot is exported under a placeholder name such as
_pmtcol1, with the real name recorded in acolumnsmap.FOR JSON PATHreads a dot as a nesting separator, and a name that starts or ends with a dot fails the whole export.
The output is NDJSON — one JSON object per line, one line per batch:
Step 2 — Upload the NDJSON
Choose Choose .ndjson file, or paste the content. The wizard reads both NDJSON and a single JSON array from an older export, merges the batches of each entity back together, and restores any placeholder column names.
A line that sqlcmd cut off cannot be parsed. The wizard names the affected entities in a warning and continues with the rest. Re-export with the current script to fix it.
Step 3 — Choose an action per entity
Each entity in the file is matched to a Primentra entity by entity name and model name, ignoring case. The table then shows the rows to import, the rows already present, and a status:
| Status | Meaning |
|---|---|
| empty | Matched, and the entity has no rows yet |
| has data | Matched, and the entity already has rows |
| no match | No entity with that name in that model. The rows are skipped |
Pick an action per entity:
| Action | Behavior |
|---|---|
| Import | Add rows. A row whose Code already exists is skipped |
| Overwrite | Match on Code, update those rows, add the rest |
| Delete + import | Delete every existing row first, then import |
| Skip | Leave the entity untouched |
Overwrite and Delete + import are only offered for an entity that has data. The default is Import for an empty entity and Overwrite for one that has data. Import all, Overwrite all, Delete + import all and Skip all set every matched entity at once.
A yellow banner appears if any selected entity requires approval, because the import bypasses the approval workflow and writes directly.
Step 4 — Import
Primentra sorts the entities before it writes anything. It builds a dependency graph from the domain attributes and imports each parent before its children, so a domain value always finds its target. Entities in a dependency cycle are imported last.
Domain values
A domain value arrives as text and is resolved on the server in three passes:
- Exact match on
Code. - Exact match on
Name. - The code inside a
{Code} Namestring.
There is no partial matching. A value that matches nothing is dropped and the field stays empty, without a row-level warning. Check the domain columns after the import — see After Migration.
Progress

The overlay shows a percentage ring, an overall bar with "3 of 15 entities", and a bar for the entity being written with its row count. The per-entity bar is an estimate based on row count, so it moves at a different speed for a wide entity.
Cancel and rollback
Cancel stops the import after the entity in progress finishes. A part-written entity is never left behind.
The preview screen then shows "Import cancelled. Rolled back N entities."
Step 5 — Done
The result screen reports Rows imported, Rows updated, Rows skipped and Entities cleared, with any warnings below. Each entity also gets an import entry in the Audit Log.
Limits
- 50,000 rows per entity per import call.
- Business rules never block the import. Rows that break a rule are written and reported afterwards.
Related
- Migrate Models & Entities — the structure import that must run first
- After Migration — the checks to run once the rows are in
- Domain Attributes & Hierarchies — how domain values are stored and shown
- Approval Workflows — the workflow this import bypasses
- Audit Log — where the import is recorded