LineageOS : upgrade nightly to unofficial, switching keys not working referring to: LineageOS : upgrade nightly to unofficial

@Taknok:
Did this work for you? I tried to follow the instructions on the Wiki page you mentioned, but it did not work. I always ended up with the error described above.

I tried to run "migration.sh unofficial" from recovery which resulted in an error message:


  CANNOT LINK EXECUTABLE "/system/bin/sh": cannot locate symbol "__aeabi_memset" referenced by "/system/bin/sh"...


I run the same script while LineageOS was running:

$ adb shell sh /data/local/tmp/migration.sh unofficial  
Official to unofficial migration  
Saving backup as /data/system/packages.xml.bak  
Done  


But when I go to recovery to flash my own build it still says:  


  Can't install this package on top of incompatible data. Please try
  another package or run a factory reset


How did you manage to do it?
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.