From netbox-labs
Migrates data into NetBox from spreadsheets and legacy IPAM/DCIM systems. Covers assessment, cleaning, dependency ordering, import strategy, validation, and verification.
How this skill is triggered — by the user, by Claude, or both
Slash command
/netbox-labs:netbox-migrationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Your knowledge of NetBox import mechanisms may be outdated.** Available import methods, bulk operation limits, and Diode entity types evolve between releases. Prefer retrieval over pre-trained knowledge.
Your knowledge of NetBox import mechanisms may be outdated. Available import methods, bulk operation limits, and Diode entity types evolve between releases. Prefer retrieval over pre-trained knowledge.
| Source | URL / Method | Use for |
|---|---|---|
| NetBox REST API docs | https://netboxlabs.com/docs/netbox/integrations/rest-api/ | Bulk create/update endpoints |
| Diode docs | https://netboxlabs.com/docs/diode/ | High-volume ingestion |
| pynetbox repo | https://github.com/netbox-community/pynetbox | Python SDK for scripted imports |
| NetBox MCP server | If configured — verify imported data landed correctly | Post-migration validation |
This skill teaches how to think about and execute data migrations into NetBox. It covers the full lifecycle: analyzing messy source data, cleaning it, choosing an import strategy, loading it in the right order, and verifying everything landed correctly.
This is NOT about NetBox version upgrades. This is about getting data from spreadsheets, legacy tools, or other CMDBs into NetBox for the first time (or re-importing).
How much data?
What's the source?
One-time or ongoing?
Every migration follows this arc. Don't skip phases — the most common failure is jumping straight to import without assessment and cleaning.
Goal: Understand what you have, what NetBox needs, and the gap between them.
Inventory your sources — List every spreadsheet, database, tool, wiki page, and person's head that holds infrastructure data. Identify which source is authoritative for each data type.
Map fields to NetBox models — For each source field, identify the corresponding NetBox model and field. See references/source-mapping.md for common mappings by source system.
Identify what to keep vs leave behind — Not everything migrates. NetBox has specific models; data that doesn't fit goes into custom fields, comments, or gets dropped. The principle: start with what NetBox requires, not what your spreadsheet has.
Determine scope — Migrate in phases. Start with the physical hierarchy (sites, racks, devices), then IPAM, then connections, then enrichment. Don't try to do everything at once.
Check for existing tools — phpIPAM has ipam-migrator, RackTables has racktables2netbox. Search GitHub before writing custom scripts.
Tricky mappings to watch for:
For NetBox's data model and relationships, see netbox-data-modeling.
Principle: Garbage in, garbage out. Clean BEFORE importing — fixing data in NetBox after import is harder than fixing it in a spreadsheet.
The top 10 cleaning tasks:
Normalize names — Pick a convention (lowercase-hyphenated recommended) and apply it everywhere. "NYC-DC1", "New York DC 1", "nyc dc1" → nyc-dc1.
Standardize manufacturers — "Cisco", "cisco", "Cisco Systems", "CISCO" → one canonical name. Case-sensitivity matters — especially with Diode's reconciler.
Standardize device types — "C9300-48P", "Catalyst 9300 48P", "WS-C9300-48P" → one model string per hardware model.
Deduplicate — Same device with different names across sources. Same IP on multiple records. Pick the authoritative record.
Remove stale data — Devices decommissioned years ago still in spreadsheets. Mark as decommissioning or remove.
Validate IPs — Must be proper CIDR notation. Add /32 for host addresses. 10.0.0.1/24 is an IP address on a /24, not a prefix — know the difference.
Fill required fields — Every Device needs: name, device_type, role, site. Every IP needs address in CIDR. Check NetBox's required fields per model.
Map status values — Source "production"/"live"/"up" → NetBox active. Source "down"/"retired" → NetBox offline or decommissioning. Valid choices: active, planned, staged, offline, decommissioning, inventory.
Handle multi-value cells — "10.0.1.1, 10.0.1.2" in one cell → split into separate records.
Remove formatting artifacts — Excel leading zeros stripped, trailing spaces, BOM characters, merged cells creating blanks, "N/A" and "unknown" values → decide skip or placeholder.
Community wisdom: "Fill a few records manually in NetBox, export them, then build your CSV to match that format." NetBox's CSV export headers don't match import headers — always test with a small sample first.
Choose your strategy based on the decision framework in references/import-patterns.md.
| Strategy | Best For | Dependency Ordering |
|---|---|---|
| CSV Import (UI) | < 1K objects, simple types | Manual — one type at a time |
| pynetbox | 1K–100K, complex logic | Manual — you control the order |
| Diode SDK | 10K+, ongoing sync | Automatic — reconciler handles deps |
| Custom Scripts | Patterned data, in-NetBox transforms | Manual — Django ORM |
Regardless of strategy, respect dependency order. Objects must exist before other objects can reference them. See references/dependency-order.md for the complete 11-tier ordering.
Summary of dependency tiers:
The circular dependency problem: A device's primary_ip requires: create device → create interface (auto from template) → create IP → assign IP to interface → update device's primary_ip. This requires two passes — first create everything, then set primary IPs.
Diode eliminates most ordering concerns. It creates missing dependencies automatically. If you ingest a Device referencing a non-existent Site, Diode creates the Site first. For large migrations, this is a significant advantage. See netbox-diode.
Key import rules:
nb.dcim.devices.create([{...}, {...}]) — batch in chunks of ~100 (a recommended size for throughput/memory, not a NetBox-enforced limit)?start=<id>&limit=N) over deep ?offset= scans — offset slows linearly at high offsets. See netbox-api-integration.For API patterns, see netbox-api-integration.
Three validation layers — all three are required for a complete migration.
See references/validation-checklist.md for the complete checklist.
Validation script pattern:
import pynetbox
nb = pynetbox.api("https://netbox.example.com", token="...")
# Count verification
source_device_count = 500 # from your source data
assert nb.dcim.devices.count() >= source_device_count
# Spot-check critical devices
for name in ["core-rtr-01", "fw-01", "dns-01"]:
d = nb.dcim.devices.get(name=name)
assert d, f"Missing: {name}"
assert d.primary_ip, f"No primary IP: {name}"
assert d.site, f"No site: {name}"
# Find orphaned IPs
for ip in nb.ipam.ip_addresses.all():
if not ip.assigned_object:
print(f"Unassigned: {ip.address}")
Migration isn't done when the data is loaded. It's done when NetBox matches reality and is established as the source of truth.
Spreadsheets never have everything. Use the Orb Agent to discover what's missing:
Discovery fills the gaps that source data always has: interfaces, actual IP assignments, MAC addresses, real platform versions, cable topology. See netbox-discovery.
Define rules for what "correct" looks like, then check compliance:
See netbox-assurance.
A migration is done when:
npx claudepluginhub shaneholloman/netbox-skillsCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
2plugins reuse this skill
First indexed Jun 9, 2026