[Magisk] zgfg:
You can extract boot.img and init_boot.img and test them by

fastboot boot boot.img

and[

ICODE]fastboot boot init_boot.img[/ICODE]

Ie, fastboot boot does bot permanently flash but just boots one time - if it fails to boot, simply reboot to your previous System, hence no harm in testing

Find which boot img file boots correctly and use that img

----

I always upgrade the following way (and it has been described in this thread):

- I never uninstall Magisk. Not needed and I want to KEEP all my Magisk settings (Root granted apps, DenyList, modules and particularly the most tedious part for re-installing, LSPosed modules and their settings, not to mention also Viper4Android and so)

- I download the OTA zip upgrade but do not let it to upgrade. You can download manually or lett it Updater do it - but do not confirm it to reboot and to upgrade

- Unzip and extract the boot ing. If you don't find boot.img but a huge payload.bin, google for Payload Dumper to un-archive the bin and to get the img files

- Before upgrading, I patch my boot.img.

- Hence while still in the old System before upgrading, I patch the boot img from Magisk app (Install Magisk, Select and patch...)

- Since you have TWRP, upgrade by installing the OTA zip through TWRP

- At this point I reboot once, just to let it finish the OTA. Once the new System is on, flash either through TWRP or fastboot the previously patched boot img

Actually, I would again boot only temporarily:

fastboot boot patched.img

And when it boots correctly (into the Magisk now, bcs Magisk was not uninstalled), then take Install Magisk, Direct method - ir will now permanently patch itself

Once you reboot, you shall have the fully functional Magisk back, with all the modules, etc

However, if you were doing an Android/MIUI version upgrade, I would rather DISABLE (not uninstall) potentially suspicious modules before upgrading.

To prevent bootloop when you try to boot with the patched new boot img

---

I always store the boot img before and after patching, for various reasons.

Eg, if you did it that way previously, xou would know now did you previous time use boot.img or init_boot.img and you would know which one to patch this tine.

It can help for upgrading Magisk, moving from Magisk to forks like Delta or Alpha, etc

---

Described procedure assumes no Factory Reset, reformatting or wiping Data - if you do that, then all Magisk settings, modules, etc would be erased, ie your old

/data/adb

and in that case you will have to install and configure Magisk, all all itsmodules and root apps from scratch

----

Important EDIT

Sorry, you cannot test with fastboot boot which boot img file from OTA would be the one you will need, before upgrading yet - bcs the boot img and System must match

However, you can extract them in advance and patch them in Magisk app.

If Magisk reports an error whike patching the img (cannot find Ramdisk), then disregard that img, it's not the correct one

After upgrading, test by fastboot boot your patched boot img(es) to find the correct one - if it doesn't boot, just reboot to the upgraded System without Magisk and test the next patched img file

Brw, if you find both boot.img and init_boot.ing, then the latte is most likely the correct one. If you find only boot.img , then no doubt