Cms: Project Config - Install new plugins before uninstalling old plugins (to preserve data)

Created on 26 Jan 2021  ·  5Comments  ·  Source: craftcms/cms

Description

New Plugin is built to replace Old Plugin. During the installation process of New Plugin, it will

  1. Configure everything it needs for the New Plugin.
  2. Migrate all of the existing data between plugins.
  3. Automatically uninstall the Old Plugin.

This works great when you install the New Plugin normally. And by "normally", I mean in an environment in which allowAdminChanges is enabled. Because when that value is disabled, you _must_ use Project Config to swap the plugins.

If the New Plugin were to be installed first (the desired behavior), it would have a chance to run the entire process as described above.

But if the Old Plugin gets uninstalled first (the current behavior), it deletes all of its relevant data before New Plugin has had a chance to migrate it.

I hope that's clear, I apologize for speaking in the abstract. The project is currently private, so feel free to DM me for details.

Additional info

  • Craft version: 3.5.18
bug

All 5 comments

^ I just submitted two PRs to fix the issue... one for the 3.5 branch, and one for the 3.6 branch.

Let me know if you have any questions. Thanks! 🍺

Merged for 3.6!

Perfect, thanks @brandonkelly! I was probably going to tie this release to 3.6 anyway. 👍

Craft 3.6 has now been officially released ✨

I've already tested with 3.6, and it's working perfectly. Thanks Brandon! 👌

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mccombs picture mccombs  ·  3Comments

rynpsc picture rynpsc  ·  3Comments

RitterKnightCreative picture RitterKnightCreative  ·  3Comments

darylknight picture darylknight  ·  3Comments

angrybrad picture angrybrad  ·  3Comments