Pages

Ads 468x60px

March 5, 2012

Performing backups on unrooted Android devices

Today we will see how to make backups on unrooted Android devices. I am using Xoom running ICS, but the methods will be valid across devices, but there could be app incompatibilities on some versions of Android.

I. Data types
There are three kinds of data, user data (photos, videos and documents), user app data (like game data) and system data. Without rooting it's possible to backup user data and parts of app data, but system data is generally off-limit as root access is required.

II. User data (root not required)
Common data like audio, video, pictures and documents can be backed up easily after connecting the android device to the PC. Suffice to say, backup files should be saved on your PC. 

III. User app data (partly root required)

In HC and ICS (and maybe prior versions of Android), there are two locations where app data is stored: /data/* and android/data as well as individual folders in the internal storage. Unrooted, you cannot access /data but /android/data is accessible. You can backup the folder through your desktop.

Restoring is as simple as pasting the folder back in the appropriate place. Of course you will need to identify which app stores data in which folder for proper restoration or just restore the whole folder but do not overwrite anything.

If you are using this method after performing a factory reset, the trick is to install all the apk files, but to not open any of the apps. Restore everything from the backup and then start the apps.

IV. Software for backups
  • MyBackup Pro (30 day trial version): Similar to Titanium Backup, has many features which work unrooted. Can backup apps apk, contacts, call log, sms, mms, bookmarks etc. Worth checking.


  • App Backup & Restore (Free): Performs a single function which is to backup apk files. Has a dangerous permission requirement of Read Sensitive Log Data. So, if you are worried, install only when required.

  • App Backup & Reinstall: Another app to backup apk files. Some users have reported in the market that the backups got corrupted, so be careful.


V. Using Android Debug Bridge (ADB)
copkay at XDA, has found out a great way to backup almost everything without having root access. This is useful when, for ex, you want to root which could wipe the entire data.

If you do not have ADB installed check this post: ADB Installation Guide.

Backup
Here are the steps to follow:
1. Connect your device via USB, and open a command prompt (In Windows Go to run and type cmd, press enter)

2. Type the command 'adb devices' to ensure that your device is properly recognized. There will be an alphanumeric string indicating the device has been identified. If the device is not identified, DO NOT proceed, rather troubleshoot why that is so.

3. We will use the ADB command backup. Here is the format

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

If you want to do a full backup simple enter:
adb backup -apk -all -f C:\backup_02292012.ab

Parameters discussion:
  • [-f <file>] — Backup to a particular file, always use this so you know where your backup is
  • [-apk|-noapk] — backup applications apk (installation files) or not. default is no apk
  • [-shared|-noshared] — backup shared data like pictures, does not work very well, so even if you do use this, please do a separate backup for your personal data, as mentioned before
  • [-all] — backup all apps, unless you want to manually backup each app
  • [-system|-nosystem] — Whether or not to backup system apps, I do not recommend backing system apps
  • <packages...> — If you want to backup specific apps

When you are ready, enter the command in the command prompt on Windows. Once you do that, adb will send the instruction to your device and you will see a prompt. Select a password if you wish and then proceed. if you do select a password, do not forget or else the backup will be useless.

After this wait for several minutes depending upon the size of the back up to be done. Once it's completed, you will get a prompt on your device indicating the process has been completed.

Restore
To restore use the following command in command prompt:
adb restore C:\backup_02292012.ab

Simply follow the onscreen prompts on the device and wait for the process to complete. Congrats you have just done a complete restore.


IMP: This method does not work 100% correctly, so not everything will be restored, especially files in /data/media (sdcard folder), so do that manually. Also does not backup sms.

VI. Conclusion
Hopefully this post has helped you in identifying how to and what to backup on your unrooted Android devices. Especially the full backup using ADB is very powerful in case one is rooting or doing a factory reset or sending the device to Motorola for repairs.

If you know of other good apps let us know!

Please note: I take no responsibility if you mess anything, delete your personal data or even brick your device. If you are not comfortable with anything do not proceed, especially when using ADB.

 Previous coverage under Android for All, our special education and informative primers on Android, include Android Permissions Black Book, Syncing MTP devices (like Android based devices) with Windows, Reverse tethering on your Android: Use Windows Internet connection on your Android! and ADB Installation Guide.

2 comments:

  1. Will these work on jellybean? I am mostly concerned with saving the data from one particular game, so I don't lose my progress when I unlock my nexus 7.

    ReplyDelete
  2. If u don't backup the system apps how do u get them back after u have rooted ? I.e. : play store ?

    ReplyDelete