Lack of interest Mark this addon as legacy (for renaming XF2 addon_id)

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Sim

Well-known member
Based on this thread: https://xenforo.com/community/threads/legacy_addon_id-for-renaming-xf2-addon.152052/

It would be useful if we had an admin option to mark an installed addon as legacy which simply flips the is_legacy flag for the addon.

We can then use this if we need to change the addon_id for an addon - it would become part of the upgrade process that we instruct forum operators to use and would allow us to "upgrade" to the new addon_id (retaining all options and data) rather than installing a new addon and then deleting the old one.

For example - in the tools menu for an Installed add-on, we could simply add another option "Mark as legacy" which changes the flag in the database without us needing to edit the database directly to achieve this.

1534033453836.webp


All the developer needs to do is set the old addon_id into the legacy_addon_id field of the addon.json file in the updated addon and then provide upgrade instructions to forum operators who want to upgrade the old addon:
  1. Find the installed addon and mark it as "legacy" using the new addon tool menu option - old addon will show in the UI as "legacy" and will be disabled automatically
  2. Extract the renamed addon release code to the forum directory (existing code will not be overwritten because of new addon id) - forum will automatically identify the new addon as an upgrade to the old addon and give the user the option to Upgrade
  3. Old addon will be uninstalled as part of the upgrade process and thus the old addon directory can now be deleted without any data loss (old addon shows as "Installable" while it remains on the filesystem)
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
I think this will only lead into trouble, because many people will install the remaining old "installable" add-on together with the new one and break their forum.

This will only work, if the old add-on will be deleted automatically after the upgrade has been done (or at least the installation prevented). Means a whole add-on management framework would be needed.
 
It is certainly something which needs to be done with care (and this is why backups exist) - but it's a rare occurrence (and usually a once-off) and most addons which don't save data don't need any of this - you just delete the old one and install the new one.

Upgrade instructions absolutely need to include removing the old files from the filesystem after the upgrade has completed to avoid the risk of accidentally reinstalling the old addon.

It may be better to only show this option in debug mode - remove the opportunity to accidentally enable the legacy flag.

Either way - it's fairly trivial (but arguably more risky) to do this manually in the database. The UI would just be a nicety.
 
Back
Top Bottom