I am trying to upgrade my OPO's operating system from CyanogenMod to the latest nightly version of LineagOS.
As a first step, I tried installing TWRP, by executing from my shell the command:
fastboot flash recovery recovery.img
But I got the following message:
FAILED (remote: Device not unlocked cannot flash or erase)
I read in a few places that I should first unlock my device by executing the command
fastboot oem unlock, but that it is going to erase all my data.
Is it true? Is there a way to avoid the erasure of the data?