3

I've got an android device (Xiaomi MiPad-I, Stable ROM) which is not quite amenable to rooting, so I can't install Titanium backup on that. However, I can boot the device using the CWM recovery and mount the /system and /data partitions in RW mode during boot time.

In this mode, I can copy anything I want by connecting to a PC and using adb commands. However, I want to know whether copying the contents of /data/app and /data/data to my PC be enough for the backup of all apps? Or is there anything else that Titanium backup does? I only need the user apps, system apps are already available by either a factory-reset or flashing a stock ROM.

  • You also want to copy everything in /sdcard/Android. Some apps store data there and all the OBB files are there, too. – GiantTree Jul 17 '16 at 19:16
  • You also need to backup the symlinks. Only TAR can do that (adb pull is not enough, if you wish to simply recover everything with adb push, you can't realistically). – GiantTree Jul 17 '16 at 19:17
  • @GiantTree Thanks! What symlinks are needed? Are non-root apps allowed to create symlinks and store data there? I was under the impression that non-root apps are allowed to access only /data/data/package_name and isolated to there only. – Prahlad Yeri Jul 17 '16 at 20:31
  • Besides, I only need data backup, I can install the apks separately. For example, I need the Firefox cache. I can install Firefox apk anytime, but I need to backup and restore my browsing history. – Prahlad Yeri Jul 17 '16 at 20:33
  • All apps have a symlink from /data/data/<package name>/libs to some directory containing their libraries. They will fail if you simply restore the directory, they need the appropriate symlink to the library folder (because of permissions, ids and some more magic). Reinstalling the app will make sure that symlink is created correctly. – GiantTree Jul 17 '16 at 20:42
4

To do a backup like you want, you can just copy everything from /data/data except the lib directories/symlinks (they will fail when you want to restore/push them).

A very easy thing to do is adb pull /data/data and then delete all the lib files (as symlinks are only files but those refer to directories).

Upon restore you can install each app, using adb install for example, and restore the data manually, ie. just push it back and fix permissions.
Make sure the apps in question are not running.

To fix permissions you can either do it manually/with a quick shell script. Read the owner of each app's data directory and recursively set that owner (and group) to that owner and group (using chown user:group -R /data/data/<package name>). Users and groups are in the format u0_a000, the symlink to lib is owned by install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.