Install the Android Debug Bridge (ADB)
# check if device is found
# reboot into sideload modus
adb reboot sideload
Or manually boot into TWRP recovery, holding Volume Up + Power when the phone is off. Navigate to
Update MIUI Firmware
Following the docs, I first had to check the Firmware version. I was running V220.127.116.11.QEAMIXM, but V18.104.22.168.QEAMIXM is required.
Download the right MIUI Firmware for your device from https://xiaomifirmwareupdater.com/firmware/dipper/.
Flash the new Firmware via TWRP or via ADB sideload.
adb sideload Downloads/fw_dipper_miui_MI8Global_V22.214.171.124.QEAMIXM_7619340f8c_10.0.zip
Download and flash new LineageOS image
I’m using the LinageOS fork LineageOS for microG. Download it from here: https://download.lineage.microg.org/dipper/ (MI 8 = dipper)
The upgrade steps are the same as for the official rom: https://wiki.lineageos.org/devices/dipper/upgrade. In my case only flashing the new image.
adb sideload Downloads/lineage-18.1-20220602-microG-dipper.zip