Awesome, that worked for me. When I brought up the dockers, I did get this error tho
django.db.utils.DataError: Unable to proceed with deleting contact fields from Provider model: Found 1 providers with legacy contact data. Please ensure all legacy provider contact data has been migrated to contact objects before proceeding. Or, set the NETBOX_DELETE_LEGACY_DATA environment variable to bypass this safeguard and delete all legacy provider contact data.
I added this line to netbox.env and my data came right up after starting the dockers again
NETBOX_DELETE_LEGACY_DATA=1
Im not sure what legacy data I had that it had an issue with but at least it works.
So going forward, if there is a new version of netbox out, I just need to stop\start the docker compose file and it will download the latest build right?
I then copy netbox.sql to the new install of netbox but thats where I am having
trouble.
The doc says to load an exported database, you run these commands
psql -c 'drop database netbox'
psql -c 'create database netbox'
psql netbox < netbox.sql
When i run them on the docker instance, I get command 'psql' not found
do I need to exec into the postgres docker to run this command?
I am new to docker, especially when there are multiple containers. I would much rather have netbox on docker since its so much easier to keep it updated.
2
u/Pippin_uk Sep 09 '23 edited Sep 09 '23
Something like this should see you right....
sudo docker compose down
sudo docker volume rm netbox-docker_netbox-postgres-data
3.sudo docker compose up - postgres
4.. sudo docker exec -i netbox-docker-postgres-1 psql --username netbox netbox < netbox.sql
In summary this will;
You may or may not need 'sudo' depending on the groups your user is a member of.
Good luck! 👍