[OnePlus 3 & 3T Cross Device Development] TomConVerd:
The instructions greatly helped me to upgrade from LOS 15 to LOS 16. However, what did not work was that after I locked the bootloader in step 4 I couldn't boot into TWRP (I still could start fastboot using the keys, but it wouln't boot the recovery rom (just showing a battery, or a blank screen). On another post I read it's not a pretty advisable thing to lock the bootloader again unless you know what you are doing. So I unlocked it again and tried it another way.

I continued with the installation and found out that the key is to

1) format the data partition after the new OP3T ROM 9.0.6 has been installed (which has an incompatible way of encrypting the data compared to version 5.x)

2) using a specific, patched version of TWRP to do the format of the data partition, otherwise encrypting the phone from LOS fails (it tries to encrypt, but nothing happens, not even a reboot).

So I will try to give the complete instructions in modified form.

So this is where I came from:

- Oxygen ROM 5.x

- LOS 15.x (latest version)

- Unlocked boot loader

- TWRP (version does not matter)

- Encrypted device

This is what I want to achieve:

- Oxygen ROM 9.0.x

- LOS 16.x (latest version)

- Unlocked boot loader

- Encrypted device

Prerequisites for the installation:

- Install the android Sdk (platform tools) on your computer

- Download the latest LOS 16.0

- Download the latest Oxygen ROM 9.0.6 (links are here: https://xdaforums.com/showpost.php?p=79769445&postcount=2516)

- Download patched version of TWRP (prepared by dianlujitao https://xdaforums.com/member.php?u=5091734) which fixes the bug explained in https://www.reddit.com/r/LineageOS/comments/awlfyb/psa_for_everyone_flashing_los16_on_op3t_latest/. Take the link from there (https://androidfilehost.com/?fid=11410963190603865871)

So this is the summary of the steps I did:

Explanation: [xxx] means where you are doing this, e.g. [TWRP] means using the menu in the recovery rom to perform the action

1. [LOS 15.0] Check in developer settings that the Bootloader unlock is done (important - if you cannot boot to system and recovery with locked BL you have to unbrick the phone - more work for your..)

2. [TWRP] Nandroid Backup with TWRP (backed up /data, /system and /boot. /system and /boot is not necessary because /system and /boot one could reinstall with the installation zips)

3. [Computer with platform tools] Backup the whole internal storage (via adb pull -a /sdcard .) - MTP protocol is too unstable

Also - of course - transfer the Nandroid Backup to your computer (as it's in the internal storage this should go in one step..)

4. [TWRP] Wipe /system

5. [Computer with platform tools] Copy Firmware 9.0.6, LOS 16.0, OpenGapps(optional) and Magisk(optional, for rooted device) to the device. Use adb push <filename> /sdcard to do that.

6. [TWRP] Install the copied files in the same order.

7. [TWRP] Reboot into fastboot for step 8. If you have done that already, reboot anyway into TWRP and go to step 10.

8. [Computer with platform tools] Flash the patched TWRP (with command fastboot flash recovery ...)

9. [Fastboot] Boot into TWRP

10. [TWRP] Format /data with file sytem F2FS. The patched version reserves enough space for the encryption header.

11. [TWRP] Reboot into system

12. [LOS 16.0] Perform initial steps for the new system

13. [LOS 16.0] Check Baseband version (MPSS.TH.2.0.c1.9-00102-M8996FAAAANAZM-1.197095.1.198697.1) All fine.

14. [LOS 16.0] Encrypt the device including a new boot-PW. The encryption starts, then a reboot happens which performs the encryption of the data partition.

15. [LOS 16.0] Reboot into TWRP

16. [TWRP] You are requested to enter your password to decrypt the data partition. TWRP should be able to decrypt it now.

17. [TWRP] Copy all the backup data to the phone using adb push -a ./sdcard /

18. [TWRP] Restore Nandroid backup, select only the data partition

If you would boot into the system now, you would get the message (this problem is already known):

"Error: system could decrypt data."

But you cannot unlock and fingerprint isn't recognized. So instead stay in TWRP and proceed with the next step

19. [TWRP] Delete files with the TWRP file manager to solve this problem:

/data/system/locksettings.db

/data/system/users/0/fpdata/user.db

/data/system/users/0/settings_fingerprint.xml

20. [TWRP] Reboot into LOS.

21. [LOS 16.0] Unlock now succeeds. Optional: Install fingerprints

Hope this helps!