Fairphone and Android Backups to the Google Cloud

Does the automatic backup of apps, data, wifi settings, etc. work for you on the Fairphone? For me it didn’t.

The first thing I did when I setup my Fairphone was to install the Google Apps. Apparently Fairphone didn’t get a license for them early enough to include them on the phone. But they provided a widget which installed them with one touch. I used that, rebooted and went through Google’s setup process to connect my Google Account with the phone.

What I thought would happen after this is: My apps, data and settings from my old phone would get installed. This had already worked perfectly when I connected my tablet. However with the Fairphone it didn’t work. I don’t mind that not all of my apps are installed. I am not going to use the same set as on the old phone anyway. But restoring all my wifi settings would be really nice. So I went to a quest to solve that issue.

Why does backup & restore not work on the Fairphone?

The first thing I double checked was if Backup & Restore was enabled at all. In “Settings” > “Backup & reset” the option “Back up my data” was enabled. Also “Automatic restore” was ticked. So this should be alright.

However something strange struck my attention. Where usually my Google account should appear only a greyed out text presented itself: Instead of listing my Google account as “Backup account” it only reads “Backing up to debug-only private cache”. That doesn’t sound right, does it? What I really want is that my stuff gets backed up and restored from the Google cloud.

I don’t have a clue why this is set to local only. Maybe I made a mistake when setting up the phone. Maybe it is related to the fact that Google apps don’t come preinstalled on the Fairphone. Maybe Kwamecorp, Mediatek and A’Hong didn’t turn off their developer debugging settings when building the ROM for mass production.

What do you need to fix this?

I don’t know why this is wrong by I know where you can change that setting. Android comes with some nice developer tools to debug issues and resolve them. The tool for testing and configuring backup and restore is called bmgr.

Using adb to fix it

To use adb you have to enable USB debugging. Go the “Settings” > “Developer options”. Turn them on with the switch at the very top of the screen if they are not enabled already. Now enable “USB debugging” on the same screen.

Once you have done this, connect your Fairphone to your computer using a USB cable. On a Mac open “Terminal”. On Windows open “Command prompt”. On Linux open your favourite shell .

If that didn’t work you might have to select which phone to connect to first. Use adb devices and adb connect to do that.

Now you should be all set. Don’t forget to turn off Developer options again.

Check that Backup and restore works

Regardless whether you used the Terminal app or the Android debug bridge you can check if it worked in the Backup and restore settings of your Fairphone: “Settings” > “Backup and reset” should know show you your Google account as backup location. If you don’t have a Google account setup as backup location you can choose one of your existing Google accounts.

Now you’re done if the Fairphone is your first Android phone or you only want to backup for the future. However if you want to restore data from another device on your Fairphone you have to read on.

OK now it data is backed up but not restored form my other device

The previous steps enable cloud backup of your settings, apps, app-data, etc. But it doesn’t restore settings from other devices. That is because the backup manager safes the backups in sets. There is a set for each of your devices. Information gets only restored from the set of each particular device unless you explicitly request a restore of data. For instance this happens if you install an app on one device which already is installed on another device. If this app supports cloud backup, its app-data gets restored. However since our Fairphone already has its own “set” no data gets restored form other devices.

There is different ways to work around this issue. One is to make a full restore (and wipe all existing data from your Fairphone). Another one is to restore only backups for different packages (basically each app on your phone is one package).

Let’s restore backups from my other device

How do I restore information from another device? Remember what I said about sets? You can get a list of sets using bmgr. If you use the Terminal app, open ig again and type su. If you chose the adb approach, enable developer options, connect your device to your computer, open a shell and type adb shell. Now you work as as root on your device either from the Terminal app or from your computer.

To learn which of your Android devices belongs to which set type the following command:

This lists my three devices and the identification numbers of the respective set. Select the device you want to restore data from. “GT-I9000” is my old Samsung Galaxy S from which I want to restore backups.

Now there is two ways: Either do a full backup from the other device or select single packages to restore them.

Restore all apps and data from another device

Wiping all information from the Fairphone and restoring everything from another device is the easy option: Just run the following command and substitue <id-from-the-set-list> with the identification number you got for your device in the above output.

bmgr restore <id-from-the-set-list>

In my case I want to restore the information from the GT-I9000 so I enter the corresponding ID:

bmgr restore 3dbacc3b2001304b

Hit enter. Now the restore is scheduled. To immediately run it type

bmgr run

The scheduled restore is performed. During this process all information from your Fairphone gets wiped and the backup from the other device is restored on the Fairphone.

Select packages to restore

You can also select single packages to restore without resetting the whole Fairphone. That way you don’t lose settings which are unique on your Fairphone. To do that you need to know the package name of the app you want to restore. I didn’t want to do a full reset but was very keen to get the wifi settings from my old phone. The wifi settings are stored in the Android Settings app (yep, Settings is just an app in Android). The package name of the settings app is com.android.providers.settings. There is apps to show the package name of all apps installed on your phone.

Once you know the package name of the app you want to restore type the following command in the Terminal app or in the adb shell and replace <id-from-the-set-list> with the ID of the set and <package-name> with the package name:

bmgr restore <id-from-the-set-list> <package-name>

Since I wanted to restore the Wifi settings form my old phone I did this:

bmgr restore 3dbacc3b2001304b com.android.providers.settings

This schedules the restore. To run it type the following command:

bmgr run

Now my wifi settings are restored and I don’t need to re-enter the details of every wifi network I use.

Conclusion

Somehow the backup and restore to the Google cloud was turned off on my Fairphone. Was that also true for you? Regardless of why this happened I resolved the issue by performing the previously explained steps.