It is in your home folder in /.mozilla-thunderbird/alphanumeric.default/Mail/.
If you don't have much data in your home folder you can back the whole thing up
and then copy it all back to your user home folder with your new setup. The only
problem that sometimes happens with Thunderbird is that you have to start it
first, before you copy and then overwrite any files that you made.
If you feel up to it, you might want to consider partitioning your drive so that
you have it on its own partition. That way you can re-install Ubuntu or even
switch distros and you don't even have to back up files. Just re-use the same
/home partition and keep the same user name. Be sure that you don't opt to
format the /home partition each time and Bob is your uncle, you are back in
business.