[Moto G5 Plus Guides, News, & Discussion] BlackScout:
I decided to make this thread so people won't brick their devices/lose their IMEI/explode their phone when trying to update to the recently leaked/released Oreo Motorola ROM.

This is very information dense. Please, read this and the linked threads carefully and do not miss any step unless told so.

WARNING: This will erase all your data, reset all your settings. MAKE BACKUPS.

I also do not hold responsibility for any negative outcomes out of following this tutorial.

Always look for as many sources of information as you can. There is always something that isn't 100% correct in every tutorial.

Also, making it clear. This is for those who are currently on an Oreo CUSTOM ROM such as Lineage, Pixel Experience or other.

Preparation Steps:

Backup all your important files to your PC. You should do that since everything will be reset.

Make sure your phone is well charged. 80% at least. You want to be safe.

Boot into fastboot.

Install Minimal ADB and Fastboot.

In the command prompt of Minimal ADB and Fastboot, type:

fastboot getvar all

You will see a bunch of lines come up on the screen. Scroll and look for

(bootloader) ro.build.fingerprint[0]

.

This will tell the last version of the Stock ROM (Nougat) you had installed.

Example: "NPNS25.137-92-4" Yours won't/may not be the same.

Write it down somewhere. You will need this version number.

Open this link https://mirrors.lolinet.com/firmware/moto/potter/official/RETAIL/ to download the exact version you found. If anything, download a version above the one you found. Never an inferior. Those are Motorola's Official Nougat ROMs.

Keep it somewhere accessible in your PC and extract the zip. Remember where you put it, you will need it later.

You will now proceed to check your persist partition. Aka: The thing everyone overlooks and screws your IMEI.

IMPORTANT: Take a look at https://xdaforums.com/g5-plus/how-to/fix-persist-resolve-imei0-explanation-t3825147 to find out if your persist partition has permission issues and see if it's recoverable. It is 99% likely that if you are on a custom Oreo ROM that the permissions won't be intact.

If that is the case (most likely), download NZedPred's TWRP Persist Restore zip into your phone.

Feel free to skip these last steps if you have a backup of your persist and efs.

Reboot into recovery and using the most recent TWRP make a backup of your persist and efs. (Information about this can be found on the second post of the "Fix Persist" thread. I am not willing to write a thousand instructions on one thread for the sake of not overcomplicating things.) //****ty steps: have/flash most recent TWRP > backup > select persist and efs > profit

These backups should be on a TWRP folder of the internal storage of your Moto G5. Reboot the phone (or mount USB) and copy that folder to your PC. In case anything goes wrong you will have a copy of your persist.

Steps:

Reboot into recovery (TWRP) using your preferred method. (Be it by the buttons, or via ADB (adb reboot recovery)).

Flash the TWRP Persist Restore zip.

Reboot into bootloader

Open (on your PC ofc) the folder with the extracted files of the Stock ROM zip (NOUGAT).

Open the extracted files folder then press Shift+RMB (Right Mouse Click/Button) and select "Open Command Prompt here" (It may work with Powershell??? If anything, write a post here)

For a quick test, type

fastboot

In case an error pops-up and tells you that it can't recognize such a command. Follow this article https://www.xda-developers.com/adb-fastboot-any-directory-windows-linux/ to add Minimal ADB and Fastboot to your system environment variables

Now, make sure that the path to the left of the typing cursor is the path of the folder where you have your extracted Nougat ROM files.

Please, for your phone's OTA update ability sake. Make sure that you are flashing the exact version you had before. The version you found by running fastboot getvar all.

The commands below will attempt to update the bootloader and gpt. You should NEVER flash an older version of the bootloader.

If you wish, you can skip the GPT/Bootloader commands. I haven't done myself because I flashed the correct version I had before anyway.

Copy and paste these commands and press enter in the CMD.

fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot erase customize
fastboot erase clogo
fastboot oem fb_mode_clear
fastboot reboot

This will flash the Stock Nougat ROM you have downloaded and will reboot your phone. If all goes well you will be back on Nougat, set up your device as normal.

Attention, everything has been reset, erased, wiped.

Oreo OTA Steps:

After setting up everything, check for OTA's. You should be safe to install them. If you are on a recent firmware, you may only need to install security ones. Keep installing and checking until it says there are no more updates available.

This is where people **** up when they downgrade their bootloader by flashing an older Stock ROM than the one they had before.

Before proceeding, double check that there aren't any OTAs available or that Oreo is available at the time of reading this.

If Oreo is officially available, skip all of these steps and be happy.

Otherwise, if at the time of reading, there is a ZIP of the Oreo ROM that matches your region. Download it.

In case of RETLA, RETBR, and RETIN, at the time of writing, this is the correct file:

https://mega.nz/#!DxdSVaJb!5VEht-s6HYCNOZ2hXXVIPdFBqmWCuAvQL1Wzmp7rhZk or https://drive.google.com/open?id=1ZmtSW40oZi1EXD0PsRib3dqIeF9vauAY

In case you are on RETUS, RETAPAC, RETEU, etc. You may need another file that may not be available. The best course of action would be to wait for the Official OTA. :good:

Download it and put in the root of the internal storage of your Moto G5 Plus.

Go to the Settings app. In the Settings app, you'll want to find the OTA App (Motorola Update Services) by showing System apps and enable storage permissions.

Before you proceed: This is apparently indeed the official OTA that they will ship, which seems to be the same as the Soak 4. It's seemingly stable here, so, you should be fine to use that.

Check on your phone for an OTA.

Reboot it.

Check for an update again. There will be a prompt telling you about copying "system" files. Accept it.

After a while, another prompt will ask you about the update. There won't be a changelog, this is normal. Make sure your device is charged and install it.

Wait for the update to complete and you're done.

Tips:

You can also refer to this thread for some more information about fastboot flashing:

https://xdaforums.com/g5-plus/development/stock-firmware-npn25-137-67-5-fastboot-t3694738

Refer to this thread if you need persist information:

https://xdaforums.com/g5-plus/how-to/fix-persist-resolve-imei0-explanation-t3825147

Google and XDA are your friends.

It's good practice to wipe/reset your phone after you're done. Updates usually leave dirt behind. I haven't personally done this myself and everything is OK, but still...

Feel free to correct me on any mistake. It took me about an hour (or more) to write this and I could have potentially overlooked an important detail.