Flashing a stock Android image without wiping user data

Software Android

Until today my Nexus 10 was running Android 4.4.2 (stock firmware from Google). I couldn’t install the OTA update to 4.4.4 because I had installed a custom recovery (TWRP) in order to root the device. So today I decided to reinstall the stock recovery and install the update… But the installation failed. The tablet was able to reboot, but it showed that is was still running Android 4.4.2, but cound not find any update anymore. Weird…

(IMHO the problem that happened is that when I reinstalled the stock recovery, I installed the version from the 4.4.4 firmware, but the OTA update expected to have the version from the 4.4.2 firmware. Can this cause the install to fail like this? Not sure, but I have no other explanation.)

So in order to update to 4.4.4 without wiping my device I had to do it by hand:

And voilà! The device booted to Android 4.4.4 and I didn’t lose my data. However root access was lost, but that is extremely easy to restore:

I’m sure all of this is common knowledge for a lot of people. But it’s not obvious to me, so I’m just putting it here for the next time I need it 😃

EDIT: Just tried it and I can confirm that it works well to upgrade from Android 4.4.4. to Android 5.0 “Lollipop”!