Replacing old phone brands without losing data

Hi,
I have the iPhone 3 and an iPad. I need to get a newer iPhone as well as the iPad. I am not looking at too expensive gadgets. What do you recommend? It doesn’t have to be the latest just a good one is enough. Something that I won’t want to replace soon. And also how can I switch brands without losing iTunes music and apps?
