LineageOS : upgrade nightly to unofficial, switching keys not working
so, today it worked fine! Here is what I did:

# changing to unofficial, unsigned builds:
adb root # This requires an userdebug/eng build and ADB root access to be enabled
adb shell stop
adb push migration.sh /data/local/tmp/migration.sh
adb shell chmod +x /data/local/tmp/migration.sh
adb shell sh /data/local/tmp/migration.sh unofficial
adb reboot recovery
# Now install the official LineageOS install zip


Then I modified migration.sh replacing the release_keys with my own ones and switched back to official.