hi there
i know exactly what you're talking about. I'm alway doing the same kind of thing. i end up talking myself out of being able to do something. But i think your right when you say its all mental. If you know you could have done it a year ago, nothing is stopping you except you mind.
I try and always watch a better rider go through before me, thenn you just have to get on and do what they did wihtout thinking about it.
My friend told me a good techinique for this kind of thing. try and picture what you have to do after the upcoming obstacle. so if your faced with a big climb that looks a bit scary, think about what is following it, say, how you plan on descending back down the hill, something like that. so the theory is if you think about what next, then you dont talk yourself into failing on whats in front of you, because you have told yourself you need to get past it.
Maybe difficult to explain / understand. but it works for me. The key is to visualise yourself beyond where you currently are. - does that make sense?
other than that. If your really not having fun because you seem to be trying to hard. dont try as hard and remember why you put yourself through all this - its meant to be fun!