Project

General

Profile

how to uninstall plugins

Added by Stephanie Collett about 16 years ago

Hi,

I have been looking into adding some plugins to Redmine. If I add a plugin that modifies the database, how would I uninstall the plugin? I've found documentation on installing plugins, but not uninstalling.

-Stephanie


Replies (29)

RE: how to uninstall plugins - Added by Emilio González Montaña almost 16 years ago

I've the same problem...

I will erase the plugin directory directly, but when the plugin has a DB modification, I'm afraid to just delete the folder...

I've checked the down method in db migration, and I will also delete the created tables, and delete the colums added...

Any better solution?

I'm sure there is a RAKE script solution...

RE: how to uninstall plugins - Added by Jean-Baptiste Barth almost 16 years ago

Some infos here : http://dev.rubyonrails.org/ticket/6423
There should be a way with rake, rake db:migrate:plugins PLUGIN=[your plugin name] VERSION=0, but it doesn't seem to work for me, don't know why.
I'm also very interested in a clean solution :-)

RE: how to uninstall plugins - Added by Jean-Baptiste Barth almost 16 years ago

Hum, I read it to the end, and it hasn't been integrated...
Maybe redmine rake task should be updated ?

RE: how to uninstall plugins - Added by Jean-Baptiste Barth almost 16 years ago

There's an Engines task to do this but I didn't managed to make it work ; if you want to investigate, it's located in vendor/plugins/engines/tasks/engines.rake. The syntax is particular since it accepts parameters. It may be run like this : rake db:migrate:plugin NAME=my_plugin VERSION=desired_version, or maybe rake db:migrate:plugin[name,version]. Anyway, rake complains it doesn't know how to build the task, or Engines is not initialized...

I think Redmine developpers wouldn't modify Engines tasks, so I created my own task, it works fine, and I'll submit a patch today.

RE: how to uninstall plugins - Added by Javier Barroso almost 16 years ago

Emilio González Montaña wrote:

I've the same problem...

I will erase the plugin directory directly, but when the plugin has a DB modification, I'm afraid to just delete the folder...

I've checked the down method in db migration, and I will also delete the created tables, and delete the colums added...

How can I apply down method ?

Any better solution?

I didn't find better ( db:migrate_plugins PLUGIN=xxx VERSION=0 doesn't work)

I'm sure there is a RAKE script solution...

Did you find one ?

Thank you

RE: how to uninstall plugins - Added by Benjamin Baroukh over 15 years ago

UP

Is there a good solution for this ?

RE: how to uninstall plugins - Added by Benjamin Baroukh over 15 years ago

See #2265 but still not much progress I am afraid

RE: how to uninstall plugins - Added by Nick Kokkos over 15 years ago

Hi. What about doing:

ruby /script/plugin remove {name_of_the_plugin}. {name_of_the_plugin} must match the plugin name
in /vendor/plugins.

It worked for me!

RE: how to uninstall plugins - Added by note sinotite over 15 years ago

After running:

ruby script/plugin remove ezfaq_plugin

I get:

svn: '/var/data/redmine/vendor/plugins' is not a working copy

What does this command have to do with svn??

RE: how to uninstall plugins - Added by steeven lee over 15 years ago

note sinotite wrote:

svn: '/var/data/redmine/vendor/plugins' is not a working copy

I got same error, need help.
official 0.8.4 release under ubuntu9.04

RE: how to uninstall plugins - Added by Nick Kokkos over 15 years ago

Try the instructions at this blog:

http://nubyonrails.com/articles/the-complete-guide-to-rails-plugins-part-i

Just to quote a part from the blog above:

"To uninstall a plugin, you can:
Delete the specific folder for the plugin
Remove it with svn delete
Unlink it with svn propdel svn:externals vendor/plugins/ "

Hope this helps

RE: how to uninstall plugins - Added by Ethan Fremen over 15 years ago

None of these answers address undoing any schema changes that a plugin has done or removing its data. It looks like uninstall hooks will be available when Redmine uses a newer version of rails.

RE: how to uninstall plugins - Added by Jason van Dyk about 15 years ago

Did we ever get any successful results on how to uninstall Redmine plugins? Yesterday I tried upgrading to the current development version and everything was going fine until I tried to access the settings tab on each of my projects and received an Internal Error, I'll have to guess this is caused by one of the plugins that I've installed not being compatible and like Ethan said none of the above address the removal of a plugin if there has been any schema changes.

