FORUMS
Remove All Ads from XDA

[GUIDE] Backup your data without root.

1,542 posts
Thanks Meter: 1,254
 
By bitdomo, Senior Member on 22nd July 2014, 09:49 PM
Post Reply Email Thread
In this thread I am going to use adb backup command to backup user app datas and apks. I am aware of the fact that Helium backup does the same just with a nice GUI, but I beleive it is important to know these basic tools like adb backup. I know many of you just causal android users who don't like wrting commands and etc... but for people like me it was an interesting discovery that this magical Helium backup is not that magical at all.

What is adb backup?

Some of you may know that it is not possible to root your Nexus 5 wihtout a full wipe. Adb backup is a tool which let you back up your data on your phone without root. Then after root you can easily restore your data.

Adb backup parameters:

Quote:

adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|nosystem] [<packages...>]

Quote:

  • -f <file>: backup file name. Without this parameter the name of the backup file will be backup.ab
  • -apk: save apk
  • -noapk: don't save apk
  • -shared: save sdcard content
  • -noshared: don't save sdcard content
  • -system: save system app data
  • -nosystem: don't save system app data
  • <packages...>: save the app data for the app or apps given as parameter
  • -all: save systam app data and user app data

Requirements:
  • Ability to use adb command.
  • Have usb drivers installed. (Windows users)

Seting up adb and installing drivers are not part of this guide. If you have to do that then please use @rootSU's great thread to find the guides you need.

Let's start!
  • Enable USB debugging on the phone.
  • Connect USB cable.
  • Open CMD or terminal window.

Depending on what you want to do, backup only user app data with apk or without apk or just certain apps, you will have many options. I will try to cover everything to serve everyone's need.
  • Type any command to CMD or terminal window which suits your needs.
  • After executing the command you will be prompted on your phone to start the backup:
  • You can give a password for your backup if you want
  • Select Back up my data on your phone to start the backup.

