Android - How do I back up Google Authenticator?

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.


You don't need to back up the Google Authenticator app/data as you can create a list of 'Backup codes' which you can use to log in without requiring a authentication code on the same page that you configure 2-step authentication.

Why print or download backup codes?

Backup codes are especially useful for people who travel, have problems receiving SMS or voice calls, or cannot use the Google Authenticator mobile app.

Recommendation: You should print or download backup codes

Store these in a safe place (or print them out) and if you lose your phone you can use one of these codes to log into your account and set up a new device with the Authenticator app.

Whilst this applies to Google's 2-step-authentication, any other sites you have configured to use the Google Authenticator app should offer a similar option, or another way to receive codes (e.g. Facebook supports Google Authenticator, their own app and sms as methods to receive codes).


I had the exact same problem.

It turns out that original tokens (usualy represented to the user as qrcodes) are stored in sqlite database inside /data/data/com.google.android.apps.authenticator2/databases folder and can be extracted from the device.

I automated and explained the recovery process here: https://github.com/dchapkine/extract-google-authenticator-credentials

This project extracts original tokens, then generates a web page with qrcodes you can rescan on a new device.

Feel free to contribute.