Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.62 KB

File metadata and controls

60 lines (42 loc) · 1.62 KB

Sample NetBox Demo Database Import Notes

This document explains the steps used to load the NetBox demo data (from https://github.com/netbox-community/netbox-demo-data) into the local NetBox Postgres container. It also explains why you see lots of ALTER TABLE and CREATE INDEX messages during the import.

What we needed to do

  • Download the demo database dump from the NetBox demo data repo.
  • Start the NetBox Docker stack so Postgres is running.
  • Import the dump file into the Postgres container.
  • Wait for the import to finish and confirm the containers are healthy.

Why the output looks noisy

The demo dump includes schema updates and index creation. During import, Postgres prints many lines like:

  • ALTER TABLE
  • CREATE INDEX

That is normal and means the schema and indexes are being rebuilt in the container. It is not an error.

Example import flow

  1. Start the containers:
docker compose up -d
  1. Import the demo database dump (replace the local path with your file):
docker exec -i netbox-docker-postgres-1 \
  psql -U netbox -d netbox < /path/to/netbox-demo-data.sql

If the demo data is provided as a .dump file instead of .sql, use pg_restore instead of psql:

docker exec -i netbox-docker-postgres-1 \
  pg_restore -U netbox -d netbox < /path/to/netbox-demo-data.dump
  1. Confirm containers are healthy:
docker ps

Notes

  • The import will take a bit and will output a lot of ALTER TABLE and CREATE INDEX lines. That is expected.
  • Make sure you import into the same Postgres container used by NetBox (for example, netbox-docker-postgres-1).