Hi everyone following this thread. I thought I would try to write a short guide on how to go from rooted stock Android 8 Oreo to rooted stock Android 9 Pie, based on my experience of doing this myself. Hopefully someone will have some use for this information, the various problems I faced and how I worked around them.
Disclaimer: I'm no rooting expert, but I have rooted my phones since my old SGS2. There are others in this forum who can and should correct me if my advice here is bad in some way.
So, here's my suggested action plan for pulling this off:
1. Presuming you have TWRP recovery installed already on your rooted Oreo SM-N9500, you should start by performing a full backup of *all* your partitions to a microSD card. For some stupid reason, the "internal storage" part of the internal storage (where your photos etc are saved) isn't included in the backup of the "data" partition, but you can trick TWRP to include it by renaming the folder /data/media to /data/media2 or whatever and then change it back if you need to restore the backup. To do this, boot into TWRP (Power off and then vol up + bixby + power) and go to advanced -> file manager. Browse to the folder and then rename it, and then perform the TWRP backup as usual.
2. Prepare:
Download the latest stock firmware from Sammobile, for both the Open China (CHC) and Hong Kong (TGY) versions of the phone to your PC and unzip these files.
Make sure you have
Odin ready to go on the PC.
Download the version of TWRP found in the OP of this thread to your PC.
Download the latest version of Magisk to your phone / microSD card.
3. Log out of your Samsung and Google accounts on your phone to avoid activating the FRP lock (Factory reset protection).
4. On your PC, launch Odin. IMPORTANT: Under options, disable "Auto Reboot". (If you restart Odin, you may need to disable this setting again.)
5. Power down your phone and boot into download mode by pressing vol down + bixby + power. Connect it to your PC and make sure you get the "Com" status showing in the top left of the Odin window. The log should also say "added!".
6. In Odin, click the BL button and choose the BL (bootloader) file from the Open China (CHC) firmware that you unzipped before. Then click the AP, CP and CSC buttons and load the AP, CP and CSC files respectively from the Hong Kong (TGY) version of the firmware. Click Start to begin the process of flashing the new firmware.
7. IMPORTANT! When the flash is complete and you get the green Pass! status, disconnect the phone from the PC.
Hold down all physical buttons, and as soon as the download screen disappears, release the vol up button to boot directly back into download mode.
8. When in download mode, check to see if it says "KG status: prenormal". If so, you need to boot to system and log in to your google account, power off and boot back into download mode. If there is no line about KG Status, or it says "KG status: checking", you should be able to flash TWRP in step 9 below.
9. With your phone in download mode, connect to the PC again and make sure Odin identifies the phone. IMPORTANT: Make sure that the option "Auto Reboot" is disabled. Click the AP button and select the TWRP file you downloaded above. Click start to flash TWRP recovery onto your phone.
IMPORTANT: Disconnect your phone and reboot into recovery by holding down all physical buttons until the download screen disappears, and then immediately release (only) the vol down button. (If this step fails, the stock firmware will replace TWRP with stock recovery and you will need to start over from step 4 or 5.)
10. In TWRP, choose to allow modifications, tap install and choose the Magisk file you downloaded to your phone. Reboot to system and go through the first run guide. To complete the process, install the latest version of the Magisk Manager app.
Congratulations – you should now have a rooted, fully working Note 8 SM-N9500 on Android 9 / pie! (Or you just bricked your phone ... )
If, for some reason, you need to restore the backup you created at the beginning, you may get the error message "failed to mount the partition data" or something similar. If so, go to Wipe and then advanced wipe, and change the file system of the data partition to Ext2 and then back to Ext4, and you should be able to restore the full backup.
I think that was everything. Please let me know if I've made a mistake somewhere and I'll try to correct it.