Do messages, contacts, files get deleted when you upgrade your Android version? Possible Duplicate:
  Will I lose any apps / data if I upgrade my phone’s OS?  




For example if you upgrade from Froyo to Gingerbread, do messages, contacts, files get reset/deleted?
No, they won't get deleted as long as you don't tell you to factory reset. If you're upgrading from stock to stock (or custom to custom for that matter), you're pretty safe with your data, and unlikely to lose anything.

However, if you're going from stock to custom, then there are some cases where you will lose your data.

I'd recommend downloading free applications on the play market that backup your messages. As for your contacts, you will never lose them, as they are synced with your Google account.