5

I've purchased a new phone and have transferred most of the data from the old device to the new one using various means.

There is one app, however, that does not have account login, so I cannot save cached data in the cloud. Meaning that I have no choice but to move/restore the app to the new device with the offline (cached) data.

This app is quite important to me, and I need the offline data.

I know of the following techniques to do this:

  • Backup and restore app + cached data using Helium: copy & replace the 'sdcard/carbon' folder from the old phone to the new phone. After doing this, restore the app with data on the new phone.
  • Root the device and use Titanium backup to do the same.
  • Backup apps using the 'Backup' feature in Google Drive.

Helium just did not work (with a brand new phone with Android 8.0!).

I cannot use Titanium as I cannot root my old phone at this point (before backup is complete). And restoring the app this way will in all likelihood require that I root my new phone as well, which is a deal-breaker.

Does Google Drive Backup work with all third party apps? I did not see the app I want to save in the list of apps whose data was being saved by Google Drive.

What should I do? Can anyone advise?

EDIT:

All of the techniques given on various sites for both partial and full backups (including nandroid backups) are device specific, i.e. you can restore to the same device only, not from one device to another. This includes both Droid Explorer and Simple ADB Backup too, apparently.

Is there no general way of restoring an app with data to a new phone without root? Google Drive backup does this without root. If it can do that, why can't other apps?

Also, various people suggested using MyBackup Pro / Android Assistant / DrFone+. All these tools give up before even trying: they all seem to require root.

13
  • adb backup is pretty general because it stores data in a way which allows restoring to any device. if the app is not allowing adb backup, you still can extract the app from any other backup and convert to adb backup. check if stock recovery has backup option
    – alecxs
    Apr 29, 2019 at 15:11
  • @alecxs: "if the app is not allowing adb backup, you still can extract the app from any other backup and convert to adb backup. check if stock recovery has backup option" please explain what you mean by this :)
    – Y.S.
    Apr 29, 2019 at 18:24
  • some stock recovery have backup option patchworkoftips.com/…
    – alecxs
    Apr 29, 2019 at 20:13
  • @alecxs: LG Nexus 5. Carrier unlocked but not rooted.
    – Y.S.
    Apr 30, 2019 at 12:07
  • twrp is available for hammerhead. but bootloader is locked. you can not boot twrp from fastboot :(
    – alecxs
    Apr 30, 2019 at 12:31

1 Answer 1

4

You can use adb backup. You can specify the package name for backup a single app (for comprehensive details refer to Nikolay Elenkov)

adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|nosystem] [-keyvalue|-nokeyvalue] [<packages...>]
adb restore <file>

Note: some apps won't allow adb backup. even if adb backup is allowed, cache is not included.

Find a [GUIDE] How to enable adb backup for any app, decompile, recompile and sign the apk, where you have set the following flags:

android:allowBackup="true"
android:fullBackupOnly="false"

On the source phone, update the apk with your modified one. To do this without uninstalling, this may require to increment the android:versionCode in AndroidManifest.xml, and you must sign the apk using the same original signature that was used previously for the apk from the Play Store. This is the pitfall if you are not the author of the app it is not possible. However, if you manage this the install will succeed without data loss. Otherwise install will be rejected. (You still have the option to set allowBackup directly on rooted phone, but this may be out of scope because with root you can backup app directly) apparently there is no way to override AndroidManifest.xml during runtime

Once you have installed the modified apk you can make a backup of your app from source phone, and restore it to destination phone without root.

Install the latest Platform Tools and run from cmd.exe as Administrator:

adb.exe backup "-f C:\example.ab -apk -obb com.example.package"

edit:

  • be aware you have compiled a different app that can't be updated via PlayStore anymore

  • starting with api level 30 modified apk is no longer required as the flag seems ignored
    xda-developers.com

  • starting with api level 31 the flag is different

    android:debuggable="true"
    
8
  • 1
    adb uninstall -k <pkgname> will keep the app data, adb install -r example.apk will force the reinstall. not sure if this works with different signatures
    – alecxs
    Jul 24, 2019 at 18:36
  • 1
    @alecxs If this would work it would a security problem as it would allow you to read out private app data. If you try to do so adb install -r ... gives you the following error [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package <app> signatures do not match the previously installed version; ignoring!]
    – Robert
    Nov 6, 2020 at 9:38
  • 1
    @alecxs I found the changes in the official documentation however it only speaks about device-to-device migration, not adb backup. I don't know how exactly the device-to-device backup works but it seems to be different to adb backup as I don't manage to backup app data with targetSDK=30 and backup disallowed.
    – Robert
    Jan 31, 2022 at 10:03
  • 1
    @Robert found another doc developer.android.com/about/versions/12/…
    – alecxs
    Apr 15, 2022 at 17:10
  • 1
    A good finding. That would mean effectively adb backup is dead since Android 12, for all apps that target API 31+ (e.g. all apps from Play Store) even if they declare allowBackup="true". A quick test on my Android 12 device seems to confirm this. Seems like this is the way Google put adb backup EOL (it was already deprecated for several years).
    – Robert
    Apr 15, 2022 at 17:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .