Upgrading Postgres Database #372
-
I've been running a NetBox instance in development for some time via netbox-docker and have just pulled the most recent updates to bring in NetBox 2.10.0. I notice Postgres has been updated to 12 and it won't open my DB created in Postgres 11. Can anyone offer any advice on upgrading an in-place database? Should this be mentioned in the documentation? In this case, I am only running a dev instance and can happily blat my DB if required, but I can't roll this out to my customers if it isn't a completely straight forward upgrade process! I'm aware that netbox-docker is widely used for testing NetBox, but I was under the impression that it could also be used in production? If it is indeed intended for production use, the DB upgrade process needs to be simple or the DB version needs to be nailed down - will NetBox 2.10 work with Postgres 11 if required? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
A backup and restore of Postgres does the trick. This is the simplest way. See https://github.com/netbox-community/netbox-docker/wiki/Troubleshooting#database-operations
I believe it was mentioned in the release notes when we upgraded from 11 to 12.
I believe so. Netbox's docs state "NetBox requires PostgreSQL 9.6 or higher." |
Beta Was this translation helpful? Give feedback.
-
Thanks @cimnine. Some healthy debate on #netbox-docker, but for the purposes of helping anyone else out who stumbles across this I'm going to record that I've over-ridden the requirement for postgres:12-alpine with postgres:11-alpine (which remains supported by NetBox 2.10) by adding the following lines to my docker-compose.override.yml file:
It may not be the gold plated solution, but it feels like upgrading NetBox first and then upgrading PostgreSQL later (if desired) is the best way to go. Trying to do both at the same time may work, but it adds a complexity that, personally, I'd rather not have to deal with. |
Beta Was this translation helpful? Give feedback.
Thanks @cimnine. Some healthy debate on #netbox-docker, but for the purposes of helping anyone else out who stumbles across this I'm going to record that I've over-ridden the requirement for postgres:12-alpine with postgres:11-alpine (which remains supported by NetBox 2.10) by adding the following lines to my docker-compose.override.yml file:
It may not be the gold plated solution, but it feels like upgrading NetBox first and then upgrading PostgreSQL later (if desired) is the best way to go. Trying to do both at the same time may work, but it adds a complexity that, personally, I'd rather not have to deal with.