Upgrading Netbox from Version 3.3.7 to latest #7502

Closed
opened 2025-12-29 20:24:20 +01:00 by adam · 0 comments
Owner

Originally created by @github6043 on GitHub (Jan 12, 2023).

NetBox version

3.3.7

Python version

3.8

Steps to Reproduce

Hi all, I try to upgrade Netbox and get errors at the end a non working system. Any help ist appreciated.

Running migrations:
Applying circuits.0039_unique_constraints... OK
Applying circuits.0040_provider_remove_deprecated_fields...Traceback (most recent call last):
File "netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 96, in wrapped
res = handle_func(*args, **kwargs)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 349, in handle
post_migrate_state = executor.migrate(
File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/migration.py", line 130, in apply
operation.database_forwards(
File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
self.code(from_state.apps, schema_editor)
File "/opt/netbox/netbox/circuits/migrations/0040_provider_remove_deprecated_fields.py", line 24, in check_legacy_data
raise DataError(
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.

Expected Behavior

Running Version 3.4.2

Observed Behavior

image

Originally created by @github6043 on GitHub (Jan 12, 2023). ### NetBox version 3.3.7 ### Python version 3.8 ### Steps to Reproduce Hi all, I try to upgrade Netbox and get errors at the end a non working system. Any help ist appreciated. Running migrations: Applying circuits.0039_unique_constraints... OK Applying circuits.0040_provider_remove_deprecated_fields...Traceback (most recent call last): File "netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, **cmd_options) File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(*args, **options) File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 96, in wrapped res = handle_func(*args, **kwargs) File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 349, in handle post_migrate_state = executor.migrate( File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 135, in migrate state = self._migrate_all_forwards( File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards state = self.apply_migration( File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 252, in apply_migration state = migration.apply(state, schema_editor) File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/migration.py", line 130, in apply operation.database_forwards( File "/opt/netbox/venv/lib/python3.8/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards self.code(from_state.apps, schema_editor) File "/opt/netbox/netbox/circuits/migrations/0040_provider_remove_deprecated_fields.py", line 24, in check_legacy_data raise DataError( 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. ### Expected Behavior Running Version 3.4.2 ### Observed Behavior ![image](https://user-images.githubusercontent.com/40850921/212107057-bd921818-fd18-4871-a401-ae74d0d17117.png)
adam closed this issue 2025-12-29 20:24:20 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7502