[Xiaomi Mi 8 Guides, News, & Discussion] tsongming:
I am making this post to serve as a All in One Guide for Rom installation or switching to Miui Beta Roms. Happy Flashing!

This post is for people looking for first time Rom flashing instructions, or people wanting to go back to a Miui Rom

__________________________________________________________________________________________________________

I have been told that this post is too long and I agree, so it will be improved upon ASAP ( within a couple of days)

TO BE CLEAR,

If you have unlocked your bootloader, install TWRP and then YOU Must Format Storage

Next flash the Global Rom and flash root.

Boot to system, and go past Google Assistant setup.

Now you can reboot to recovery and dirty flash the EU Beta Rom or my preference the Mi-Globe EU Beta ( more options)

Dirty Flash Beta Rom , then reflash root, reboot to recovery, clear cache and reboot to system

Done

__________________________________________________________________________________________________________

If you are experiencing issues: you are likely dealing with encryption problems that are caused by certain roms.

In addition you need to ensure that you are not only using the correct files needed for your device ( Chinese or Global) You will want to use the most current Vendor and Firmware files.

Go to the first post below this OP for Custom Rom installation steps and to download the Vendor and Firmware files.

THese instructions assume that you have already unlocked your bootloader

⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧ Click Link for unlocking Bootloader ⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧

Two methods for your rom installation

See instruction below for preparing your phone for your very first installation

Flashing TWRP: You can use ADB, Mi-Flash or >>The All in One Tool ( I Recommend the All in One Tool) )

You need to be in Fastboot Mode ( Enter Fastboot by Pressing and holding the volume down and power simultaneously)

Using ADB

1. Install ADB/Fastboot tools on your computer

[*]Enter fastboot mode on phone (hold power and VOL -)

[*]Make sure adb can see and control your device

[*]Run { adb reboot bootloader } - No spaces (before/after)

[*]Run { fastboot devices } to make sure you see your device

[*]Run { fastboot oem device-info } just to reverify your unlock status

[*]Run { fastboot boot recovery_twrp-3.2.3-1-dipper.img}

[*]Reboot back to TWRP ( Press and Hold Volume up and Power button simultaneously) and then begins the installation of your Firmware, Vendor, Root, Your Rom of Choice, and Gapps ( only If needed) and then Magisk 18.1 again. ( Note DM Verity is built into Magisk 18.1)

[*]If you wiped data, your device will now proceed to re-initialize itself as if from the factory

[/LIST]

If you do not own an OTG adapter and a good sized USB drive , buy them and save yourself many hassles

You will save your self a lot of time, especially if you want to fully save a complete Nandroid backup for later re-installation or transfer to your desktop. Thanks to [MENTION=6383156]The War Profiteer[/MENTION] for correcting my assumption that the Mi8 has superspeed transfer capability via its usb port ( It does not!)

Regardless using an OTG adapter is still convenient when you are away from your network and need to quickly restore a backup, I have one shaped like a key that I keep with me at all times.

To remove encryption you will always need to format the storage

Not wipe >> choose Wipe > then choose > Format data > > type "yes" to format

Now You Must reboot to Recovery, or the installation may not recognised the formatted data partition

If you see a message that says there is no OS installed are you sure > Don't worry about it, yes, you need to reboot to Recovery

After Formatting and booting to recovery

Install Firmware and Vendor, then install Rom, and whatever else is needed for that installation such as Gapps and Root.

Let's repeat this steps again for Clarity.

Installation of Firmware, Rom, Gapps, Magisk

Boot into TWRP recovery

1. Go to "Wipe" and then to "Advanced Wipe".

2. Mark "Dalvik / ART Cache", "System", "Data" and "Cache".

3. "Swipe to Wipe" and proceed back the main menu.

4. Go to "Install" and install base firmware and vendor if needed. ( See first comment below for files)

5. Select the ROM's zip file and then press "Add more Zips" and select the Gapps zip file ( If needed) , and then the Magisk root file.

6. "Swipe to confirm Flash" and wait

7. After the flashing is finished, just reboot to Recovery, Check Boxes > Reboot to system

Finished!

More about the All in One Tool

The tool is an easy way to resolve a myriad of issues.

It keeps your desktop drivers and adb up to date and provides ADB system wide privileges

See More about all in One tool by clicking unhide

USE [MENTION=4712355]mauronofrio[/MENTION] "TOOL ALL IN ONE""

It can be used for removing encryption, installing TWRP, Root, your ROM, Gapps, and even to restore to stock Recovery, or to flash a stock Rom

TOOL ALL IN ONE : https://xdaforums.com/mi-8/development/tool-tool-one-driverstwrpfactory-t3895807

If your device not recognized, there is little doubt that it is a desktop USB driver issue, so ensure that device drivers are installed

You will need to reinstall the Google USB driver, and while you are at it check to make sure adb is up to date.

FYI: The All in One tool can do all of this for you, it's done within the advanced menu section.

You will need to temporarily disable Windows defender for installation.

Typical Custom Rom flashing Pre-Instructions - this is relevant to all non Miui , custom roms.

Update firmware & vendor by flashing : Firmware and Vendor from here : https://mega.nz/#F!tZQDSSzZ!3z0iX5nlwwr6RNjJDid39A

Alternate: https://mega.nz/#F!tZQDSSzZ Passkey: 3z0iX5nlwwr6RNjJDid39A

You can also find the latest Vendor and Firmware drivers here : ( Smaller No bloat) https://xiaomifirmwareupdater.com/#stable

1. Flash Firmware and vendor, when flashing vendor choose Mount and then check vendor only, then flash.)

2. Flash Force Decrypt, then Flash ROM of choice & OpenGapps ( if not included in Rom)

3. Flash Root, Reboot to Recovery, Reboot to system.

If coming from Oreo ( You must first have Miui Stable installed Version: MIUI 10.0.2.0)

[*] Flash MIUI V10.0.2.0.OEAMIFH global stable Rom DON'T REBOOT

[*]Flash Disable_Dm-Verity_ForceEncrypt Here DON'T REBOOT

[*]Wipe Data,System,Cache Your Data will be lost

[*]Flash Rom of Choice + Gapps

[*]Reboot and Enjoy[/LIST]

If want to go back to Miui

Flash firmware based on last Official Miui install , Flash root ,

Reboot to Twrp Recovery and perform factory reset

Then flash Miui Rom of choice. and Root if wanted

Enjoy

Please Read - Jan 2020 update

Edit: This post was assembled in March of 2019 : It needs some updating which I will do, when I have time and feel like spending it on updating this thread. Disregard versions of Firmware listed on this OP, those suggestions are now irrelevant. Instead follow the advice from the Rom developer. Very often the rom will include the vender and driver firmware ( AKA DFE)

I definitely recommend using the version of TWRP that I linked here: https://xdaforums.com/showpost.php?p=81329605&postcount=366

For additional suggestions, check my next posts, immediately after the OP ( first comments ) and for update information check here:

https://xdaforums.com/showpost.php?p=81372749&postcount=74