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.
- 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.
The demo dump includes schema updates and index creation. During import, Postgres prints many lines like:
ALTER TABLECREATE INDEX
That is normal and means the schema and indexes are being rebuilt in the container. It is not an error.
- Start the containers:
docker compose up -d- 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.sqlIf 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- Confirm containers are healthy:
docker ps- The import will take a bit and will output a lot of
ALTER TABLEandCREATE INDEXlines. That is expected. - Make sure you import into the same Postgres container used by NetBox (for
example,
netbox-docker-postgres-1).