wastrachan / ansible-role-netbox-docker

Ansible role to configure Netbox as a docker-compose project
MIT License
6 stars 4 forks source link

Upgrade path from older instaces? #15

Closed 1977er closed 3 days ago

1977er commented 2 months ago

Hey there.

I played around with this role a few moons ago, setting up a netbox instance and filled in some data. Coming back to this instace today, I'm greeted with "Hey, there is a new version! Upgrade me!". My first instance back then was based on a postgres14. The current version of this role wants to install a postgres16.

Unfortunately my current postgres docker volume cannot be ingested by the newer postgres due to a version mismatch.

Is there any assisted (or automated) way to upgrade this stack? Do I have to dump my sql data manually?

Thanks for the insight and thanks for sharing this ansible role.

wastrachan commented 3 days ago

I could think of three possible paths forward:

The first would be to backup your database, and then allow ansible to update your container to the newer postgres image. Following the container update, you'd want to use pg_upgrade.

The second would be to dump the postgres DB, upgrade the instance, and then reimport the export. I typically do this when downtime isn't a concern (or the database size is small) as I view it as the "cleanest" path forward.

The third option would be to set the postgres image to an older version in your ansible inventory (or vars). I have at least one netbox instance still running on postgres 12 without any problem.

wastrachan commented 3 days ago

This might be helpful: https://github.com/netbox-community/netbox-docker/wiki/Updating#postgresql-update

1977er commented 3 days ago

Hi @wastrachan. Sorry for not closing this sooner. I kind of solved my problem by linking my newer netbox docker image to an older postgres14 docker image. :)