Project

General

Profile

Uninstall Plugins

There might be serveral steps to consider when a plugin needs to be uninstalled.
What exactly is to do depends on the plugin itself.

The following steps are ordered by decreasing plugin complexity.

1. Undo the database migration

This is only necessary when the plugin has created or changed some tables.

cd (redmine_root)
bundle exec rake redmine:plugins:migrate NAME=(plugin_name) VERSION=0

2. Check the database for other entries

Even if the plugin did not change anything in the database structure it can add data to it.

i. Clean up plugin settings

When the plugin has a settings page in the admin area then it is very likely that there are some entries in the settings table.

via Terminal

In order to delete the plugin settings open the command line and enter:

cd (redmine-root)
bin/rails runner -e production "Setting.find_by(name: 'plugin_(plugin_name)')&.destroy"

Afterwards, you can remove or delete the plugin from the plugin directory.

via Database

To delete plugin settings directly from the settings table you need to login into your database. If you are not allowed to do so, ask your administrator when you think it is necessary to delete the settings that way.

In the settings table you need to search for the plugin name written in underscore:

plugin_(plugin_name)

There will be at most one record to delete.

ii. Remove STI database entries

When the plugin uses an existing Single table inheritance (STI) structure in Redmine then you should check if it is necessary to delete those entries refering to the plugin. If you ignore those entries you may encounter errors during runtime after removing the plugin.

3. Delete public plugin assets

When the plugin has some stylesheets or javascript then those files will be in public/plugin_assets. You should check and delete them if existing.

4. Remove plugin gems

Some plugins require further plugins or libraries as defined in a Gemfile located at the plugin's root directory. If there is a Gemfile you should check if the gems defined are exclusively. If so, you can uninstall them with

gem uninstall (gem_name) --version (number or string)