How do I back up Google Authenticator? I'm starting to use Google Authenticator for more and more things now, but I've just realized that if I lose my phone, or if I need to wipe and restore it to install new firmware, I will lose all of my codes.

Is there anyway to back them up please? Or some kind of fallback that means I can restore it to a new device?

Thanks
The following method will only work rooted Android devices.

Linux:

adb pull /data/data/com.google.android.apps.authenticator2/databases/databases /AFolderOnPC

Windows:

adb pull /data/data/com.google.android.apps.authenticator2/databases/databases C:\AFolderOnPC

Note that the folder on the PC has to already exist.

This will copy the authenticator database files with the main keys, from which the One Time Passwords are generated, to the PC. The file can then be restored to the same location, on Android devices, or read with an sqlite database viewer to extract the keys.