Android backup without root - General Questions and Answers

Hi, just wondering what is the best possible way of doing a back up off an app + data.. Got Htc 10 an want my theory test app + data transferred over from my other phone and I only know how to do this via root.. Thanks
Sent from my HTC 10 using XDA-Developers mobile app

LaneyEFC said:
Hi, just wondering what is the best possible way of doing a back up off an app + data.. Got Htc 10 an want my theory test app + data transferred over from my other phone and I only know how to do this via root.. Thanks
Sent from my HTC 10 using XDA-Developers mobile app
Click to expand...
Click to collapse
adb backup would probably be the best idea.
Code:
adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-obb|-noobb enable/disable backup of any installed apk expansion
(aka .obb) files associated with each application; the default
is noobb.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup archive
Or you can use the Helium app (previously know as Carbon)

Related

[Q] Adb + nandroid (+ext) backup directly to pc [trying now]

Hi, is there a way to do a nandroid +ext backup directly to pc?
i'm trying to change my sd card (2gb) to a bigger one (8gb). i heard i have to backup and restore the nadroid + ext backup to preserve the application installed, i'm using app2sd. rooted p500 optimus one.
I can acces the phone in recovery mode but if i do a nandroid +ext backup i have a error: "Error : Run 'nandroid-mobile.sh' via adb!"
this is probably because i don't have space to do the backup in the sd.
i want to do the backup directly to pc using adb.
i started with ('im using ubuntu)
Code:
cd *adb folder*
sudo su
./adb shell
and then i went to the nadroid backup help via adb:
Code:
/ # /sbin/nandroid-mobile.sh --help
Usage: /sbin/nandroid-mobile.sh {--backup|--restore|--getupdate|--delete|--compress|--bzip2:ARG|--webget:URL|--listbackup|--listupdate} [options]
--help Display this help
-s | --subname: SUBSTRING In case of --backup the SUBSTRING is
the prefix used with backup name
in case of --restore or -c|--compress|--bzip2 or
--delete SUBSTRING specifies backups on which to
operate
-u | --getupdate Will search /sdcard/download for files named
*update*.zip, will prompt the user
to narrow the choice if more than one is found,
and then move the latest, if not unique,
to sdcard root /sdcard with the update.zip name
It is assumed the browser was used to put the *.zip
in the /sdcard/download folder. -p|--path option
would override /sdcard/download with the path of your
choosing.
-p | --path DIR Requires an ARGUMENT, which is the path to where
the backups are stored, can be used
when the default path /sdcard/nandroid/mem=471M
needs to be changed
-b | --backup Will store a full system backup on /sdcard/nandroid/mem=471M
One can suppress backup of any image however with options
starting with --no[partionname]
-e | --ext Preserve the contents of the ext partition along with
the other partitions being backed up, to easily switch roms.
-r | --restore Will restore the last made backup which matches --subname
ARGUMENT for boot, system, recovery and data
unless suppressed by other options
if no --subname is supplied and the user fails to
provide any input then the latest backup is used
When restoring compressed backups, the images will remain
decompressed after the restore, you need to use -c|-compress
or --bzip2 to compress the backup again
-d | --delete Will remove backups whose names match --subname ARGUMENT
Will allow to narrow down, will ask if the user is certain.
Removes one backup at a time, repeat to remove multiple backups
-c | --compress Will operate on chosen backups to compress image files,
resulting in saving of about 40MB out of 90+mb,
i.e. up to 20 backups can be stored in 1 GIG, if this
option is turned on with --backup, the resulting backup will
be compressed, no effect if restoring since restore will
automatically uncompress compressed images if space is available
--bzip2: -# Turns on -c|--compress and uses bzip2 for compression instead
of gzip, requires an ARG -[1-9] compression level
--webget: URL|"" Requires an argument, a valid URL for an *update*.zip file
If a null string is passed then the default URL is used
Will also create an update.MD5sum file and update.name with the
original file name.
--nameserver: IP addr Provide the first nameserver IP address, to override the default
--nameserver2: IP addr Provide the second nameserver IP address, to override the default
--webgettarget: DIR Target directory to deposit the fetched update, default is
/sdcard
--norecovery Will suppress restore/backup of the recovery partition
If recovery.img was not part of the backup, no need to use this
option as the nandroid will not attempt to restore it, same goes
for all the options below
--noboot Will suppress restore/backup of the boot partition
--nodata Will suppress restore/backup of the data partition
--nosystem Will suppress restore/backup of the system partition
--nocache Will suppress restore/backup of the cache partition
--nomisc Will suppress restore/backup of the misc partition
--nosplash1 Will suppress restore/backup of the splash1 partition
--nosplash2 Will suppress restore/backup of the splash2 partition
--defaultinput Makes nandroid-mobile non-interactive, assumes default
inputs from the user.
--autoreboot Automatically reboot the phone after a backup, especially
useful when the compression options are on -c|--compress|
--bzip2 -level since the compression op takes time and
you may want to go to sleep or do something else, and
when a backup is over you want the calls and mms coming
through, right?
--autoapplyupdate Once the specific update is downloaded or chosen from the
sdcard, apply it immediately. This option is valid as a
modifier for either --webget or --getupdate options.
-e|--ext Save the contents of ext partition in the backup folder too.
Enables to keep different sets of apps for different ROMS and
switch easily between them.
--save: ROMTAG Preserve EVERYTHING under ROMTAG name, a composite option,
it uses several other options.
--switchto: ROMTAG Restores your entire environment including app2sd apps, cache
to the ROM environment named ROMTAG.
-q|--quiet|--silent Direct all the output to the recovery log, and assume default
user inputs.
-l|--listbackup Will search the entire SDCARD for backup folders and will dump
the list to stdout for use by the UI. Should be run with --silent
--listupdate Will search the entire SDCARD for updates and will dump
the list to stdout for use by the UI. Should be run with --silent
now the option is this, how can i change to path to mmy computer hard drive
Code:
-p | --path DIR Requires an ARGUMENT, which is the path to where
the backups are stored, can be used
when the default path /sdcard/nandroid/mem=471M
needs to be changed
what would be the complete command to do the ext + nadroid backup via adb?
tried to do only nandroid and the fix apk uuids with no luck.
any help?
ok i fckd up everything and now it won't see the app on the sd on both sds.
i ended up reinstalling all the apps manually, all the data were saved.
just one thing: i lost memory on the internal memory, i had 30 mb free with 121 apps installed and now i have 20 free with 56 installed, how is this possible?
i deleted manually with root explorer the data folders i don't need in the /data folder but the notification of low memory didn't disappear.
how to solve?
solved, formatted sd and reinstalled everything + titanium backup
thanks for helpin -_-'

What does "adb backup" actually do?

Hey everyone,
I was asking myself what the "adb backup" command will actually perform on the device and more important: is it possible to run those same commands on a device shell directly (from Terminal Emulator for example).
Goddchen
adb help
From the "adb help":
Code:
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
Intuition would lead me to believe that this backs up your application directories (the installed directory). You can include the application packages, system packages with the system/nosystem flags, and possibly your data in your /sdcard/ directory as well.
hm okay, let me rephrase my question:
Was commands does the adb backup command execute the create the backup and what commands does the adb restore command execute to restore the backup?
Is it possible to execute those commands on a device's shell without the use of adb...
And maybe: Is it possible in any way to make a adb connection to the local device?
I get the impression that you're looking for the inner workings of adb backup to see if you can integrate it into some scripts.
That being said, I came across something that might help you out. I skimmed over it and it seems to give a low level overview of the adb backup process. I hope that helps.
android.stackexchange.com/questions/23357/is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file
Sent from my Nexus 4 using xda premium
qdev said:
I get the impression that you're looking for the inner workings of adb backup to see if you can integrate it into some scripts.
That being said, I came across something that might help you out. I skimmed over it and it seems to give a low level overview of the adb backup process. I hope that helps.
android.stackexchange.com/questions/23357/is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
that is some awesome background info
Unfortunately it doesn't take me closer to my goal. I don't think that one can launch a backup from a shell (or app), right? The backup only seems to be able to be triggered by adb (the adb backup command). I don't see any other way of starting a backup
Is there any possible way to create a adb connection to the local device?

ADB/Fastboot backup

I'm running Carbon 3.1, which I very much like. Still, I'd like to try omnirom and perhaps RR, both of which require a wipe. How do I back up and restore my data with fastboot or adb? I don't user twrp (doesn't play well with aosp). Phone is rooted, stock emui 8 recovery. I don't want to restore system, just my apps.
the right command to backup your app and data should be this one:
backup: adb backup -apk -shared -all -f backup-file.adb
restore: adb restore backup-file.adb
info:
options are
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.
hope this suggestion could help
but there are several apps around there which can do that for you without connecting to a pc.
(MyPhoneExplorer; TitaniumBackup; Helium App sync; aso...)
I have titanium, but I've encountered problems on restore.
It took me several tries but
backup -apk -noshared -all -f c:\backup-file.adb
eventually worked. Hard to find the file as it appeared in something called "Virtual Store" (that is, the path provided was disregarded) but that acted like a normal folder once I found it.

