UPDATE `NEXUS 5`
SET `VERSION`='5.1', `BUILD`='LMY47D', `RECOVERY`='CUSTOM', `ROOTED`=1
WHERE `VERSION`='5.0.1' && `BUILD`='LRX22C' && `RECOVERY`='CUSTOM' && `ROOTED`=1
&& `WANNA_KEEP_USERDATA`=1;
This guide is forked and updated for Android 5.1 OTA from me. Big thanks to the original author eyecatchup and his guide from LRX21O to LRX22C here.
This guide also works without any problems for encrypted phones because data partition is not touched.