CSV import broken (column headers do not match exported ones) #11162

Closed
opened 2025-12-29 21:41:10 +01:00 by adam · 7 comments
Owner

Originally created by @Kimotu on GitHub (May 12, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.3.0

Python Version

3.12

Steps to Reproduce

  1. Open an object group (tenant, location, ...)
  2. Export 'all data (CSV)'
  3. Open same object group
  4. Import (paste data or select csv file)
  5. Submit

=> Errors pop up, because column headers do not match

  1. when using other language than english, the headers are exported localized and do not match at all with required fields
  2. when switching language to english, the column headers are first letter capitalized and do not match either
  3. error occour also when column is not needed for import

Expected Behavior

exported CSV data contains header the same way that is needed for import, means english and lowercase
Non needed columns get ignored

Observed Behavior

Column headers are always first letter capitalized and localized if other language than english used. Both prevents import without manual, fields not needed for import but present, throw errors.

E.g. when exporting tenant_groups, the column tenants is exported, but not expected by import and throws error even when manually lowercased.

So the whole import process needs manual intervention (lowercase headers and remove unneeded columns)

Originally created by @Kimotu on GitHub (May 12, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.3.0 ### Python Version 3.12 ### Steps to Reproduce 1. Open an object group (tenant, location, ...) 2. Export 'all data (CSV)' 3. Open same object group 4. Import (paste data or select csv file) 5. Submit => Errors pop up, because column headers do not match 1. when using other language than english, the headers are exported localized and do not match at all with required fields 2. when switching language to english, the column headers are first letter capitalized and do not match either 3. error occour also when column is not needed for import ### Expected Behavior exported CSV data contains header the same way that is needed for import, means english and lowercase Non needed columns get ignored ### Observed Behavior Column headers are always first letter capitalized and localized if other language than english used. Both prevents import without manual, fields not needed for import but present, throw errors. E.g. when exporting tenant_groups, the column tenants is exported, but not expected by import and throws error even when manually lowercased. So the whole import process needs manual intervention (lowercase headers and remove unneeded columns)
adam added the netbox label 2025-12-29 21:41:10 +01:00
adam closed this issue 2025-12-29 21:41:10 +01:00
Author
Owner

@pheus commented on GitHub (May 12, 2025):

Thank you for the detailed report!

This behavior is expected — the standard export function is designed primarily for human-readable output and not for direct re-import. As you’ve observed, localized headers and capitalization can cause issues with the import process.

For import-compatible exports, we recommend using the export template functionality. This allows you to define exactly which fields to export, in the correct format expected by the import feature.

@pheus commented on GitHub (May 12, 2025): Thank you for the detailed report! This behavior is expected — the standard export function is designed primarily for human-readable output and not for direct re-import. As you’ve observed, localized headers and capitalization can cause issues with the import process. For import-compatible exports, we recommend using the export template functionality. This allows you to define exactly which fields to export, in the correct format expected by the import feature.
Author
Owner

@Kimotu commented on GitHub (May 12, 2025):

The case/localization issues also occurs within data. The export of location operational status is 'Active' (the label), but expected value is 'active' (import value).

@Kimotu commented on GitHub (May 12, 2025): The case/localization issues also occurs within data. The export of location operational status is 'Active' (the label), but expected value is 'active' (import value).
Author
Owner

@Kimotu commented on GitHub (May 12, 2025):

Thank you for the detailed report!

This behavior is expected — the standard export function is designed primarily for human-readable output and not for direct re-import. As you’ve observed, localized headers and capitalization can cause issues with the import process.

For import-compatible exports, we recommend using the export template functionality. This allows you to define exactly which fields to export, in the correct format expected by the import feature.

okay. Maybe there be a hint about that. I am just evaluation netbox, exported my test data to reset my vm to empty db and wanted to reimport test data. And now I have to manually enter everything again.

@Kimotu commented on GitHub (May 12, 2025): > Thank you for the detailed report! > > This behavior is expected — the standard export function is designed primarily for human-readable output and not for direct re-import. As you’ve observed, localized headers and capitalization can cause issues with the import process. > > For import-compatible exports, we recommend using the export template functionality. This allows you to define exactly which fields to export, in the correct format expected by the import feature. okay. Maybe there be a hint about that. I am just evaluation netbox, exported my test data to reset my vm to empty db and wanted to reimport test data. And now I have to manually enter everything again.
Author
Owner

@pheus commented on GitHub (May 12, 2025):

You’re right - the default export uses display labels like Active, but the import expects raw values like active. This is because the export is meant for human readability, not direct import.

@pheus commented on GitHub (May 12, 2025): You’re right - the default export uses display labels like _Active_, but the import expects raw values like `active`. This is because the export is meant for human readability, not direct import.
Author
Owner

@pheus commented on GitHub (May 12, 2025):

okay. Maybe there be a hint about that. I am just evaluation netbox, exported my test data to reset my vm to empty db and wanted to reimport test data. And now I have to manually enter everything again.

Totally get it - that’s a tough spot to run into while evaluating. A hint sounds like a great idea! Where do you think it would be most helpful in the docs?

@pheus commented on GitHub (May 12, 2025): > okay. Maybe there be a hint about that. I am just evaluation netbox, exported my test data to reset my vm to empty db and wanted to reimport test data. And now I have to manually enter everything again. Totally get it - that’s a tough spot to run into while evaluating. A hint sounds like a great idea! Where do you think it would be most helpful in the docs?
Author
Owner

@Kimotu commented on GitHub (May 13, 2025):

Well, I asked a bit around and checked other software products and I must admit, I did not find any software that provides a CSV export next to a CSV import which does not allow to import the just exported data.
And 10 out of 10 people expect that a CSV file that was exported using the button right, can be imported unmodified with the button left, next to it.
That is not the expected user experience and I think you have to redesign it and the naming (e.g. export localized, human readable CSV) and additionally you provide a machine readable, reimportable CSV file or a yaml/json export that works without templating first. The export template is not really self explaning and the help not either. Nothing that is done quickly just to save some objects as backup for later import.

@Kimotu commented on GitHub (May 13, 2025): Well, I asked a bit around and checked other software products and I must admit, I did not find any software that provides a CSV export next to a CSV import which does not allow to import the just exported data. And 10 out of 10 people expect that a CSV file that was exported using the button right, can be imported unmodified with the button left, next to it. That is not the expected user experience and I think you have to redesign it and the naming (e.g. export localized, human readable CSV) and additionally you provide a machine readable, reimportable CSV file or a yaml/json export that works without templating first. The export template is not really self explaning and the help not either. Nothing that is done quickly just to save some objects as backup for later import.
Author
Owner

@jeremystretch commented on GitHub (May 13, 2025):

This has already been discussed. The CSV import form very clearly details the supported columns. Closing as this not a valid bug report.

@jeremystretch commented on GitHub (May 13, 2025): This has already been discussed. The CSV import form very clearly details the supported columns. Closing as this not a valid bug report.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11162