Xiaomi Mi Mix 2 (chiron) : upgrade from /e/ Oreo to /e/ Pie

Hi !

As a defector from Windows Phone I’m quite new to Android, and even more to /e/ and some “cabalistic” operations involved during installation.
So I decided to write some tips down here, as a reminder for me and maybe others :wink:

I won’t detail all operations or include every links, so if someone need it please ask :slight_smile:
Also, please forgive some bad semantics from a poor french guy :clown_face:

At start, my device was working quite well (I flashed it with official /e/ Oreo out-of-the-box).
As a /e/ Pie tester, I wanted to :
= backup my data as much as possible, just in case …
= use a proper upgrade path to ensure accurate testing

I know I’ll have to perform a full wipe & format, so I decided to backup as much as possible (0)

  1. Backup
    This was the hardest job, because of my little knowledge and inconsistency of the information I could find …
  • I double-checked that all cloud-backupable datas are up-to-date (i.e. contacts, pictures)
  • for calls & SMS history I used the useful “SMS Backup & Restore” app (1) to backup them to a local folder, and then auto-uploaded to my own NextCloud
  • connected my phone to PC using USB cable, launched an ADB shell as root
  • from here, I could issue a “adb backup -apk -obb -shared -all -system -keyvalue” (2) to generate a backup.adb file (took a whole coffee mug !). Then I moved the file to an USB key.
  • next, I plugged the USB key using an USB-OTG adapter, enabled ADB debug over TCP/IP (as my only USB socket is used by USB-OTG), and rebooted the phone to TWRP (recovery)
  • using TWRP touch interface, made a backup of boot, data, efs, system, vendor to USB-OTG (this time, I picked a beer :wink: ) Took a note that this method doesn’t include media (user’s) files (3). Also, I tried 3 times using “adb backup --twrp”, each time the file size was quite different ! I know this can be due to logs files or pseudo-databases, but to ensure backup integrity I opted for the USB-OTG method
  • as I wanted my files (media files, which hasn’t been included in TWRP backup) to be readable in Windows without loosing Linux fs or maybe SELinux infos, i used a “tar -cpjf myfile.tjz /data/media/” from an adb shell (4). It gave me enough time to evacuate all the fluids I ingested… :sunglasses:
  • done ! I now have a Android backup, a TWRP backup (NAndroid), and a archive with all my personal files
  • for the app list, I was pleasantly surprised to find a csv file with a full listing of my apps, in /e/ cloud :slight_smile: . It could also be useful to backup apk files (7).
  1. Flash latest stock (Xiaomi) ROM
    Surprisingly, that was the easiest part!
  • I directed my browser to http://c.mi.com/oc/miuidownload/detail?guide=2, downloaded all necessary stuff, followed carefully the instructions (opened another beer :innocent:)
  • at first restart, I skipped and deactivated all I could. The SIM card was a no-data, GPRS-only one (I use it only for my job duties)
  • Miui let me enable Developer Options, good ! So I moved to the next step, reinstall TWRP (I tried to reboot the phone to recovery, leads me to the awful Xiaomi … so it has been overwritten, I expected not less from Xiaomi :wink: )
  1. Reinstall TWRP
    I ensured to have the latest image available (5)
  • rebooted the phone to FastBoot using, keys, Ok
  • launched “fastboot flash recovery” … Access Denied ! I should have pay attention to the “Lock” item in Developer Options :woozy_face:
  • no choice : I have to follow the unlock process (6) and wait a week :frowning: But …no more wait, it took me 1 minute to have my phone unlocked ! Many thanks Xiaomi !
  • rebooted the phone to system (everything has been wiped, had to pass all the first-start screens again), checked in Developer Options : Unlocked !
  • rebooted to FastBoot, installed TWRP as usual
  • I didn’t forget to RTFM and used the buttons at first reboot, so I could check by rebooting from adb that TWRP is truly installed :wink:
  1. Install /e/ Pie
    Piece of cake :slight_smile:
  • in TWRP, wiped+formatted everything
  • still in TWRP, sideloaded /e/ image, rebooted to system (ignored the “No OS” warning)
  • et voilà ! :champagne:
  1. Restore my datas & apps
    As I added my /e/ account at first boot, everything synchronized by /e/ cloud has been restored to my phone :slight_smile:
  • for calls & SMS, I just reinstalled the app and restored from the 2 XML files. Perfect !
  • for apps, I just installed Telegram from /e/ store, downloaded Aurora Store from their support channel, and reinstalled all necessary apps (7)
  • I tried to restore the offline maps for Maps application from my backup, it worked fine :slight_smile:
  1. What else would I do if I had to do it all over again?
  • backups : I didn’t need them, but … Better be safe than sorry !
  • Miui flash : that’s the real pain in the a**. Maybe next time I’ll try some smoother alternative solutions (8)

– Sources –

(0) : https://forum.xda-developers.com/android/general/how-to-backup-restore-android-device-t3602583

(1) : https://synctech.com.au/sms-backup-restore/ I like the exports to XML files, the built-in scheduler, and the easy restore. Note : app will display ads out-of-the-box, but they can be disabled in settings :wink:

(2) : https://forum.xda-developers.com/galaxy-nexus/general/guide-phone-backup-unlock-root-t1420351 (-obb and -keyvalue options are missing). I used all of the options to ensure a full backup, but it was probably too much

(3) : https://twrp.me/faq/backupexclusions.html

(4) : https://github.com/TeamWin/TWRP-busybox I’m lucky to have busybox embedded in my TWRP … Not all TWRP builds have it ! Busybox’s tar is better than Android tar (SELinux support), but a consistent backup may include ACL & XAttrs : https://android.stackexchange.com/questions/218708/how-to-stream-an-encrypted-backup-of-the-entire-device-to-remote-host/219261#219261

(5) : https://twrp.me/xiaomi/xiaomimimix2.html

(6) : http://en.miui.com/unlock/download_en.html

(7) : when backuping everything (step 1) : in Aurora, you can also re-download the apk without installing, or generate an apk from installed app. Just long-press on the app in Aurora’s “My apps” list

(8) : https://xiaomifirmwareupdater.com/
https://forum.xda-developers.com/mi-6/how-to/how-to-avoid-twrp-errors-related-to-t3692393

3 Likes

Nice guide @smu44!!! Thank you very much.
Looks super helpful.

Cool! Anyone trying the same, such a guide saves lots of time.

Official guide is here : https://doc.e.foundation/devices/chiron/upgrade