networktocode / ntc-netbox-plugin-onboarding

A plugin for NetBox to easily onboard new devices.
Other
245 stars 46 forks source link

Plugin removal #149

Closed thefreakquency closed 2 years ago

thefreakquency commented 2 years ago

Environment

Proposed Functionality

I upgraded my Netbox instance to 3.1.2. As I knew that the onboarding plugin was not supported ( https://github.com/networktocode/ntc-netbox-plugin-onboarding/issues/142 ), hence I did not had it activated. Everything was OK, except when trying to delete a device:

<class 'django.db.utils.IntegrityError'>

update or delete on table "dcim_device" violates foreign key constraint "netbox_onboarding_on_device_id_cee3ef7b_fk_dcim_devi" on table "netbox_onboarding_onboardingdevice"
DETAIL:  Key (id)=(2659) is still referenced from table "netbox_onboarding_onboardingdevice".

Python version: 3.8.5
NetBox version: 3.1.2

I would like to have either an uninstall procedure document or script to remove these database references until the onboarding plugin is compatible with Netbox 3.x (Can`t wait to reinstall!)

Use Case

mzbroch commented 2 years ago

Zeroing migrations will delete plugin related data:

python manage.py migrate netbox_onboarding zero
thefreakquency commented 2 years ago

Thanks for that fast reply! Unfortunately, as it is not installed in my 3.x Netbox instance I get the following error message: CommandError: No installed app with label 'netbox_onboarding'. :(

mzbroch commented 2 years ago

You might consider manual procedure of removing the tables and migrations, or temporarily install plugin and zeroize migrations as per my comment.

thefreakquency commented 2 years ago

I guess I will have no choice but to remove tables from database as I cannot install the plugin on Netbox 3.x... Is such procedure documented somewhere or I have to reverse engineer the database?

thefreakquency commented 2 years ago

Nevermind, I dropped the 2 onboarding plugin tables, and it fixed the issue. Thanks! :)