Skip to main content

Netbox Disaster Recovery Export

This Python program exports key data from Netbox that can be stored offline or printed out, to allow the configuration of core network components to be re-created from scratch. The goal is to get the core network back up and running so the VM cluster can start running core services again, including DHCP and Netbox itself. From there, the wider network can be reconfigured, hopefully from backups or automation that pushed Netbox config into switches, etc.

Frontmatter

NDRE will optionally include one or more sections from a file specified through --frontmatter. This allows you to give additional context and information to be part of the document.

Table of Contents

The document opens with a table of contents linking to each top-level section, both in the Markdown (works on GitHub, VS Code, etc.) and as clickable links plus a bookmark outline in the PDF.

Netbox objects to document

NDRE exports Netbox data that is relevant to a Disaster Recovery operation; it leaves out information that is not immediately necessary. It also only exports information from a subset of Netbox objects, to keep the size managable.

Tagging Objects

The selection of objects is accomplished through tags: in general, an objected tagged "NDRE" will be included in the exported document.

Metadata

For all information exported, the last modified date and the username doing the modification are listed.

Devices

Devices have their physical properties (location, rack) exported.

Device Connectivity

An important part of disaster recovery is restoring the physical connections between devices (for example, if a router blows up and has to be swapped out).

NDRE exports all connections (cables) between devices tagged, with a section per device. If two tagged devices have cables between them, these are listed for both devices. Connections include circuits and other relevant object types.

Device Interfaces

All tagged devices have their interfaces included in the document, including the interface IP addresses, VLAN assignments, bridge settings, etc.

VLAN and IP subnets

All VLANs and subnets tagged are exported; it is enough to have either the VLAN or the subnet tagged to have both included in the export. A VLAN or subnet used by an interface on a tagged device is also included, even if it carries no tag of its own.

IP addresses

Any IP address exported through device interfaces or similar is listed in a section per subnet for reference, including its DNS info.

DNS Entries

Any DNS name (indirectly) tagged is listed, with a section per zone.

Other Tagged Objects

Any tagged object of a type not covered by one of the sections above (for example a tagged circuit, contact, or tenant) is included in an "Other Tagged Objects" section, grouped by object type. Types with 7 or fewer properties are listed as one table, one row per object; types with more properties get a sub-section per object instead, with a table listing each property and its value.

PDF rendering

Pass --pdf to also render the Markdown export to PDF. This converts the Markdown to HTML and renders it with WeasyPrint using a built-in stylesheet (A4 landscape, small-font tables that wrap instead of overflowing). Requires the pdf extra, which pulls in WeasyPrint and its native dependencies (Pango/Cairo — on macOS: brew install pango).

Installation

python3 -m venv .venv
.venv/bin/pip install -e .          # Markdown export only
.venv/bin/pip install -e ".[pdf]"   # also enables --pdf

Usage

ndre \
  --netbox-url https://netbox.example.com \
  --netbox-token <api-token> \
  --tag ndre \
  --frontmatter intro.md --frontmatter procedures.md \
  -o dr-export.md \
  --pdf

--netbox-url and --netbox-token can also be set via the NETBOX_URL and NETBOX_TOKEN environment variables. Run ndre --help for the full list of options.

DNS Entries in practice

Netbox core has no DNS zone/record objects, so the DNS Entries section is derived from the dns_name field of exported IP addresses; entries are grouped under an inferred "zone" (everything after the first label of the DNS name, e.g. router1.core.example.com groups under core.example.com).

Development

Use the included Docker Compose setup in dev/ to bring up a Netbox instance with sample objects to test the export — see dev/README.md.

Release files for netbox-disaster-recovery-export 1.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-disaster-recovery-export 1.2.6
File Size Uploaded
netbox_disaster_recovery_export-1.2.6.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for netbox-disaster-recovery-export 1.2.6
File Interpreter ABI Platform
netbox_disaster_recovery_export-1.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / netbox_disaster_recovery_export-1.2.6.tar.gz

Download URL netbox_disaster_recovery_export-1.2.6.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2da798d777ba15615f55471af48a9893e6312d7faf8b8efbe0fb6122bf8e0819
BLAKE2b-256 checksum
How to use checksums
fc28b65a9617a161bbeaca31550384a39cb78e57794fe64d65423ad7a51987e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / netbox_disaster_recovery_export-1.2.6-py3-none-any.whl

Download URL netbox_disaster_recovery_export-1.2.6-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52fa688d6f16e41916eb913c4a88d338a9044fbf4e1be811d4fca54b1570326e
BLAKE2b-256 checksum
How to use checksums
1c47136eed148b2e59e85d19ee85929bfc130604b9336772fd146657d6c237ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.6 This release

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page