Skip to content

Commit

Permalink
Closes netbox-community#6753: Add plugin removal instructions to the …
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
jeremystretch authored and candlerb committed Aug 4, 2021
1 parent 4f474b2 commit a4d7086
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,58 @@ Restart the WSGI service to load the new plugin:
```no-highlight
# sudo systemctl restart netbox
```

## Removing Plugins

Follow these steps to completely remove a plugin.

### Update Configuration

Remove the plugin from the `PLUGINS` list in `configuration.py`. Also remove any relevant configuration parameters from `PLUGINS_CONFIG`.

### Remove the Python Package

Use `pip` to remove the installed plugin:

```no-highlight
$ source /opt/netbox/venv/bin/activate
(venv) $ pip uninstall <package>
```

### Restart WSGI Service

Restart the WSGI service:

```no-highlight
# sudo systemctl restart netbox
```

### Drop Database Tables

!!! note
This step is necessary only for plugin which have created one or more database tables (generally through the introduction of new models). Check your plugin's documentation if unsure.

Enter the PostgreSQL database shell to determine if the plugin has created any SQL tables. Substitute `pluginname` in the example below for the name of the plugin being removed. (You can also run the `\dt` command without a pattern to list _all_ tables.)

```no-highlight
netbox=> \dt pluginname_*
List of relations
List of relations
Schema | Name | Type | Owner
--------+----------------+-------+--------
public | pluginname_foo | table | netbox
public | pluginname_bar | table | netbox
(2 rows)
```

!!! warning
Exercise extreme caution when removing tables. Users are strongly encouraged to perform a backup of their database immediately before taking these actions.

Drop each of the listed tables to remove it from the database:

```no-highlight
netbox=> DROP TABLE pluginname_foo;
DROP TABLE
netbox=> DROP TABLE pluginname_bar;
DROP TABLE
```

0 comments on commit a4d7086

Please sign in to comment.