Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Backup & Restore Apps + Data of RESTRICTED Profile

OP froggydoddy

16th August 2013, 01:37 AM   |  #1  
froggydoddy's Avatar
OP Member
Thanks Meter: 4
 
89 posts
Join Date:Joined: Oct 2008
Ok, so my tablet wouldn't install the latest JSS15J update. So I had to manually install it. In the process, it wiped out my entire tablet. I have a main profile and a restricted secondary profile (my son's. It's my son's tablet). How do I get all the apps + data backed up (from a restricted profile) and restored (to a restricted profile)?

I've tried Titanium Backup and MyBackupPro (both root). I got close a few times, but I CANNOT get the APK's + data off a restricted profile, flash the Nexus 7 upgrade, then install APK's + data again successfully.

If I use Titanium backup while logged into the main profile, it backup up the data from the main profile only. Nothing from the restricted profiles (game saves, settings, etc.)

I've spent the day trying to get this done! I've been going back and forth between NANDROID backups, trying different things.
Last edited by froggydoddy; 16th August 2013 at 02:50 AM.
16th August 2013, 03:13 AM   |  #2  
teh roxxorz's Avatar
Recognized Contributor
Thanks Meter: 2,102
 
8,229 posts
Join Date:Joined: Nov 2010
Donate to Me
More
i'm not sure, as i don't use profiles.

BUT, what I can suggest for the future is:

Create a new folder on your internal and call it R Tita. Backup [for giggles], then backup your sons apps to the second folder, keep yours in the original. Just before you restore, change the backup / restore folder appropriately.
16th August 2013, 03:51 AM   |  #3  
froggydoddy's Avatar
OP Member
Thanks Meter: 4
 
89 posts
Join Date:Joined: Oct 2008
Quote:
Originally Posted by teh roxxorz

i'm not sure, as i don't use profiles.

BUT, what I can suggest for the future is:

Create a new folder on your internal and call it R Tita. Backup [for giggles], then backup your sons apps to the second folder, keep yours in the original. Just before you restore, change the backup / restore folder appropriately.

I've tried that. I played around all day with it. You also can't easily move backup files from one place to the other. Then even when you do it (with Root Explorer), it still doesn't work for some reason. On top of everything else, it's hard to make backups as TB says there's no storage space left even though there's over 20GB. That's while trying to save it in all different place. Emulation 0, Emulation 10, legacy, Sdcard.... etc...
16th August 2013, 04:05 AM   |  #4  
teh roxxorz's Avatar
Recognized Contributor
Thanks Meter: 2,102
 
8,229 posts
Join Date:Joined: Nov 2010
Donate to Me
More
Quote:
Originally Posted by froggydoddy

I've tried that. I played around all day with it. You also can't easily move backup files from one place to the other. Then even when you do it (with Root Explorer), it still doesn't work for some reason. On top of everything else, it's hard to make backups as TB says there's no storage space left even though there's over 20GB. That's while trying to save it in all different place. Emulation 0, Emulation 10, legacy, Sdcard.... etc...


You should just do all the backups in the /storage/legacy directory.

Though I don't see any reason why TB should have issues restoring that, should work. Have you verified your backups are good within the app?
16th August 2013, 11:21 PM   |  #5  
froggydoddy's Avatar
OP Member
Thanks Meter: 4
 
89 posts
Join Date:Joined: Oct 2008
I wasn't even able to create the backup anywhere due to that "no storage" issue. Then finally when I was able to create one somehow, I wasn't able to restore from it.

I've emailed the makers of TB to ask if they are planning on adding that functionality (backing up restricted profiles)

Sent from my Nexus 7 using XDA Premium HD app
23rd August 2013, 10:52 PM   |  #6  
bounti's Avatar
Senior Member
Thanks Meter: 32
 
256 posts
Join Date:Joined: Dec 2012
Quote:
Originally Posted by froggydoddy

I wasn't even able to create the backup anywhere due to that "no storage" issue. Then finally when I was able to create one somehow, I wasn't able to restore from it.

I've emailed the makers of TB to ask if they are planning on adding that functionality (backing up restricted profiles)

Sent from my Nexus 7 using XDA Premium HD app

What ever came of this? I too would like to know how to backup data from a restricted profile.

The apks aren't necessary, as the primary user is the one who's allowed to installed apps anyway, but the data itself is what's important.

Did the TB team ever respond to you?
12th September 2013, 11:15 PM   |  #7  
viljoviitanen's Avatar
Junior Member
Flag Jyväskylä
Thanks Meter: 7
 
18 posts
Join Date:Joined: Feb 2012
Quote:
Originally Posted by bounti

What ever came of this? I too would like to know how to backup data from a restricted profile.

The apks aren't necessary, as the primary user is the one who's allowed to installed apps anyway, but the data itself is what's important.

Did the TB team ever respond to you?

