Enable CSV export for organizational objects (device roles, VLAN groups, etc.) #1404

Closed
opened 2025-12-29 16:32:02 +01:00 by adam · 9 comments
Owner

Originally created by @cimnine on GitHub (Nov 15, 2017).

Issue type

[X] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.4
  • NetBox version: 2.2.5

Description

It'd be nice to export/import device roles the same way as device types.

Originally created by @cimnine on GitHub (Nov 15, 2017). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. For assistance with installation issues, or for any other issues other than those listed below, please raise your topic for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. Due to an excessive backlog of feature requests, we are not currently accepting any proposals which extend NetBox's feature scope. Do not prepend any sort of tag to your issue's title. An administrator will review your issue and assign labels as appropriate. ---> ### Issue type [X] Feature request <!-- An enhancement of existing functionality --> [ ] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: 3.4 * NetBox version: 2.2.5 <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description It'd be nice to export/import _device roles_ the same way as _device types_.
adam added the status: acceptedtype: feature labels 2025-12-29 16:32:02 +01:00
adam closed this issue 2025-12-29 16:32:02 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 15, 2017):

Support for CSV import of device roles was introduced in NetBox v2.2.0. Device roles can be exported via the API; I don't think there's much value in adding CSV export for them.

@jeremystretch commented on GitHub (Nov 15, 2017): Support for CSV import of device roles was introduced in NetBox v2.2.0. Device roles can be exported via the API; I don't think there's much value in adding CSV export for them.
Author
Owner

@cimnine commented on GitHub (Nov 15, 2017):

I'd use it for migrating easily between staging/production.

On another note, the CSV import button is only present in the menu, but not on the /dcim/device-roles/ page. That's why I didn't even realise there's the option for CSV import.

@cimnine commented on GitHub (Nov 15, 2017): I'd use it for migrating easily between staging/production. On another note, the CSV import button is only present in the menu, but not on the `/dcim/device-roles/` page. That's why I didn't even realise there's the option for CSV import.
Author
Owner

@Senetus commented on GitHub (Nov 15, 2017):

To migrate between servers easiest would be to just dump and restore the database instead of one by one export and import. But that's of course only the way I see it.

@Senetus commented on GitHub (Nov 15, 2017): To migrate between servers easiest would be to just dump and restore the database instead of one by one export and import. But that's of course only the way I see it.
Author
Owner

@jeremystretch commented on GitHub (Nov 15, 2017):

I'd use it for migrating easily between staging/production.

Just so I understand, are you running separate instances of NetBox for staging and production? Or what do you mean?

On another note, the CSV import button is only present in the menu, but not on the /dcim/device-roles/ page.

Yeah we should add those. I'll open a separate bug for that.

@jeremystretch commented on GitHub (Nov 15, 2017): > I'd use it for migrating easily between staging/production. Just so I understand, are you running separate instances of NetBox for staging and production? Or what do you mean? > On another note, the CSV import button is only present in the menu, but not on the /dcim/device-roles/ page. Yeah we should add those. I'll open a separate bug for that.
Author
Owner

@cimnine commented on GitHub (Nov 15, 2017):

easiest would be to just dump and restore the database

@esajo I don't want to overwrite any (other) data that is already on the production instance.

Just so I understand, are you running separate instances of NetBox for staging and production? Or what do you mean?

Yes. Two instances. Plus devs usually spin up a local Docker-based instance for developing integrations.

@cimnine commented on GitHub (Nov 15, 2017): > easiest would be to just dump and restore the database @esajo I don't want to overwrite any (other) data that is already on the production instance. > Just so I understand, are you running separate instances of NetBox for staging and production? Or what do you mean? Yes. Two instances. Plus devs usually spin up a local Docker-based instance for developing integrations.
Author
Owner

@bdlamprecht commented on GitHub (Dec 8, 2017):

I'd like to see this feature as well.

I'm doing the same thing as @cimnine is, my development boxes are based off of docker, which get thrown away frequently, so allowing a mass export would be very beneficial instead.

I was able to use the API to export the device_roles from my dev box and use an online JSON to CSV converter in the interim until this is implemented.

@bdlamprecht commented on GitHub (Dec 8, 2017): I'd like to see this feature as well. I'm doing the same thing as @cimnine is, my development boxes are based off of docker, which get thrown away frequently, so allowing a mass export would be very beneficial instead. I was able to use the API to export the `device_roles` from my dev box and use an online `JSON to CSV` converter in the interim until this is implemented.
Author
Owner

@jeremystretch commented on GitHub (Jan 26, 2018):

So, this FR is really more for CSV-based export of all organizational objects, not just device roles, right?

@jeremystretch commented on GitHub (Jan 26, 2018): So, this FR is really more for CSV-based export of _all_ organizational objects, not just device roles, right?
Author
Owner

@cimnine commented on GitHub (Feb 4, 2018):

Thanks!

@cimnine commented on GitHub (Feb 4, 2018): Thanks!
Author
Owner

@jeremystretch commented on GitHub (Feb 5, 2018):

Did a lot of cleanup around CSV import/export. Still want to add some tests specifically for it.

@jeremystretch commented on GitHub (Feb 5, 2018): Did a lot of cleanup around CSV import/export. Still want to add some tests specifically for it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1404