Run upgrade.sh without database changes #10080

Closed
opened 2025-12-29 21:26:36 +01:00 by adam · 3 comments
Owner

Originally created by @PieterL75 on GitHub (Aug 13, 2024).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v4.0.8

Feature type

Change to existing functionality

Proposed functionality

When an instance of NetBox is set to 'readonly', then the upgrade.sh should not perform any write operations to the database.
This can be either done by an 'option' (./upgrade.sh readony) or by a setting in the configuration.py that is read out.

Use case

I have 2 instances of my netbox running. One production with a write-enabled database and one for DR.
The database is replicated using postgres WAL into the DR location.
There the database is readonly for NetBox.

When I want upgrade the DR instance, I have to modify the upgrade.sh, so that all database commands are excluded (migrations, trace_paths, reindex, clearsessions, clearcache).

Database changes

No response

External dependencies

No response

Originally created by @PieterL75 on GitHub (Aug 13, 2024). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v4.0.8 ### Feature type Change to existing functionality ### Proposed functionality When an instance of NetBox is set to 'readonly', then the upgrade.sh should not perform any write operations to the database. This can be either done by an 'option' (./upgrade.sh readony) or by a setting in the configuration.py that is read out. ### Use case I have 2 instances of my netbox running. One production with a write-enabled database and one for DR. The database is replicated using postgres WAL into the DR location. There the database is readonly for NetBox. When I want upgrade the DR instance, I have to modify the upgrade.sh, so that all database commands are excluded (migrations, trace_paths, reindex, clearsessions, clearcache). ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurestatus: backlogcomplexity: low labels 2025-12-29 21:26:36 +01:00
adam closed this issue 2025-12-29 21:26:36 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 13, 2024):

If the replicated copy of the database is up-to-date, running upgrade.sh against it should have no effect; it would be the same as running upgrade.sh multiple times against the same database.

@jeremystretch commented on GitHub (Aug 13, 2024): If the replicated copy of the database is up-to-date, running `upgrade.sh` against it should have no effect; it would be the same as running `upgrade.sh` multiple times against the same database.
Author
Owner

@PieterL75 commented on GitHub (Aug 13, 2024):

The problem here, is that de postgres database is in readonly state. the upgrade script fails on that

@PieterL75 commented on GitHub (Aug 13, 2024): The problem here, is that de postgres database is in readonly state. the upgrade script fails on that
Author
Owner

@jeremystretch commented on GitHub (Aug 13, 2024):

Marking this as "needs owner" with the caveat that it must be implemented as a command line argument to the script.

@jeremystretch commented on GitHub (Aug 13, 2024): Marking this as "needs owner" with the caveat that it must be implemented as a command line argument to the script.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10080