I found a way to do it. It's not very easy, I'm afraid. You need root, busybox, and pretty good familiarity with the command line (adb shell or terminal emulator on the device itself. However with this much typing, I really recommend adb shell...)

App data for other than the main user is stored at

/data/user/XX/com.the.application/

where XX is a number. My restricted user was numbered "10".

so to backup, just make a tar archive of that directory:
Code:
cd /data/user/XX
tar cf /sdcard/whatevername.tar com.the.application
to restore,

Code:
cd /data/user/XX
tar xf /sdcard/whatevername.tar
but, this probably only works for the very same user, because the file ownerships need to match.

So if it's not the same user, you need to fix the ownership of the restored files, but not the "lib" symlink.

With the games (the different angry birds...) I cared about had the folders cache, databases, files and shared_prefs. If there are other folders, you need to need to include them too (I'm not sure what folders there can be).

So to fix the ownership of all those, before extracting the backup (the tar xf command), first see who the owner is:
Code:
cd /data/user/XX
ls -ld com.the.application
it says something like
Code:
drwxr-x--x u11_a89  u11_a89           2013-09-12 23:14 com.the.application
here the u11_a89 is the important value.

Then, do the above tar xf command, and run
Code:
cd /data/user/XX/com.the.application
chown uXX_aYY:uXX_aYY .
find cache databases files shared_prefs | xargs chown uXX_aYY:uXX_aYY
Where uXX_aYY obviously is the value the ls command showed before.

By the way, this way you can also copy data from one user to another, e.g. from the main user (who can use titanium backup etc) to the restricted user or the other way around.

Sorry if I'm not very clear.. maybe someone could make a more understandable guide from this.

Disclaimer: I tried this on a rooted stock 4.3 nexus 7 (2012). But I think it's the same on any android 4.3 based device. Also, I really only did this with the angry birds games, I don't know if other apps need other tricks. (well except Bad Piggies is different, the data is /sdcard/Android/data/com.rovio.BadPiggies, and it can be copied with a file manager, without root.)
The Following 2 Users Say Thank You to viljoviitanen For This Useful Post: [ View ]
19th January 2014, 05:26 AM   |  #8  
Junior Member
Thanks Meter: 12
 
20 posts
Join Date:Joined: Oct 2011
Thanks. Based on this I wrote a perl script to fix up all the user/group names after restoring the entire data directory; you may need to change u11 to u10 or whatever the restricted user is on your tablet.

Code:
#! /usr/bin/perl -w                                                                                            
# Script to fix ownership of data directories on restore of Android                                            
# restricted profile.                                                                                          

open (LS, "adb shell \"su -c 'ls -l /data/data'\" |") || die "Failed: $!\n";
while (<LS>) {
      (undef, $owner, $group, undef, undef, $dir) = split(' ');
      $owner =~ s/u0/u11/;
      $group =~ s/u0/u11/;
      system ("adb", "shell", "su -c \"cd data/user/11/$dir && find . \! -type l -print0 | xargs -t -0 chown $owner:$group\"");
}
The Following User Says Thank You to jicama For This Useful Post: [ View ]
5th February 2014, 08:53 AM   |  #9  
lanwarrior's Avatar
Senior Member
Thanks Meter: 150
 
2,194 posts
Join Date:Joined: Mar 2006
Quote:
Originally Posted by froggydoddy

Ok, so my tablet wouldn't install the latest JSS15J update. So I had to manually install it. In the process, it wiped out my entire tablet. I have a main profile and a restricted secondary profile (my son's. It's my son's tablet). How do I get all the apps + data backed up (from a restricted profile) and restored (to a restricted profile)?

I've tried Titanium Backup and MyBackupPro (both root). I got close a few times, but I CANNOT get the APK's + data off a restricted profile, flash the Nexus 7 upgrade, then install APK's + data again successfully.

If I use Titanium backup while logged into the main profile, it backup up the data from the main profile only. Nothing from the restricted profiles (game saves, settings, etc.)

I've spent the day trying to get this done! I've been going back and forth between NANDROID backups, trying different things.

How did you get root to work on restricted profiles? In this mode, AFAIK root doesn't work.

EDIT: Just tried creating a restricted profile and assigned rooted apps like Titanium Backup - it complained no root was found, even though the tablet is rooted.
12th February 2014, 11:40 PM   |  #10  
Senior Member
Thanks Meter: 24
 
276 posts
Join Date:Joined: May 2009
Quote:
Originally Posted by lanwarrior

How did you get root to work on restricted profiles? In this mode, AFAIK root doesn't work.

EDIT: Just tried creating a restricted profile and assigned rooted apps like Titanium Backup - it complained no root was found, even though the tablet is rooted.

I'm not sure if this works in a restricted user account. But to get TiB to work in a secondary user account, I had to go into the SuperUser app from the primary user account. Open the settings and select the "Wnable mult-user" checkbox. This is in Chainfire's Super User app. Not sure if other SU apps have this or not.

The Following User Says Thank You to os2baba For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes