There is always a risk with any upgrade and so you should dump your databases beforehand, however this is normally a very straightforward upgrade. I'd recommend actually upgrading to 5.5 afterwards whilst you're at it as 5.1 is end of life this year.