Documentation
Getting Started
Data Grid
Modeling
Business Rules
Approvals
Users, Roles & Security
Administration
Integration & API
Installation
Architecture
Documentation/Migrating from MDS/Migrate Models & Entities

Migrate Models & Entities

The first wizard imports your MDS structure: models, entities and attributes. It creates empty entities. The data comes later, with Migrate Master Data.

Open the gear menu and select Migration Wizards, or go to Settings › Migration Wizards › Models & Entities.

The wizard has four steps: Instructions, Upload JSON, Preview and Done.

Step 1 — Export the structure from MDS

  1. Copy the SQL script with the Copy button.
  2. Save it as a .sql file, for example C:\Temp\export_mds_model.sql.
  3. Open PowerShell and find sqlcmd.exe with the locate command the wizard shows.
  4. Copy the sqlcmd command, replace SERVERNAME\INSTANCE and MDS_DATABASE, and run it.
  5. Click Next: Upload JSON.
& "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE" `
  -S "SERVERNAME\INSTANCE" `
  -d "MDS_DATABASE" `
  -E `
  -i "C:\Temp\export_mds_model.sql" `
  -o "C:\Temp\import_model.json" `
  -h -1 -y 0 -Y 0
FlagPurpose
-SSQL Server instance that holds the MDS database
-dMDS database name
-EWindows Authentication
-iThe saved SQL script
-oThe output file
-h -1No column header
-y 0 -Y 0No column width limit, which prevents truncation
Do not run the script in SSMS. SSMS truncates a long JSON result, and the wizard then reads an incomplete structure.

What the script reads

The script returns one nested JSON document: models, their entities, and each entity's attributes. It reads every model in the database.

Attributes with AttributeType_ID = 3 are excluded. Everything else is included, which means the MDS Code and Name attributes are part of the export. Domain-based attributes carry the name of the entity they point to.

Step 2 — Upload the JSON

Choose Choose .json file and select import_model.json, or paste the JSON into the text box. Then click Parse & preview.

The wizard cleans up common paste problems by itself: a byte order mark, text in front of the opening [, a result split across several rows, and line breaks or tabs inserted by SSMS.

If the file is not valid, the wizard shows a Parse error and stays on this step.

Step 3 — Review the preview

The Preview step with the import counts, the conflict list and the model tree
The Preview step with the import counts, the conflict list and the model tree(click to enlarge)

The preview shows three counters — Models, Entities and Attributes — and a tree of everything that will be created.

A model that already exists in Primentra is marked exists — will merge. The wizard adds the new entities to it instead of creating a second model with the same name.

Conflicts

An entity is a conflict when Primentra already has an entity with the same name in the same model. Every conflict is listed with two buttons:

  • Skip — keep the existing entity untouched. This is the default.
  • Overwrite — replace the existing entity's attribute list with the one from MDS.
Overwrite loses data. It replaces the attribute list of a live entity. Values stored against an attribute that is not in the MDS export are lost.

Use Skip all or Overwrite all to set every conflict at once. Entities set to Skip are struck through in the tree, and the import button counts only the entities that will be written.

Step 4 — Import

Click Import N entities. The wizard then:

  1. Creates a System User (system@mds-import) that owns the imported records.
  2. Creates every model that does not exist yet, with the MDS description or "Imported from MDS".
  3. Creates each entity with its attributes, and sets the table name to the entity name with spaces replaced by underscores.
  4. Runs a second pass that resolves every domain attribute to the entity it references.

Domain references are resolved inside the same model first. If the target is not there, Primentra looks in every other model. Both fallbacks produce a warning:

  • Domain "X" for Entity.Attribute found in different model
  • Domain entity "X" not found for Entity.Attribute

Step 5 — Done

The result screen reports Models created, Entities created, Entities overwritten and Entities skipped, followed by any warnings. Read the warnings before you continue — an unresolved domain reference means that attribute has no target entity, and the data import cannot fill it.

Click Import Data to go straight to the second wizard, or Done to return to the model list.

Ready to get started?

Start managing your master data with Primentra today.

View Pricing
Migrate Models & Entities | Migrating from MDS | Docs | Primentra