Verify migration data counts
Overview
After importing data into the target environment, run a counts job to compare the number of staged entities with the number of imported entities. From there, you can confirm that all data was transferred successfully and that no data was lost during the import process.
Start a counts job
The counts job iterates through all staged and imported entities and groups them by category. For each category, the counts job returns results that includes the count type, column headers, and rows for both staged and imported entities. Compare the staged rows with the imported rows to determine whether the import completed successfully.
Request
To start a counts job for a migration, use the Start counts job for migration.
HTTP request: PUT /migration-assistance/migrations/{migration-reference-id}/jobs/counts
Response
If the job starts successfully, the API returns a 200 status code and a counts job ID.
"35f2900d-73de-4850-9485-02c60d60dea8"
Use the returned job ID to check the counts job result. See Monitor job result and progress.
Read the result
Each count result includes the following fields:
| Field | Description |
|---|---|
type | A label identifying the category of the count (for example, TotalEntity or TotalCounterparties). |
headers | An ordered list of column names that describe the values in each row. |
stagedRows | A list of rows representing the counts derived from entities in the staging area. Each row is an ordered list of string values that correspond to the headers. |
importedRows | A list of rows representing the counts derived from entities in the target environment, following the same column structure as stagedRows. |
By comparing stagedRows and importedRows for each count type, you can verify whether the import preserved all data accurately.
Example response
The following example shows a TotalEntity count, which provides a high-level summary of all entities grouped by type. This count type is always included in the results.
{
"type": "TotalEntity",
"headers": ["EntityType", "Count"],
"stagedRows": [
["Agreement", "1500"],
["Counterparty", "800"],
["Collateral", "600"],
["CollateralObject", "600"],
["FinancialState", "3000"],
["DebitMandate", "1200"],
["AdditionalRepayment", "400"]
],
"importedRows": [
["Agreement", "1500"],
["Counterparty", "800"],
["Collateral", "600"],
["CollateralObject", "600"],
["FinancialState", "3000"],
["DebitMandate", "1200"],
["AdditionalRepayment", "400"]
]
}
In addition to the total entity count, the response may include additional count types that group entities by domain-specific attributes such as entity subtype, product, or other properties.
These additional count types follow the same headers/stagedRows/importedRows structure and allow you to verify data at a more granular level.
When comparing stagedRows and importedRows, you may encounter one of the following scenarios:
- Matching numbers: If all staged and imported row values match for every count type, then the import was successful without data loss.
- Mismatched numbers: If staged and imported row values do not match, some entities may not have been imported correctly. See Troubleshooting to learn how to resolve the issue.