If there isn't any current solution, I might have to look through the database and do a manual removal not something I'm looking forward to.

RE: how to uninstall plugins - Added by Anonymous almost 15 years ago

Any progress with this problem?

RE: how to uninstall plugins - Added by Robert Schulze almost 15 years ago

Hi hope this patch helps - does for me ;)
Usage as mentioned before:
rake db:migrate:plugins PLUGIN=[your plugin name] VERSION=0

I would guess, that there is a more decent way of doing this, but this one integrates pretty well.

RE: how to uninstall plugins - Added by Jean-Baptiste Barth almost 15 years ago

In current trunk Engines has been updated, and you can do something like :
rake db:migrate:plugin NAME=plugin_name VERSION=0
It works for me, maybe you can try this and compare with your patch ? (didn't look at it sorry, since I'm on my phone....)

RE: how to uninstall plugins - Added by Robert Schulze almost 15 years ago

well, that works, so my patch gets quite useless (except for people using an old Engines)

The description to my patch, however, was wrong it would be (note '_' not ':' in migrate_plugins, and it's still plural):
rake db:migrate_plugins PLUGIN=[your plugin name] VERSION=0

anyways, while migrating a single plugin works, rake db:migrate:plugins does not (undefined method `migration_directory')

RE: how to uninstall plugins - Added by Anonymous almost 15 years ago

Isn't it possible to create a remove plugin button in Redmine. Would be a lot easier.

RE: how to uninstall plugins - Added by Jean-Baptiste Barth almost 15 years ago

It's nearly impossible, mostly because you need a restart of your redmine instance each time you add or remove a plugin.

And even if you have very simple plugins with limited modifications of redmine core, you can have surprises depending on how you host it : with passenger or mongrel_cluster, you have different instances of the application runnning together, and I think it's a good idea to keep them on the same level / environment.

RE: how to uninstall plugins - Added by Chris Wolf over 13 years ago

The above mentioned procedure does not work for me.

$ rake db:migrate:plugin NAME=redmine_theme_changer VERSION=0
(in /opt/redmine-1.1.1)
Migrating redmine_theme_changer to version 0 ...
rake aborted!
SQLite3::SQLException: no such table: schema_migrations: SELECT version FROM schema_migrations

RE: how to uninstall plugins - Added by Felix Schäfer over 13 years ago

Chris Wolf wrote:

The above mentioned procedure does not work for me.

If you're trying that on a production site, you might need to prepend the command with RAILS_ENV=production.

RE: how to uninstall plugins - Added by Dieter Egert over 13 years ago

So I wrote a short script (name: uninst_redmineplugin.sh ) for redmine installed on a bitnami image (otherwise you just have to amend some paths and replace the restart command for redmine):

#!/bin/sh
rake db:migrate_plugins PLUGIN=$* VERSION=0 RAILS_ENV=production
mkdir -p [redmine_root_dir]/vendor/plugins.inactive
mv [redmine_root_dir]/vendor/plugins/$* [redmine_root_dir]/vendor/plugins.inactive/

/opt/bitmine/ctlscript.sh restart

After creating the scriptfile uninst_redmineplugin.sh you have to make it executable with

  1. chmod 755 uninst_redmineplugin.sh

Then you may start the script with the name of the plugin as parameter:

  1. ./uninst_redmineplugin.sh NAME_OF_PLUGIN

With this script I was able to uninstall some plugins from redmine.

RE: how to uninstall plugins - Added by Dieter Egert over 13 years ago

Dieter Egert wrote:
I was a bit too fast.
The last line in the script needs to be corrected:
If you use indeed bitnami please
replace 'bitmine' by 'bitnami'.
If you don't use an bitnami image you have to use a different command anyway.

RE: how to uninstall plugins - Added by Lawrence Krubner over 11 years ago

What is the correct way to uninstall plugins?

Redmine 2.2.3
Rails 3.2.12
Centos 6.3

I tried:

rake db:migrate:plugins PLUGIN=redmine_charts VERSION=0

but I got an error, there was no rake task called db:migrate:plugins.

So I tried:

rake redmine:plugins:migrate PLUGIN=redmine_charts VERSION=0

and I got:

rake aborted!
uninitialized constant RAILS_DEFAULT_LOGGER

(1-25/29)