Installing APK signed with different key possible through adb install -r? Android will refuse to upgrade a package, if it is signed with a different key, making me to uninstall first (and lose user data) and re-install.

If I install the new APK via adb install -r XYZ.apk, I switched to the other APK and kept user data. Is that a correct workaround?
Rootless method:

As is mentioned above, you can uninstall an app while keeping its data with adb.

adb shell pm uninstall -k PACKAGE

Do note that it failed to keep data in my test case.

Then you can install the new app with adb install.
Be aware that adb uninstall is invalid as there's no uninstall subcommand for adb. You must connect to a shell on your device and run pm from that shell. However install is a subcommand for adb but it does not take any options, so if you want to run adb install -r you must type in adb shell pm install -r instead.  

Root method (Recommended):

If you have root, you should never miss Xposed Framework. Get Xposed Framework and get XInstaller. Navigate to "Installer Settings", scroll down and tick "Disable Signature Check". Now you can install the replacement app in any way you like.