MyBB Community Forums

Full Version: Best way to update plugins?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Most plugins instruct you to deactivate or uninstall the plugin, delete the file then upload the new one and install and activate.

Is there a better way?

I don't particularly want to lose my modifications and settings every time I update (that's why I don't update most of my plugins and code my own fixes as necessary).

Can I say... serialise all of my settings and templates, store them as a temporary setting or template, upload the new plugin, then run a function to import them (and make changes as necessary keep them up to date)?

Thoughts?
Edit: I was tired and didn't fully understand your question, sorry.

If I was making modifications to plugins (written by other people) WinMerge works great for smaller plugins that don't have many files.

(2012-07-05, 07:55 AM)Jazza Wrote: [ -> ]Most plugins instruct you to deactivate or uninstall the plugin, delete the file then upload the new one and install and activate....

I guess that depends on where you get most of your plugins from. Toungue
...uninstall the plugin is not standard for MyBB plugin upgrades.

(2012-07-05, 07:55 AM)Jazza Wrote: [ -> ]...Is there a better way?...

Yes, Much better.
Try these plugins:
http://mybbhacks.zingaburga.com/forumdisplay.php?fid=29
I said or uninstall.

My plugins add and remove templates when they install and uninstall, so if I make critical changes to templates, I'd need to do that (one od the reasons why I'm asking this question). It's only really an issue in the early stages of my plugins (all of my plugins are in their early stages for I just started writing plugins).

Try those plugins? I don't particularly want to install plugins just to see how they do it (lazy me is lazy). How exactly do those plugins do it?
Most plugins instruct you to deactivate or uninstall the plugin, delete the file then upload the new one and install and activate.

^^^
That does not match my experience.
Sorry, if I didn't properly understand your question.
(2012-07-05, 08:48 AM)seeker Wrote: [ -> ]Most plugins instruct you to deactivate or uninstall the plugin, delete the file then upload the new one and install and activate.

I was being a bit generic there. I meant that most (all?) plugins require you to "remove" it from your forum before updating, meaning your data will be lost.

I want to overcome that issue somehow. My first idea was to store all settings temporarily then update settings with the updated plugin.
Hi again,
Let's re-start by "getting on the same page."

Questions?
1) You want to know the best way for a developer to update plugins?
2) As an end-user you avoid updating some plugins, especially if you have made modifications.

Answers:
1) Newpoints (for example) uses an upgrade script (when needed), to deal with template and DB (schema) changes, so the end user never loses data or settings.

2) ... might be a subject for another thread, to avoid confusion?


(2012-07-05, 09:02 AM)Jazza Wrote: [ -> ]...I meant that most (all?) plugins require you to "remove" it from your forum before updating, meaning your data will be lost...
This is not true, AFAIK.

ps. I hope someone else can help give a more complete answer.
Not all plugins, I don't like my plugins requiring deactivating to be updated. Most of it depends on the developers of the plugin.

... I will say the only way to avoid your issue, is to manually review the plugin and apply the patch manually, but I see you already know that.
(2012-07-05, 09:54 AM)seeker Wrote: [ -> ]Answers:
1) Newpoints (for example) uses an upgrade script (when needed), to deal with template and DB (schema) changes, so the end user never loses data or settings.

Oh yeah. I have NewPoints installed and have been updated it, but if I did, I would've realised this.

I think doing this kind of thing will be the way to go unless it's a big change (so like 1.6 to 2.0). Thanks for your responses guys.
If plugin developers would follow a standard then it would be less of an issue. My "standard" is:

Install:
- make schema changes
- add settings and/or setting groups
- install tasks
- add new templates

Activate:
- change templates to make plugin content visible
- run upgrade script I include with some plugins
- update custom cache with latest version

Deactivate:
- undo changes to templates to make plugin content no longer visible

Uninstall:
- Remove schema changes
- Remove settings and/or groups
- Remove tasks
- Remove templates added
- Remove custom cache items for the plugin

Following this style, you can upgrade the plugin without loosing any settings as settings are only removed during an uninstall. By deactivating you avoid issues of MyBB wanting to access files that are partially uploaded or incompatible with other files in the plugin package that have not yet been uploaded.
(2012-07-06, 05:52 AM)pavemen Wrote: [ -> ]If plugin developers would follow a standard then it would be less of an issue. My "standard" is:

Activate:
- change templates to make plugin content visible
- run upgrade script I include with some plugins
- update custom cache with latest version

I'm liking this idea of running an upgrade script with every activation, just to be sure.
Pages: 1 2 3