Devices that have Android 4.0 and above can be backed up from the Android SDK and saved to a file on your PC. This process will allow you to have all of the data from your phone placed into a backup file on your computer.
Backup to File on Windows PC
- Install the latest version of the Android SDK Tools. If you already have Android Studio, open Android Studio and select “SDK Manager“. Check “Android SDK Platform-tools” and install the package.
- Launch SDK Manager, check the “Android SDK Platform-tools” option, then select “Install x packages…“.
- On your Android device, go to “Settings” > “About phone/tablet“.
- Tap “Build number” 7 times until it says “You are now a developer“.
- Under “Settings” > “Developer options“, set “USB debugging” to “On“.
- Connect your Android device to your computer using a USB cable.
- Open a command as an administrator or terminal prompt and navigate to where ADB is located. It is normally located under “C:\Users\username\AppData\Local\Android\sdk\platform-tools\“
- You can type one of these commands depending the type of information you’d like to backup.
- adb backup -all – System data, app data but not the apps themselves. By default saves device data to the platform-tools folder as backup.ab.
- adb backup -all -f C:\filenameichoose.ab – Same as above only you can set your own location for saving the backup file.
Here are some other switches you can use with the command:
- -apk – Backs up your apps.
- -noapk – Does not backup apps.
- -shared – Backs up data on the SD card.
- -noshared – Does not backup data on the SD card.
For more information on the usage of this command, visit the XDA guide.
- Once you type a desired command and press Enter, the following screen should appear on your device.
- Provide a password for your backup. You will have to use this password if you have to perform a restore in the future. Tap Back up my data and the data should start transferring.
Restoring From Backup File
If a day shall come when you need to restore from the backup file, you can simply use the adb restore command. Example: adb restore C:\Users\username\AppData\Local\Android\sdk\platform-tools\
You will then be prompted on the device for your password.
…. aaand it doesn’t work.
That is; the backup works, restoring “works” – just it doesn’t restore.
Thanks for the article. Can I use this method to perform a full backup of Samsung Galaxy Tab S3 and then restore to a Samsung Galaxy Tab 6 Lite? I need to backup and restore both the apps and data. Unfortunately, both the Samsung cloud backup and the Google One backup methods do not include app data, unless the apps are from Samsung and Google respectively.
The reason is that I have some games which I play on the S3, and there is no real “cloud backup/sync” option for these games. If I cannot do a manual backup and restore, I lose all of the points gained in these games and basically start from scratch.
Thanks, I forgot how to do this. No where else online is giving the adb method, they all recommend using an app!
Thanks for provide the useful info backup from entire android device , I found and analyze Android data is not completely safe on the computer, SD cards, or other external media. The data files may get unusable due to corruption in the drive. It can be also wiped off due to deletion, formatting, virus infection, hardware damage, etc. The only way out would be to use a data recovery software like Stellar Photo Recovery, Recuva, & other data android data recovery software!
Is this a complete backup? Like a backup image? So if I restore, the OS, data, files, apps, settings, etc. all get restored?
i get “adb unable to open file c:\test\test.ab” when trying.
Your article title is misleading, it should say “How to back up some files and the majority of the apps” this method does not back up the Android core files, text messages etc.
Great article…
The step by step instructions were simple to follow so I was able to get my phone backed up quickly. Thanks for not adding all the multitudes of details that could have confused the point of this article.
Great Job..
My backup have 41 bytes too :/ LENOVO A3500-FL (no root)
I wanted to backup the Android image of a Samsung S3 to a Windows 10 PC as a safeguard. This article appeared at the top of the search list.
I used the -f switch and specified \180520_1707_s3.ab expecting that it would be stored in the platform-tools folder with adb.exe
It took a few seconds. The backup file was stored elsewhere. The program Ransack retrieved it in the user’s partition in \appdata\local\virtualstore. All ok!
This article links to a guide in the XDA forums which explains additional parameters, For example, how to backup also the application programs with their data. This is useful when one restores and a future application is incompatible with the current data format.
This article served me well because it is short and to the point. Reading it was faster than typing this comment. Thank you, well done!
I tried this on a alcatel one touch 5020T phone and got a backup size of 41 bytes. I tried using 2 tablets and a Samsung J7, which produced respectable size backup files. Looks similar to comments on 3/3/16 from Jan.
Anybody know why it doesn’t work?
This is the problem with articles like this one. They give you a sample that may or may not work for all cases, and rarely offer any kind of assistance with issues you may have when trying to implement it. My only hope is that someone will see this and know the solution.
BTW, my phone is not rooted. Do you have to do this on a rooted phone? What about the restore function, does that have to be done from root? Author left out some critical details……
Thank you so much! i need to install a Rom on my Android tablet and in case i don’t like it i can go back to the default Operating System!
One thing worth mentioning since it took me a little time to figure it out:
In SDK Manager under the tab SDK Tools there is an option to download Google USB Driver – you want that too.
Install the driver. After installation go to
Control Panel -> Devices
Select the phone and do a “update driver.”
After everything installs, open Tools->Android->Android Device Monitor. You should see your phone listed.
There has to be a way to do this when the phone’s screen is destroyed, no digitizer function. Kies requires no user interaction with the phone, but it won’t restore apps to a different phone, not even when it’s the same carrier, same hardware, same Android version with the same updates.
I have used this to restore a backup after unlocking the bootloader. However, I wasn’t able to restore right away – I had to wait until the next day, no matter how much i fiddled with the file path. Maybe I kept typing the password in wrong, though. This is pretty handy when it works.
Start adb in root mode. adb root.
@Jan have u fixed the issue yet? I’ve ran into the same issue as well…
Hi All, I have a problem with backuping my phone Samsung S3. The backup ends in one second and the backup file has only 549 B. Could you help me?
Thx,
Jan
I went to Google and searched for an answer on Auto Reject. Your website was the only company that had the answer. Thank you so much.
I also got the same error message that says “adb: Unable to connect for backup: closed”. How do I fix the error message to open rather than closed?
Hello everybody,
just for being sure: does the backup really a full system backup (ie. inclusively the OS, such allowing for an OS version update & rollback)?
Hey.. Can I folloow the same steps to get the backup from my samsung galaxy A5 and then restore it to Oneplus One (running Cyanogenmod)?
I opened command prompt as an administrator and tried again. and I did not get up “unable to open file” error, but instead I got another error text “adb: Unable to connect for Backup: closed”
How do I fix this error?
I think I got it. You have to open the command prompt as an administrator otherwise you will get the “unable to open file” error.
Start > All Programs > Accessories, then right-click Command prompt and select “Run as administrator”
I tried a different folder, I try even another hard drive, but still get the same error text?
I do not understand why it does not work?
The instructions are a bit misleading, if you have already browsed to the directory location from the command prompt do the following command “adb restore backup.ab”
should look like this below:
C:\Users\Username\AppData\Local\Android\sdk\platform-tools>adb restore backup.ab
Actually, previous versions allowed a space between the -f parameter and the filename. The latest version does not.
Yikes! For a washed-up developer with a couple of decades experience, you would figure I would have solved this much quicker.
1. First, make sure you update your platform-tools through SDK Manager.
2. Go to the directory where you installed the SDK (it will tell you where at the top of the SDK Manager.
3. Run the adb backup command.
4. If it works, check your path. In my case, I had an old version that was getting called.
5. If it doesn’t work, double check your filename syntax.
6. If it still doesn’t work, back to the drawing board.
I’ve had the same problem since the Marshmallow update to my Verizon N6. I get the same error message, and if I look in the directory where the file should have been created, a folder was created instead. This is on a Windows 7 box.
Still trying to get to the bottom of it, but I’m pretty sure it is something other than rights.
@Conny – Seems like you may not have access to write to that directory. Maybe try another folder?
I get a error text after I have entered the code above to make a backup.
but get the error text that says “adb: Unable to open file C:\Users\Conny\backup.ab” how do I fix this error so I can continue with the steps ???