Option 1: Backup only user app data with apk.
(Note: you can't backup paid app apks)

Quote:

  • adb backup -all -apk -nosystem

If you want to give a custom name for the backup then just add the -f switch and type a name you want to give to the backup file.

Quote:

  • adb backup -all -apk -nosystem -f backup-2014-07-22.ab

You will find the backup file in your Username folder if you added the adb command to your path or installed the 15 secs adb installer (windows users). Otherwise it will be in the folder where the adb binary is.
  • Windows: C:\Users\<username>
  • Linux: /home/<username>


Option 2: Backup only user app data without apk.

Quote:

  • adb backup -all -nosystem

If you want to give a custom name for the backup then just add the -f switch and type a name you want to give to the backup file.

Quote:

  • adb backup -all -nosystem -f backup-2014-07-22.ab

You will find the backup file in your Username folder if you added the adb command to your path or installed the 15 secs adb installer (windows users). Otherwise it will be in the folder where the adb binary is.
  • Windows: C:\Users\<username>
  • Linux: /home/<username>


Option 3: Backup system app data and user app data with apk.
(Note: you can't backup system app apks)

Quote:

  • adb backup -all -apk

If you want to give a custom name for the backup then just add the -f switch and type a name you want to give to the backup file.

Quote:

  • adb backup -all -apk -f backup-2014-07-22.ab

You will find the backup file in your Username folder if you added the adb command to your path or installed the 15 secs adb installer (windows users). Otherwise it will be in the folder where the adb binary is.
  • Windows: C:\Users\<username>
  • Linux: /home/<username>


Option 4: Backup system app data and user app data without apk.

Quote:

  • adb backup -all

If you want to give a custom name for the backup then just add the -f switch and type a name you want to give to the backup file.

Quote:

  • adb backup -all -f backup-2014-07-22.ab

You will find the backup file in your Username folder if you added the adb command to your path or installed the 15 secs adb installer (windows users). Otherwise it will be in the folder where the adb binary is.
  • Windows: C:\Users\<username>
  • Linux: /home/<username>


Option 5: Backup everything.
System app data, user app data with apk and sdcard content.
(Note: you can't backup system app apks and paid user app apks)


Quote:

  • adb backup -all -apk -shared

If you want to give a custom name for the backup then just add the -f switch and type a name you want to give to the backup file.

Quote:

  • adb backup -all -apk -shared -f backup-2014-07-22.ab

You will find the backup file in your Username folder if you added the adb command to your path or installed the 15 secs adb installer (windows users). Otherwise it will be in the folder where the adb binary is.
  • Windows: C:\Users\<username>
  • Linux: /home/<username>


Option 6: Backup certain app or apps.
(Note: you can't backup system app apks and paid user app apks)

  • First find out the name of the app or apps you want to backup.
  • Go to play.google.com.
  • Search for your app or apps.
  • The name you have to input to CMD or terminal will be the end of the URL after the '=' sign.
  • Type following command to back up your desired app:

Quote:

  • adb backup <app name>

Example:
  • I want to backup Bloons TD Battles.
  • I search for it on play.google.com.
  • The URL for that is http://play.google.com/store/apps/details?id=com.ninjakiwi.bloonstdbattles
  • So the name of the app which I have to input is com.ninjakiwi.bloonstdbattles
  • To back it up I use the following command:

Quote:

  • adb backup com.ninjakiwi.bloonstdbattles

If I want it with apk

Quote:

  • adb backup -apk com.ninjakiwi.bloonstdbattles

If I want to give a custom name for the backup file.

Quote:

  • adb backup -apk com.ninjakiwi.bloonstdbattles -f bloons_td_battles-2014-07-22.ab

If you want to backup multiple apps then just write the app names like this:

Quote:

  • adb backup -apk com.ninjakiwi.bloonstdbattles com.frogmind.badland com.supercell.clashofclans

List all installed apps:
  • Windows users type this command:

Quote:

  • adb shell pm list packages -f

The name of the app will be after the '=' sign.
  • Linux users type this command:

Quote:

  • adb shell pm list packages -f | sed -e s/.*=// | sort



Restore the backup
(Note: If you have backed up paid apps, then first install them from playstore before you restore your backup)
  • Enable USB debugging on the phone. (If it is disabled)
  • Connect USB cable.
  • Open CMD or terminal window.
  • Type the following command:

Quote:

  • adb restore <path to the backup>

  • After executing the command you will be prompted on your phone to start the restore:
  • Enter your password for the backup if you have any.
  • Select Restore my data on your phone to start the restore.

Example:
  • I store may backups in the C:\backups folder.
  • I know I made a backup one week ago and I gave backup-2014-07-15.ab as backup name.
  • The command I use to restore the backup is:

Quote:

  • adb restore C:\backups\backup-2014-07-15.ab

Extras:

There is a adb plugin for Total Commander which has the option to handle your backup-restore operations. I found it more useful than Helium backup.

If you want to extract your backup then I can recommend you this tool. It works both on windows and linux, but you will need java to run it. It is a command line app. Read the README.TXT for usage.
The Following 36 Users Say Thank You to bitdomo For This Useful Post: [ View ] Gift bitdomo Ad-Free
23rd July 2014, 07:08 AM |#2  
Elluel's Avatar
Senior Member
Flag えうれる
Thanks Meter: 3,235
 
More
Sad thing is people still will use Towelroot or whatever because they don't want to lose data lol. Good thread.
23rd July 2014, 07:34 AM |#3  
Member
Thanks Meter: 6
 
More
This is nice. I will try this later when i root my phone. Thanks!

Sent from my Nexus 5 using XDA Premium HD app
24th July 2014, 07:11 PM |#4  
Senior Member
Flag Toronto
Thanks Meter: 645
 
More
Very helpful. Thank you for the step by step guide.
Darth
26th July 2014, 04:03 AM |#5  
Guest
Thanks Meter: 0
 
More
Awesome info!! :thumbup:

Not sure why anyone wouldn't root an N5....but this is a great way to backup for those anyone's.
26th July 2014, 07:51 AM |#6  
OP Senior Member
Flag Göd
Thanks Meter: 1,254
 
Donate to Me
More
Quote:
Originally Posted by KJ

Awesome info!!

Not sure why anyone wouldn't root an N5....but this is a great way to backup for those anyone's.

My aim is to give an option to backup every data before root then restore it after root. I know how bad to lose all your progress in games and lose your perfectly set up home screen then do everything from nothing
The Following User Says Thank You to bitdomo For This Useful Post: [ View ] Gift bitdomo Ad-Free
26th July 2014, 11:56 AM |#7  
Senior Member
Thanks Meter: 737
 
More
U can take me as an example I knew that unlocking bootloader wipes internal memory but never knew internal memory is sdcard for our device. Paid the price and lost all of my pics and game data too. I never have a habit of syncing to PC and hate cloud storage. I used helium to backup btw. Should've followed this method.
9th August 2014, 10:38 PM |#8  
Senior Member
Thanks Meter: 31
 
More
This backup method works also on Nexus 4?
9th August 2014, 10:42 PM |#9  
OP Senior Member
Flag Göd
Thanks Meter: 1,254
 
Donate to Me
More
Quote:
Originally Posted by [email protected]

This backup method works also on Nexus 4?

It should be working on every phone with android ics and above.
9th August 2014, 10:48 PM |#10  
Senior Member
Thanks Meter: 31
 
More
Quote:
Originally Posted by bitdomo

It should be working on every phone with android ics and above.

PERFECT!! I will report my experience after rooting of my N4.
Thanks for how to guide.
22nd November 2014, 07:13 PM |#11  
Junior Member
Thanks Meter: 0
 
More
Status of back up?
My question is, How does one know when the back up has finished? I know that it shows whats going on when it brings up the prompt for you to select full back up but once you move from that prompt to let's say,check a message or open another app it seems as if there is no way of going back. Is there a way to check on the status of the back up? Or even check from your pc to know that it has finished? Thanks in advance.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes