How to flash TWRP over CWM recovery in Nexus 5? In order to upgrade my encrypted CyanogenMod installation I need to use the TWRP recovery instead of the CWM.

I have already tried multiple ways to flash TWRP recovery including ROM Manager but it always gets back to CWM when I boot to recovery.

Any solutions?
You didn't specify which device you own, but by the tag I assume it is a Nexus 5.
Flashing TWRP is pretty easy, especially on Nexus devices. 

Download the newest .img file here:
http://techerrata.com/file/twrp2/hammerhead/openrecovery-twrp-2.8.0.1-hammerhead.img

Turn off your device.  Turn on the device and keep holding volume down until a menu shows up.  The device will now be in fastboot mode. Plug the device into your computer.  If you have the right drivers installed, your screen should now say FASTBOOT USB.  Run the following command via the command line (in the directory the ADB is installed):

fastboot flash recovery openrecovery-twrp-2.8.0.1-hammerhead.img

Note you will also need adb and fastboot for your computer.

If you don't have ADB or the correct drivers installed, I recommend downloading Wugfresh Nexus toolkit from here:
https://www.androidfilehost.com/?fid=95747613655047107

And follow the instructions for installing the drivers.

OR - if for some reason you're having trouble with the above, just download Wugfresh Nexus toolkit (link above) and select root my device (make sure to check 'install custom recovery').