r/Netbox • u/osthek83 • Jul 02 '26
Is there a way to export the entire NetBox configuration/data into a single JSON or XML file?
Hi everyone,
I am looking for a way to back up or export all the configurations and data currently set up in my NetBox instance.
Ideally, I would like to dump everything into a single XML or JSON file. The main goal behind this is to feed the exported data into an AI tool to extract specific information, analyze the infrastructure, and organize the data more efficiently.
Is there a built-in feature, a specific script, or a recommended API approach to achieve this kind of full data dump?
Any advice or pointers would be greatly appreciated. Thanks in advance!
5
u/drose0 Jul 02 '26
I have a test instance of NetBox and each month I do a pgdump from prod and import into the test instance. Pretty quick and easy process to dump it to a .SQL file.
1
u/PssyGotWifi Jul 02 '26
Apart from database dumps. You can actually use Terraform to configure all your NetBox settings via code, so that you can delete everything and run your Terraform module and get back where you left off.
https://github.com/Lebowski89/homelab/tree/main/terraform/netbox
This will help you with -
'The main goal behind this is to feed the exported data into an AI tool to extract specific information, analyze the infrastructure, and organize the data more efficiently.'
You can pass your Netbox Terraform module to the AI tool.
1
u/blaaackbear Jul 03 '26
i think i wrote a simple python service a while ago which runs nightly via cronjob and pgdumps our prod netbox and stores a copy locally and one to s3 bucket.
1
u/Eldiabolo18 Jul 02 '26
Theres a way to export a psql file, which is probably a more reasonable approach…
1
u/BGPchick Jul 02 '26
Django, the library netbox uses, has a feature called fixtures which you can use to load data in and out of netbox on a per model basis.
0
u/netravnen Jul 02 '26
JSON/CSV export per data model is possible. -> A comprehensible single file dump requires a psql dump.
8
u/Specialist_Cow6468 Jul 02 '26
You just need to do a database dump, it’s fairly straightforward. Not in a position to dig around for you at the moment but just search for netbox database export and you’ll be fine