Pull app-data from Pixel 3a app without root

Hi,
I want to pull the app-data, specifically the cell_broadcasts.db database, from com.google.android.cellbroadcastreceiver or com.android.cellbroadcastreceiver (guess the first one is used) from my stock Pixel 3a (no root, no custom recovery).
adb pull /data/data/com.android.cellbroadcastreceiver/databases/cell_broadcasts.db gives me a permission error...
I also tried adb backup -apk com.android.cellbroadcastreceiver etc. and confirmed the backup on my phone, but it gives me an empty backup. adb backup -all and extracting it via dd if=backup.ab bs=24 skip=1 | zlib-flate -uncompress | tar xf - works but only backups 38 apps, not including the ones I want.
Is there any way I can get the app-data?
RFZ said:
Hi,
I want to pull the app-data, specifically the cell_broadcasts.db database, from com.google.android.cellbroadcastreceiver or com.android.cellbroadcastreceiver (guess the first one is used) from my stock Pixel 3a (no root, no custom recovery).
adb pull /data/data/com.android.cellbroadcastreceiver/databases/cell_broadcasts.db gives me a permission error...
I also tried adb backup -apk com.android.cellbroadcastreceiver etc. and confirmed the backup on my phone, but it gives me an empty backup. adb backup -all and extracting it via dd if=backup.ab bs=24 skip=1 | zlib-flate -uncompress | tar xf - works but only backups 38 apps, not including the ones I want.
Is there any way I can get the app-data?
Click to expand...
Click to collapse
Not without root.
Android uses scoped storage, where each app and process is only able to access its own private data - the exceptions being "public" data such as internal/external storage, and certain "public" system data such as texts, calls, etc.
Although the ADB daemon is a system process, it does not have root permissions, therefore it cannot access private app data.

Is there a way to copy or move an app to a cloud and save the app as a packet before or during

but all of the things I did on the app stay intact so that when I unzip/open the app, I can use the app with my most recent changes/saved content/saved data?
An app and its acompanying data are different things, they also are storend in different locations. So you have to backup app's data separately.
Of course there is a way to backup the app ( AKA APK-file ) and the related data in one go: via ADB
Code:
adb devices
adb backup -apk -shared -all -f <FULL-PATH-NAME-OF-BACKUP-FILE.ab>
Important:
adb backup can only backup apps that allow backup at all (an app has to declare allowBackup=true in it's AndroidManifest.xml or don't have such an entry at all). If it sets allowBackup=false then adb backup can not get any data on this app.
FYI:
To convert the created backup ( the archive is a TAR-file ) into a ZIP-file you may use
https://sourceforge.net/projects/android-backup-processor/files/android-backup-tookit-20221220.zip/download

Categories

Resources