Backing-Up and Transferring Gmail
This is probably the best tool to backup or transfer Gmail accounts. It also is a more robust tool than the surprisingly buggy Google Email Uploader (GEU, made by Google). It saves each email as an .eml which can be double-clicked to be read in Windows and allows for import in to most email programs with ease. It works with Gmail and Google Apps Gmail accounts and can therefore be used to migrate a personal Gmail account to a Google Apps one. Can also be run from the command line. Works on Windows, Linux, Mac etc. Documentation is limited.

