feature: Allow 'ignore duplicates' on import #1108

Closed
opened 2025-12-29 16:29:04 +01:00 by adam · 3 comments
Owner

Originally created by @InsaneSplash on GitHub (Jul 17, 2017).

Issue type: feature

Python version:
NetBox version:2.0.10

I would like to for a feature to be considered when importing bulk data in to Netbox. In some cases, the information may have been manually inputted to Netbox, causing duplicates when trying to perform an import. It would be helpful to add an option to ignore duplicates and import the unique values. This way one does not need to try count through import lines to remove the duplicate entries.

Originally created by @InsaneSplash on GitHub (Jul 17, 2017). ### Issue type: feature **Python version:** **NetBox version:2.0.10** I would like to for a feature to be considered when importing bulk data in to Netbox. In some cases, the information may have been manually inputted to Netbox, causing duplicates when trying to perform an import. It would be helpful to add an option to ignore duplicates and import the unique values. This way one does not need to try count through import lines to remove the duplicate entries.
adam closed this issue 2025-12-29 16:29:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 17, 2017):

The onus is on the user to provide correct data to NetBox. If duplicate entries exist in the list of objects to be imported, the user will need to determine where they came from and whether it's symptomatic of a larger issue (e.g. objects exported from another source were not formatted correctly) to be confident that the data they're importing is correct. Simply ignoring duplicate entries will likely result in erroneous and/or missing data.

@jeremystretch commented on GitHub (Jul 17, 2017): The onus is on the user to provide correct data to NetBox. If duplicate entries exist in the list of objects to be imported, the user will need to determine where they came from and whether it's symptomatic of a larger issue (e.g. objects exported from another source were not formatted correctly) to be confident that the data they're importing is correct. Simply ignoring duplicate entries will likely result in erroneous and/or missing data.
Author
Owner

@InsaneSplash commented on GitHub (Jul 17, 2017):

The issue isn't really duplicate data within the import source, but rather having the ability to merge the data with data that is already existing within Netbox. In many cases one cannot wait for an import to take place from a legacy system and some data is added before hand. It would help to allow a user to select whether to ignore any duplicates between the 2 sources.

Its not an easy task importing a CSV and having to remove the duplicate entries through line counting etc.

Example: I have 2000 VRFs to import, some have already been created so that IP Prefixes could be linked to a VRF/Device.

@InsaneSplash commented on GitHub (Jul 17, 2017): The issue isn't really duplicate data within the import source, but rather having the ability to merge the data with data that is already existing within Netbox. In many cases one cannot wait for an import to take place from a legacy system and some data is added before hand. It would help to allow a user to select whether to ignore any duplicates between the 2 sources. Its not an easy task importing a CSV and having to remove the duplicate entries through line counting etc. Example: I have 2000 VRFs to import, some have already been created so that IP Prefixes could be linked to a VRF/Device.
Author
Owner

@jeremystretch commented on GitHub (Jul 17, 2017):

Its not an easy task importing a CSV and having to remove the duplicate entries through line counting etc.

Just take what's already defined in NetBox (via the API or CSV export, whichever is easier) and compare it to the set to be imported, then only import the difference between the two.

for vrf in legacy_vrfs:
    if vrf not in netbox_vrfs:
        print vrf
@jeremystretch commented on GitHub (Jul 17, 2017): > Its not an easy task importing a CSV and having to remove the duplicate entries through line counting etc. Just take what's already defined in NetBox (via the API or CSV export, whichever is easier) and compare it to the set to be imported, then only import the difference between the two. ```python for vrf in legacy_vrfs: if vrf not in netbox_vrfs: print vrf ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1108