Duplicate Hardware Records After Migration – Model Mapping & CI Creation Issue

PrajjvalSiG
Tera Contributor

Hi Everyone,

We recently migrated ~17,000 records into the alm_hardware table and are facing two major issues:


1. Model Reference Issue:

  • The model field is pointing to the generic cmdb_model table, not the cmdb_hardware_product_model.

  • As a result, CIs are not getting created for these assets.


2. Duplicate Records Being Created:

  • Tools like Intune keep creating new records with the same serial number due to missing CI linkage.

  • This is leading to duplicate entries and poor hardware visibility.


Challenge with Model Names:

  • Migrated records have vague model names (e.g., "Dell Inc. Series 5000").

  • We’re unsure which exact model (e.g., 5540, 5550, etc.) to map them to.

  • Partial normalization exists, but not consistently.


Need Guidance On:

  • How to correctly remap model references to the hardware model table?

  • How to trigger CI creation for existing alm_hardware records?

  • Should we enrich model data manually or use normalization?

Appreciate any advice or best practices to clean this up and prevent further duplication.

4 REPLIES 4

MateoBilandzija
Tera Expert

Hi,

it sounds like you're dealing with several layers of complexity here.

To help assess and guide appropriately, could you please clarify or provide the following:

  1. Import Process:
    Could you share how the assets were imported? If you used a Transform Map or any ETL process, please provide the details. Alternatively, if data was pushed via an integration, a brief overview of the interface logic would help.

  2. Source Configuration:
    This doesn’t appear to be a standard OOTB integration from Intune. Can you elaborate on how this source is configured and what data it’s providing?

  3. Model Ownership & Responsibility:
    Who is accountable for the accuracy and granularity of the model data you're receiving? 

Thanks for the reply, here are the details -

  1. Import Process:
    Could you share how the assets were imported? If you used a Transform Map or any ETL process, please provide the details. Alternatively, if data was pushed via an integration, a brief overview of the interface logic would help. - Yes, we used normal Transform Map process as we moved the data from one SNOW instance to another SNOW instance.

  2. Source Configuration:
    This doesn’t appear to be a standard OOTB integration from Intune. Can you elaborate on how this source is configured and what data it’s providing? - We have just imported the data from the old instance and used transform map to put all of them in to the new instance.

  3. Model Ownership & Responsibility:
    Who is accountable for the accuracy and granularity of the model data you're receiving? - We are from the development team who are responsible for data accuracy. as I mentioned, the issue is I believe is from the model management as the models are not referencing to hardware model table and CI are not getting created hence the issues are keep on increasing day by day. 

AJ-TechTrek
Giga Sage
Giga Sage

Hi @PrajjvalSiG ,

 

As per my understanding ,

 

Issue 1: Model reference issue

Model field points to cmdb_model instead of cmdb_hardware_product_model

 

Why it matters
* alm_hardware.model should reference cmdb_hardware_product_model.
* This link is needed for:
* Creating/maintaining CIs.
* Asset ↔ CI linkage (via the model category).

Solution: Fix model references


1. Identify wrong references:
SELECT sys_id, model
FROM alm_hardware
WHERE model.sys_class_name != 'cmdb_hardware_product_model'


1. Remap:
* Create/update correct cmdb_hardware_product_model records.
* Update alm_hardware.model field to point to correct models.
// Example fix script
var asset = new GlideRecord('alm_hardware');
asset.addQuery('model.sys_class_name', '!=', 'cmdb_hardware_product_model');
asset.query();
while (asset.next()) {
var goodModel = new GlideRecord('cmdb_hardware_product_model');
goodModel.addQuery('name', asset.model.name); // match by name or better criteria
if (goodModel.next()) {
asset.model = goodModel.sys_id;
asset.update();
}
}
1. Normalise vague model names (see below).

Challenge: Vague model names


E.g., “Dell Inc. Series 5000” instead of precise “Latitude 5540”.


Options:
Use Hardware Model Normalization (part of Data Certification / HAM Pro).
Since you only have HAM Foundation, do manual enrichment:
* Export assets with vague models.
* Work with procurement / engineering to map to real models.
* Update model table + asset model field.

 

Issue 2: Duplicate CIs from Intune
Tools like Intune keep creating new CIs because the asset → CI linkage is missing.
Why:
* alm_hardware needs to create/relate to a CI in cmdb_ci_computer.
* This link is done via:
* alm_hardware.ci field.
* Correct model + serial number.
* If model is wrong (generic cmdb_model), CI isn’t created or linked.

 

Solution: Trigger CI creation
1. After fixing model references:
* Use Data Certification job / scheduled job to backfill CI links.
* Or:
// Manually create CIs for existing assets
var asset = new GlideRecord('alm_hardware');
asset.addNullQuery('ci'); // only assets missing CI
asset.query();
while (asset.next()) {
var ci = new GlideRecord('cmdb_ci_computer');
ci.initialize();
ci.name = asset.name || asset.asset_tag || asset.serial_number;
ci.serial_number = asset.serial_number;
ci.model = asset.model;
ci.install_status = 1;
ci.update();
asset.ci = ci.sys_id;
asset.update();
}

 

1. Identification & Reconciliation (IRE):
* Ensure correct Identification Rules exist:
* Use serial number + model.
* IRE will then merge / link rather than duplicate.

 

Prevent further duplication
* Fix Intune import transform maps:
* Always use serial_number + model as matching criteria.
* Use IRE instead of direct insert.
* Add data policy to ensure model always points to cmdb_hardware_product_model.

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
 

Thank You
AJ - TechTrek with AJ - ITOM Trainer
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
Topmate:- https://topmate.io/aj_techtrekwithaj (Connect for 1-1 Session)
ServiceNow Community MVP 2025

Pratiksha
Mega Sage
Mega Sage

My Recommendation:

  • Start by importing a subset of data—a sample from each CI class—to validate structure, mapping, and data quality. Once confirmed, proceed with the full load.

  • Use the collate field and ensure the serial number is consistently used.

  • For model data, ensure it's clean at the source. If not, implement validations before ingestion.

  • If Configuration Items (CIs) are available from another instance (instead of asset records), leverage IRE (Identification and Reconciliation Engine) to maintain data integrity.

  • If you have a HAM license, take advantage of automated normalization. Otherwise, expect significant manual effort for validation and correction.