netbox-community / migration-scripts Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
It seems the Tabelle "contact_phone" and "contact_email" will not be migrated.
I'am neither a phyton nor an SQL programmer, but both below listed statements return a not empty list after running the migration script in NOT dry-run mode.
select * from dcim_site where contact_email != '';
select * from dcim_site where contact_phone != '';
We are having an issue with running these scripts:
Running Netbox version 3.1.11-ldap-1.6.1 in docker
(venv) bash-5.1$ python3 manage.py runscript --loglevel debug --data '{"asn_rir": 2, "clear_site_field": false}' netbox_v32_migration.MigrateSiteASNsScript
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
[2022-08-25 09:27:08,332][INFO] - Running script (commit=False)
[2022-08-25 09:27:08,334][INFO] - Found 2 sites with a legacy ASN defined.
[2022-08-25 09:27:08,336][INFO] - Creating new ASN: 16509
[2022-08-25 09:27:08,337][ERROR] - An exception occurred: `ValueError: Cannot assign "2": "ASN.rir" must be a "RIR" instance.`
---
Traceback (most recent call last):
File "/opt/netbox/netbox/extras/management/commands/runscript.py", line 44, in _run_script
script.output = script.run(data=data, commit=commit)
File "/etc/netbox/scripts/netbox_v32_migration.py", line 150, in run
asn = ASN(asn=site.asn, rir=data['asn_rir'])
File "/opt/netbox/venv/lib/python3.9/site-packages/django/db/models/base.py", line 485, in __init__
_setattr(self, field.name, rel_obj)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/db/models/fields/related_descriptors.py", line 215, in __set__
raise ValueError(
ValueError: Cannot assign "2": "ASN.rir" must be a "RIR" instance.
---
[2022-08-25 09:27:08,337][INFO] - Database changes have been reverted due to error.
[2022-08-25 09:27:08,337][ERROR] - Exception raised during script execution: Cannot assign "2": "ASN.rir" must be a "RIR" instance.
[2022-08-25 09:27:08,340][INFO] - Script completed in 0 minutes, 0.01 seconds
Also seeing the same issue with the contact migration script
(venv) bash-5.1$ python3 manage.py runscript --loglevel debug --data '{"contact_role": 1, "contact_priority": "primary", "clear_site_fields": false}' netbox_v32_migration.MigrateSiteContactsScript
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
[2022-08-25 09:31:59,190][INFO] - Running script (commit=False)
[2022-08-25 09:31:59,193][INFO] - Found 9 sites with legacy contact information defined.
[2022-08-25 09:31:59,195][INFO] - Creating new contact: John Smith
[2022-08-25 09:31:59,292][INFO] - Assigning contact John Smith to site Johns House
[2022-08-25 09:31:59,294][ERROR] - An exception occurred: `ValueError: Cannot assign "1": "ContactAssignment.role" must be a "ContactRole" instance.`
---
Traceback (most recent call last):
File "/opt/netbox/netbox/extras/management/commands/runscript.py", line 44, in _run_script
script.output = script.run(data=data, commit=commit)
File "/etc/netbox/scripts/netbox_v32_migration.py", line 87, in run
assignment = ContactAssignment(
File "/opt/netbox/venv/lib/python3.9/site-packages/django/db/models/base.py", line 485, in __init__
_setattr(self, field.name, rel_obj)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/db/models/fields/related_descriptors.py", line 215, in __set__
raise ValueError(
ValueError: Cannot assign "1": "ContactAssignment.role" must be a "ContactRole" instance.
---
[2022-08-25 09:31:59,294][INFO] - Database changes have been reverted due to error.
[2022-08-25 09:31:59,294][ERROR] - Exception raised during script execution: Cannot assign "1": "ContactAssignment.role" must be a "ContactRole" instance.
[2022-08-25 09:31:59,298][INFO] - Script completed in 0 minutes, 0.11 seconds
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.