Home > Tips and Tricks

Create and Restore App Data Backup via ADB Commands

In this guide, we will show you the steps to create and restore app backup via ADB commands. While most of you would already have added a Google account to your Android device and enabled sync. However, when it comes to apps, then this sync only keeps track of the list of installed apps, it doesn’t back up its data. As a result, when you perform the restore, then only the app will be auto-downloaded and installed on your device, there will be no hint of its data anywhere.

You’ll have to set up the app from scratch and resync the data from their servers. However, not only this could prove to be a serious and time-consuming task, but this feature is only supported on a handful of apps. So what else could be done? Well, there exists a hidden and underrated method that will allow you to create and restore app backup via ADB commands. And in this guide, we will show you how to do just that. Follow along.

How to Create and Restore App Backup via ADB Commands?

According to Google, this method has been depreciated on newer Android versions, however, it hasn’t explicitly mentioned the version number. So first try out this tweak on an app of less importance and if it manages to backup and restore it, then only implement these steps on the required apps of your choice.

The Prerequisites

These requirements are needed for both creating and restoring the app data. So make sure to checkmark both of them.

  • To begin with, download and extract Android SDK Platform Tools.
  • Then enable USB Debugging on your device and connect it to your PC via a USB cable.Create and Restore App Backup via ADB Commands
  • Then head over to the platform-tools folder address bar, type in CMD, and hit Enter.
  • This will launch Command Prompt, which will be used throughout this guide [both for backup and restore].
  • Also, get hold of the package name of the app that you want to backup and restore.

Create All Apps Data Backup via ADB Commands

  1. Type in the below command to take a backup of all the data on your device
    adb.exe backup -apk -shared -all -f ./backup.ab
  2. The data backup screen will now appear. If you want to encrypt it, type in the password, or else leave it empty.
  3. Then tap on Backup my data and the process will now start.
  4. Once done, you’ll get the backup file in the platform tools folder.
TIP: backup.ab is the name of the backup file and the extension ab stands for Android Backup

Create Individual App Data Backup via ADB Commands

  1. First off, find the package name for the app whose backup you want to take [in our case, it’s pl.solidexplorer2].
  2. Now type in the below command to get the path of that app [replace package-name and package-name-backup. You could keep the package-name-backup same as the package-name]
    adb backup -apk package-name -f package-name-backup.ab

    Create and Restore App Backup via ADB Commands

  3. In our case, the command will be:
    adb backup -apk pl.solidexplorer2 -f pl.solidexplorer2.ab
  4. You’ll now get a prompt on your device, tap on Back Up My Data.
    Create and Restore App Backup via ADB Commands
  5. You should now get the app in APK and its backup in ab format in the platform-tools folder.
  6. NOTE: To backup multiple apps at once, use the below command:
    adb backup -f  -apk <package-name> <package-name>

Restore All Android Apps Data Backup via ADB Commands

Create and Restore App Backup via ADB Commands

  1. Open CMD window inside the paltform-toools folder.
  2. Make sure that the backup.ab file is present there.
  3. Now execute the below command in the CMD window
    adb.exe restore ./backup.ab
  4. You’ll get a Full Restore prompt on your device.
  5. If you have encrypted the backup, type in the password.
  6. Finally, tap on Restore my data and your task is complete
  7. NOTE: If the above command doesn’t work, then you may also try the below one:
    adb shell 'bu restore' < backup.adb

Restore Individual App Data Backup via ADB Commands

  1. First off, install the saved APK file that you had got in the platform tools folder.
  2. Then type in the below command to restore the app data [replace package-name-backup]
    adb restore backup-name.ab

    Create and Restore App Backup via ADB Commands

  3. In our case, this command transforms to:
    adb restore pl.solidexplorer2.ab
  4. You’ll now get a prompt on your device, tap on Restore My Data.Create and Restore App Backup via ADB Commands
  5. The process will now start and could take a few seconds.
  6. Once done, launch the app and start using it from where you last left off!

That’s it. These were the steps to create and restore app backup via ADB commands. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share: