[Tool] SaveMyApp - Preinstall Your Apps - Droid 2 Android Development

Tired of having to redownload and reinstall all of your apps when you reflash your phone? SaveMyApp can help.
This script will setup your phone so that after your flash to your favorite rom, all* of your apps will be install on the first boot. These apps will show up in the market too!
Also, the script will allow you to backup your /data/data folder to your sdcard and then restore it after your reflash. The /data/data is where Most of your user data is stored. This is not guaranteed to fully restore everything. This also does not backup your Google, Android, or Motorola settings; this is to improve compatibility with roms.
*The /preinstall folder is limited to 120MB, so if you have more then of apps this script will not fully work.
This should work with all phones, however it has only been tested on the Droid 2/X.
If you want to test this script on a different phone, let me know the /preinstall size and if it worked or not.
v0.1.4.2 - 11/17/2010
-Improved backup and restore of data
-Improved script usability
v0.1.4.1 - 11/17/2010
-Improve safety of removing /preinstall/app
v0.1.4 - 11/16/2010
-Added option to clear the /preinstall/app folder
-Added messages to support clear /preinstall/app
v0.1.3 - 11/12/2010
-Added backup of /data/data
-Added messages to support Data Backup
v0.1.2 - 11/11/2010
-Added Backup /data/app-private
-Show /data/app size, prompt user for continue
-Additional messages added to improve user experience
v0.1.1 - 11/10/2010
-First Release
-Backup and Restore /data/app
Installation:
WARNING: This steps must be completed as listed, failure to do so may result in unexpected errors which I am not responsible for.
1. Enable USB debugging and make sure Sdcard is mounted on phone
1. adb push apps.sh /data
2. adb shell
3. cd /data
4. chmod 775 apps.sh
5. ./apps.sh
a. Follow the onscreen directions
6. Reboot and proceed to wipe and reflash
7. On boot, wait between 5 and 10 minutes depending on how many apps you have before logging into your account. (30 apps takes about 4-5 minutes)
8. Login to your account
9. Droid 2/X Bootstrapper -> Bootstrap Recovery
10. Enable USB debugging and make sure Sdcard is mounted on phone
11. adb shell
12. tar -xzpf /sdcard/savemyapp/backup.tgz
FAQS:
Market isn't showing apps!
settings->applications->Manage Applications->All->Market->Force Stop, Clear data
Why is there a MACOSX file when I extract the archive?
Because I am lazy and I zipped it using Mac's built in archiver.
The script isn't working right away!
Redownload the newest script, just to make sure
Disclaimer:
You may repost this, but you must quote it as is.
I will only be responding to the threads I started on the Xda-Developers forums.

First!
I'm just holding a parking spot for this post!

What a great idea...thank you for developing this, im so tired of re downloading my apps back and setting everything up...done it about 10 times in the past month between sbfing and updating the fission rom several updates in a row so thank you...will most definitely be using this when I flash roms in the future. Thanks again
Sent from my DROID2 using XDA App

Excellent program! I'm having trouble getting it to work unfortunately. When apps.sh begins to copy files from /data/apps, I get errors saying "No space left on device" after every single file it tries to copy. This is of course not true since this D2 has over 6 gigs free on the system storage.
I am running this through the window's command prompt, but I don't see much in the code that won't run on windows aside from "du" which isn't even relevant unless my app + app-private folders combined size is over 120 MB (it's not).
I'm also running Epic 2.5 if that has anything to with this.
Any ideas? Am I just doing this terribly wrong?
Thanks!

tildaSparky said:
Excellent program! I'm having trouble getting it to work unfortunately. When apps.sh begins to copy files from /data/apps, I get an error saying "No space left on device." This is of course not true since this D2 has over 6 gigs free on the system storage.
I am running this through the window's command prompt, but I don't see much in the code aside from "du" which can't run with windows.
Any ideas? Am I just doing this terribly wrong?
Thanks!
Click to expand...
Click to collapse
If you read the first post it states the /preinstall folder can only hold only 120mb so it you have more than that to backup it won't fully work..I'm guessing that's were the apps are being saved...
Sent from my DROID2 using XDA App

turkeybuzzard said:
If you read the first post it states the /preinstall folder can only hold only 120mb so it you have more than that to backup it won't fully work..I'm guessing that's were the apps are being saved...
Sent from my DROID2 using XDA App
Click to expand...
Click to collapse
Apps are normally saved in /data/app this script copies those apks to /preinstall so that after a wipe they will automatically be installed on the first boot. Yes /preinstall is limited to about 120MB.
tildaSparky said:
Excellent program! I'm having trouble getting it to work unfortunately. When apps.sh begins to copy files from /data/apps, I get an error saying "No space left on device." This is of course not true since this D2 has over 6 gigs free on the system storage.
I am running this through the window's command prompt, but I don't see much in the code aside from "du" which can't run with windows.
Any ideas? Am I just doing this terribly wrong?
Thanks!
Click to expand...
Click to collapse
Do you get the "No space left on device" message instantly or after some apks were copied to the /preinstall folder?

Here's what I get
Working…
cp: /preinstall/app/com.google.android.apps.maps-1.apk: No space left on device
cp: /preinstall/app/com.google.android.apps.translate-2.apk: No space left on device
cp: /preinstall/app/com.google.android.gm-1.apk: No space left on device
cp: /preinstall/app/com.google.zxing.client.android-2.apk: No space left on device
etc.
=(

tildaSparky said:
Here's what I get
Working…
cp: /preinstall/app/com.google.android.apps.maps-1.apk: No space left on device
cp: /preinstall/app/com.google.android.apps.translate-2.apk: No space left on device
cp: /preinstall/app/com.google.android.gm-1.apk: No space left on device
cp: /preinstall/app/com.google.zxing.client.android-2.apk: No space left on device
etc.
=(
Click to expand...
Click to collapse
How big is your /data/app folder?

OK! I sort of have it fixed. In that I'm not getting my original error.
What I did (which in retrospect was not such a hot idea) was delete the /preinstall/ folder and then created a new one with the subfolders /app/ and /md5/. The logic behind was that I saw the script had nothing in it to clean out the original preinstall folder, and I noticed that it had silly things like NFS in it. As I said, in retrospect I should have just deleted specific items from the folder, but that's what I get for acting without thinking too much.
How bad do you think it is that I remade the preinstall folder from scratch?
Now my preinstall folder is properly populated (I think). But the data won't back up for some reason. I think it might have something to do with the if statements being broken. I'm gonna go ahead and modify your script to bypass the if/else statements and see what happens.
SaveMyApp v0.1.2
By csscmaster3
Your app folder takes up
du: not found
If your app folder is more then 114MB I don't recommend continuing
do you want you to continue? (y/n)y
y
[[: not found
Working…
ignore No such file or directory error if you get it
tee: not found
SaveMyApp has completed your apps
Do you want to backup your data? (y/n)y
y
[[: not found
SaveMyApp has completed.
As an aside my app folder is 28 MB and my app-private folder has only the apkinstaller.

tildaSparky said:
OK! I sort of have it fixed. In that I'm not getting my original error.
What I did (which in retrospect was not such a hot idea) was delete the /preinstall/ folder and then created a new one with the subfolders /app/ and /md5/. The logic behind was that I saw the script had nothing in it to clean out the original preinstall folder, and I noticed that it had silly things like NFS in it. As I said, in retrospect I should have just deleted specific items from the folder, but that's what I get for acting without thinking too much.
How bad do you think it is that I remade the preinstall folder from scratch?
Now my preinstall folder is properly populated (I think). But the data won't back up for some reason. I think it might have something to do with the if statements being broken. I'm gonna go ahead and modify your script to bypass the if/else statements and see what happens.
SaveMyApp v0.1.2
By csscmaster3
Your app folder takes up
du: not found
If your app folder is more then 114MB I don't recommend continuing
do you want you to continue? (y/n)y
y
[[: not found
Working…
ignore No such file or directory error if you get it
tee: not found
SaveMyApp has completed your apps
Do you want to backup your data? (y/n)y
y
[[: not found
SaveMyApp has completed.
As an aside my app folder is 28 MB and my app-private folder has only the apkinstaller.
Click to expand...
Click to collapse
The NFS removal is a good call, I will append the script to check the /preinstall folder and prompt to remove the files there
The reason you are having trouble with this script looks it be like because you are not running it on the phone itself...meaning to say you are not running it via a terminal emulator on the phone nor are you running it via adb shell. The backup uses tar, which isn't on windows by default.

Actually I'm running everything through the adb shell. It's puzzling to me too. My terminal emulator for some reason doesn't have root access. At this point I think I'm just going to SBF anyway.
At any rate, I just decided to pull /data/data/ from my phone onto my HD and I will replace it after I reflash and install my programs, but before I log into my google account. Do you see any reason for this not to work?

tildaSparky said:
Actually I'm running everything through the adb shell. It's puzzling to me too. My terminal emulator for some reason doesn't have root access. At this point I think I'm just going to SBF anyway.
At any rate, I just decided to pull /data/data/ from my phone onto my HD and I will replace it after I reflash and install my programs, but before I log into my google account. Do you see any reason for this not to work?
Click to expand...
Click to collapse
Hmmm, you might have to check your superuser app to see if you accidently are denying su access. In adb shell do you have a $ or a #?
Backing up the /data/data folder to your HD then restoring might not work because I am not sure if it will retain the owner, permissions, etc.

I had a # in my shell. There was something slightly wonky about my root I think. At any rate my backup method didn't work so well (as you predicted) - it caused timeriffic to force close when I tried to load in my old settings via /data/data/.
I will try using this again once I've got my shiny new Fission 2.1 set up as I want.
Thanks for your attentiveness!

I'm guessing this script should be run AFTER all of the applications have been installed. Is this correct?

wsfanatic said:
I'm guessing this script should be run AFTER all of the applications have been installed. Is this correct?
Click to expand...
Click to collapse
That is correct
Sent from my DROID2 using XDA App

Ooooo this is getting popularrrr

Is this D2 specific, or would it work on any phone?

theimpaler747 said:
Is this D2 specific, or would it work on any phone?
Click to expand...
Click to collapse
It works with the D2 and should work with the DX, anything else is use at your own risk, if it does work let me know though

csscmaster3 said:
It works with the D2 and should work with the DX, anything else is use at your own risk, if it does work let me know though
Click to expand...
Click to collapse
Might risk it and try it on my hero Regardless, nice work

theimpaler747 said:
Might risk it and try it on my hero Regardless, nice work
Click to expand...
Click to collapse
The only problem I could forsee would be the /preinstall folder being different or something, if you do end up trying the script could you let me know the size of the /preinstall folder?

Related

Android Browser build that AutoRotates

Here's a recompiled version of the Browser that supports auto rotate.
Here's the download location for the Browser.apk:
http://www.koushikdutta.com/2008/12/auto-rotate-for-android-browser.html
Run the following from the command prompt to install the new Browser:
Installation Instructions:
adb remount
adb shell rm /system/app/Browser.odex
adb push Browser.apk /system/app/Browser.apk
Now start up the Browser.
You may not have a Browser.odex depending on your phone model.
The change, as I mentioned before, is really trivial. In the BrowserActivity.onCreate, I did the following:
// the next line is the original code
// setRequestedOrientation(mSettings.getOrientation());
// make it use the sensor for orientation instead.
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
To restore the original Browser, flash RC30 again.
Koush, thanks so much! I have been waiting for this!
i can't get it to install and now the browser don't work and i can't install the back up
I'm getting no space available when pushing the browser.apk
JF rc30 v1.2
kron2 said:
i can't get it to install and now the browser don't work and i can't install the back up
Click to expand...
Click to collapse
You can't get it to install? Could you be more specific?
saul972 said:
I'm getting no space available when pushing the browser.apk
JF rc30 v1.2
Click to expand...
Click to collapse
Your /system partition ran out of room. Is there something you can delete from there? I've seen this before as well on some of my company's phones; I usually end up deleting some ringtones or other junk files.
took a couple of tries but installed now...thanks!
fyi i rebooted phone to initially install the new Browser. I first got errors w/o rebooting so that may fix the problem
I had the same problems with the new browser crashing and then being told that the file couldnt be copied due to lack of space,
Easiest fix is to just reinstall rc30 or rc8 and install the patched browser again.
Worked fine after that
Koush said:
Your /system partition ran out of room. Is there something you can delete from there? I've seen this before as well on some of my company's phones; I usually end up deleting some ringtones or other junk files.
Click to expand...
Click to collapse
Not sure.
Here's the message
failed to copy 'Browser.apk' to 'system/app/Browser.apk' : no space left on device
SGTDavePwnage said:
I had the same problems with the new browser crashing and then being told that the file couldnt be copied due to lack of space,
Easiest fix is to just reinstall rc30 or rc8 and install the patched browser again.
Worked fine after that
Click to expand...
Click to collapse
Will I need to start the process again?
saul972 said:
Will I need to start the process again?
Click to expand...
Click to collapse
Its basically telling you that it cant copy the file because of lack of space withing the system partition.
As koush advises, if you know how to clear space that will fix the problem.
If you dont know how to remove things and are a bit unsure of what to do, reinstalling the modified rc30 / rc8 will reset the system partition back to its defaults.
Once your back and set to default you can try to install again if you want
I'm assuming this is for those who have root access only?
If so, it would be nice to state that when posting these mods.
Henchman said:
I'm assuming this is for those who have root access only?
If so, it would be nice to state that when posting these mods.
Click to expand...
Click to collapse
Yes this requires root access,
I can see what you are saying about perhaps specifying in the post when something requires root access, but when you look at the instructions in this case its quite obvious that this one does require root.
PS.... Cheers for the upload Koush
SGTDavePwnage said:
Yes this requires root access,
I can see what you are saying about perhaps specifying in the post when something requires root access, but when you look at the instructions in this case its quite obvious that this one does require root.
PS.... Cheers for the upload Koush
Click to expand...
Click to collapse
Obviouse to em...
But probably not to everyone.
And you know the old saying. When you Assume...
where do i put Browser.apk to install it on the sd card and if so how do i use adb to see it or do i push it from like c:\browser.apk \system\app\browser.apk
SGTDavePwnage said:
Its basically telling you that it cant copy the file because of lack of space withing the system partition.
As koush advises, if you know how to clear space that will fix the problem.
If you dont know how to remove things and are a bit unsure of what to do, reinstalling the modified rc30 / rc8 will reset the system partition back to its defaults.
Once your back and set to default you can try to install again if you want
Click to expand...
Click to collapse
Finally got it!!! Thanks for your help
kron2 said:
where do i put Browser.apk to install it on the sd card and if so how do i use adb to see it or do i push it from like c:\browser.apk \system\app\browser.apk
Click to expand...
Click to collapse
Place it in the tools folder of the SDK folder on your PC
thx joshoowa i installed it finally i did have it in the tool folder but would not install but after several tries it did i was starting to think i was installing it wrong
I've deleted most of my .ogg audio related tones in the /media/audio folder but i still get no space left. what else can i delete?
btw i'm using adb shell rm /xxx/xxx/xxx/xx.ogg to delete. is that right?
Hey Hey!!!...
Had to free up some room, but it works great..
Thanks..

HTC Android Stay Safe Project

Table of Contents:
Status
Purpose
Audience
Instructions
Download
ROM list to use with the app
STATUS:
UPDATE:
I'm abandoning this project for the time being. I would like to have this integrated into the installer as a separate option and not rely on an app to handle this. If anyone wants to pick it up or extend things further, I'm definitely open to it. I just don't see a need for this at this time.
However, the source is still on GC and should help aspiring app makers get an idea for a basic UI and some interesting features.
Beta is out. It's working and ready to install on Cupcake and Donut.
If you are using it to create Hero, make sure you're running it. If you want Donut.. make sure you're running that, etc. It uses the currently running ROM for apps so it must match the new one or you might have issues with it. Requires root access. No way around that.
---------------------------------------------------------------------------------------
Purpose:
Due to issues regarding distribution of closed sources for ports of Android, this will handle backing up your licensed proprietary sources, an update you want to try and will put the sources into a final image and eventually partition if desired. You then rename NEW_system.ext2 to system.ext2 on your SD card's root folder and reboot.
---------------------------------------------------------------------------------------
Instructions
There will be a single app released soon!
1.) Install the APK
2.) Create a folder "update" on the SD card
3.) Place the update.sh file in /sdcard/update/
4.) Place a system.sqsh in the same folder.
5.) Run the app on the phone, click "Begin!" and let it do its thing.
6.) Take the "NEW_system.ext2" file on the SD card, rename it to "system.ext2" and remove or rename any existing system files.
7.) Reboot and enjoy
---------------------------------------------------------------------------------------
Download it here:
Google Code Page
Installable APK v1.0 BETA
Currently requires update.sh
---------------------------------------------------------------------------------------
This is an open project to be developed with others to bring a simple, shared interface that is compatible for any device running Android but of course with our phones in mind.
---------------------------------------------------------------------------------------
I wish I knew anything about development then I'd help, this is a good idea though. I'll try and support it in some way.
TheKartus said:
I wish I knew anything about development then I'd help, this is a good idea though. I'll try and support it in some way.
Click to expand...
Click to collapse
if you can't develop, I'd love feedback, bugs, ideas. I will eventually spin this into an open Market and later a Maps app. There's been talk about replacing these apps but nothing actually done. I was up all night with the Internet in one hand and Eclipse in the other and got this far for never having made anything like this.
This is a fantastic. I will support it fully. I am currently using a 1.5 build but I don't call which one it is because I've gone through so many versions and different roots, images and edits to my default.txt. It's a MUTT, I guess.
I am a Kaiser/Tilt user and was going to leave ATT until I decided to look into Android builds you and others offer.
Thanks a ton.
im getting fc/waits with the beta... by the way how long should the process take to backup. thanks nate
Running Cupcake or Donut? Is that once it starts running? It does not like to have a command run this long so it might just be that. Hasn't happened once for me running my Dark Donut though.
The backup is about 5 minutes or so mostly for dd'ing an ext2 image and then copying the apps. Once I hard code the script in I can make it show the progress. Also, each step will be a separate command so it shouldn't FC/wait on you. You can watch the progress by running:
Code:
tail -f /sdcard/update/update.log
which is what the app will do when I can get the update.sh verified by others that it's working correctly
And it is working for you right?
enatefox said:
Running Cupcake or Donut? Is that once it starts running? It does not like to have a command run this long so it might just be that. Hasn't happened once for me running my Dark Donut though.
The backup is about 5 minutes or so mostly for dd'ing an ext2 image and then copying the apps. Once I hard code the script in I can make it show the progress. Also, each step will be a separate command so it shouldn't FC/wait on you. You can watch the progress by running:
Code:
tail -f /sdcard/update/update.log
which is what the app will do when I can get the update.sh verified by others that it's working correctly
And it is working for you right?
Click to expand...
Click to collapse
it worked, i kept hitting wait and it didnt tell me when it was finished(the ui just froze idk). it gets the job done thanks man!
update.log
Code:
Backing up apps...
Mounting sqsh image...
Creating new system image
Transfering update sqsh to ext2...
edit i was running jeterblur but i was using the ion09/09/09.sqsh
It should say it finished. The log looks like it didn't finish. I'll try testing the script in the app itself and that should alleviate the strain on the system. It taps like 30-40% of CPU while it's running so if you have a bunch of processes it could be interfering. At least you're saying it's working too
I must be doing something wrong.
1. I put the dark donut clean build in my /storage card/updae folder along with the update.sh;
2. Ran android with an old Ion build (brand new data.img file)
3. Installed and ran stay safe
I had to press wait 5 times, and after 5 minutes it finished.​4. Before I reset the phone I moved the NEWsystem file into a new folder off the sdcard root
5. Then restarted the phone
6. In W.M. moved the ion data and system files to another folder
7. Renamed the NEWsystem (200mb) file to system
8. Put on root and ran harnet.
It booted, created a data file and is running great.​
The issue is, no added apps. It is exactly the same as the clean version.
Any ideas?
If you're making a Donut image, you should be running Donut on the phone to keep the versions correct. I'm going to make an update probably tomorrow that will have better error handling. It does do a cleanup at the end. If you edit update.sh (which is all the app runs) to remove these lines it will keep the apps it backs up:
rm -r "$app_base"
rm -r "$app_mountbase"
rm -r "$app_updatefolder/cmd"
rm -r "$app_ext2mount"
rm -r "$app_sqshmount"
Click to expand...
Click to collapse
It finds the apps through a grep pattern. On the full ROM, run this in ADB/terminal and see if it matches the apps:
ls /system/app/ | egrep -i 'vending|office|maps|street|gmail|market|youtube|setupwizard
Click to expand...
Click to collapse
enatefox said:
If you're making a Donut image, you should be running Donut on the phone to keep the versions correct. I'm going to make an update probably tomorrow that will have better error handling. It does do a cleanup at the end. If you edit update.sh (which is all the app runs) to remove these lines it will keep the apps it backs up:
It finds the apps through a grep pattern. On the full ROM, run this in ADB/terminal and see if it matches the apps:
Click to expand...
Click to collapse
I just tried it with the tmo donut build and your clean dark donut build; same result. So I removed the lines from the update.sh file and now the phone freezes. I let it sit for 30 mins, the rebooted the phone. It did grab the obdx? and apk files, but when I tried to manually install them, (after allowing non market apps) I get a "Program Name couold not be installed on this phone"
slight edit; I re-edited the file, now i does not freeze, but it still does not load the apps and the pulled apps will not install
I'm abandoning this project at this point. I'd like to have this integrated into the rootfs.img as an option at install time. If someone wants to pick it up or wants to take this further, I'm open to that. The source should help people out who would like to make an app though.

Rooted now how do I flash a rom?

My buddy got this phone I want to hook it up as he's not great with tech stuff i rooted with z4root and just need to know how to access recovery cause i didn't see a reinstall packages option in standard recovery ? Any help would be awesome thanks guys
I just rooted with Z4root... then I installed Titanium Backup and then ROM Manager, giving both apps root access (which I verified with the SuperUser app). In ROM Manager I did "Flash ClockworkMod Recovery" and chose the Fascinate option and was told that it downloaded the latest ClockworkMod Recovery. What's my next step?... Choose "Reboot into Recovery" within ROM Manager or do it another way. (My goal is to install Voodoo5 using the stock ROM for now. I have the Voodoo5 file on the SD card.)
EDIT: Whoops. I just realized that I had downloaded the two files to get CWM working but hadn't followed the unzipping, etc. instructions. I'd better go back and read that CWM thread again...
First get CWM working
Then check out this ROM
Or this ROM
and if you really wanna get fancy check out this kernel
Just in case you screw up
If you need more help on each specific topic, just ask in the appropriate areas and there is usually someone around that can answer questions.
Thanks for the quick links... really appreciate it.
BTW - Titanium Backup asks for USB Debugging to be enabled... do you have to do this? It creates issues for me when connecting the phone as mass storage to my PC.
ALSO - I'm assuming I should take an initial backup with Ti before I get too far into this, right? Not having done a backup before... is Ti the best to use? (Do I just choose batch and pick an option(s)? Does choosing "Backup user apps + system data" backup game save data?) EDIT: Just did this and it ran fine but it switched my Live wallpaper back to stock?!? WTF?
monthlymixcd said:
Thanks for the quick links... really appreciate it.
BTW - Titanium Backup asks for USB Debugging to be enabled... do you have to do this? It creates issues for me when connecting the phone as mass storage to my PC.
ALSO - I'm assuming I should take an initial backup with Ti before I get too far into this, right? Not having done a backup before... is Ti the best to use? (Do I just choose batch and pick an option(s)? Does choosing "Backup user apps + system data" backup game save data?)
Click to expand...
Click to collapse
Quick links are awesome! They save time, for sure.
Check the box to ask each time for mass storage and kies. Then you can have debugging enabled, and yes you have to have it enabled or TB won't do it's thing properly. You can switch it back and forth also. That's what I do.
I use TB to do my app and system data backups. Just run a batch backup on user apps and system data, like you said. That's the best option to start with. This isn't the same as a nandroid backup, but it's a good second choice for if you need to wipe data and restore apps quickly like a ROM install that requires you to wipe data/factory reset.
phidelt82 said:
Check the box to ask each time for mass storage and kies. Then you can have debugging enabled, and yes you have to have it enabled or TB won't do it's thing properly. You can switch it back and forth also. That's what I do.
Click to expand...
Click to collapse
Perfect. Thanks! Only thing is... USB dubugging doesn't stay ticked, it's ticked and Ti says it's not, or the connection still triggers a missing driver error message with Vista on the PC. Oh well.
phidelt82 said:
This isn't the same as a nandroid backup, but it's a good second choice for if you need to wipe data and restore apps quickly like a ROM install that requires you to wipe data/factory reset.
Click to expand...
Click to collapse
Easiest way to do a Nandroid backup? BTW - Ti backup ate up 5GB of my sd card?!? Yikes!
Also, regarding this thread:
phidelt82 said:
First get CWM working
Click to expand...
Click to collapse
I get "adb: not found"?
monthlymixcd said:
Perfect. Thanks!
Easiest way to do a Nandroid backup?
Also, regarding this thread:
I get "adb: not found"?
Click to expand...
Click to collapse
Nandroid backup will be there once you get CWM working.
You can do everything from the phone, just read down through the pages to find the people that have done it. They have left instructions using terminal emulator and root explorer. You will find that in a lot of instances many problems will have different ways of dealing with them. You probably don't have the Android SDK which is how you get ADB working on your computer. This isn't critical, it just makes it so that you will have to either install it or use the other means available. (ie terminal emulator and root explorer)
Still getting errors after trying several of the things in the thread... Q:I never did get a robot voice when I ran Z4root and never saw a place to choose permanent... should I run Z4root again? I mean, I was able to install Ti, etc. so I must have root, right? But I think my issues stem from not being able to get redbend_ua into the /system/xbin folder. Astro can't paste it there, Root Explorer can't paste it there, but in the terminal it appears like chmod worked... thoughts?
monthlymixcd said:
Still getting errors after trying several of the things in the thread... Q:I never did get a robot voice when I ran Z4root and never saw a place to choose permanent... should I run Z4root again? I mean, I was able to install Ti, etc. so I must have root, right? But I think my issues stem from not being able to get redbend_ua into the /system/xbin folder. Astro can't paste it there, Root Explorer can't paste it there, but in the terminal it appears like chmod worked... thoughts?
Click to expand...
Click to collapse
Root explorer needs to be mounted RW. There is a button at the top that will say RO or RW.
Sent from my SCH-I500 using XDA App
phidelt82 said:
Root explorer needs to be mounted RW. There is a button at the top that will say RO or RW.
Sent from my SCH-I500 using XDA App
Click to expand...
Click to collapse
"Mounted as r/w"
I tried this. Used root explorer to finally get redbend_ua into system/xbin but when I try to run the commands in the post it cannot find redbend_ua. I also cannot cd into xbin within the emulator to ls ... says xbin not found. Explorer can see it there... what gives? do you have to restore redbend_ua inside the xbin directory or will it work to restore it elsewhere?
EDIT: cd to /system/xbin worked and an ls shows the redbend_ua there but the chmod 777 redbend_ua fails to "Unable to chmod redbend_ua: No such file or directory
EDIT to the EDIT: Hang on... think I may have found where I went wrong. What's the terminal command for delete?
monthlymixcd said:
"Mounted as r/w"
I tried this. Used root explorer to finally get redbend_ua into system/xbin but when I try to run the commands in the post it cannot find redbend_ua. I also cannot cd into xbin within the emulator to ls ... says xbin not found. Explorer can see it there... what gives? do you have to restore redbend_ua inside the xbin directory or will it work to restore it elsewhere?
Click to expand...
Click to collapse
Are you doing /system/xbin? The first / is important. You don't need to cd to xbin, though.
Sent from my SCH-I500 using XDA App
Isn't there anyway to flash a rom using odin ? If not are the codes the same for terminal emulator as they are for adb to get cwm working? I'm from the vibrant section of this site running nero v4 right now I have a good understanding of odin for the most part but this not having an easy recovery is bs lol
willsnews said:
Isn't there anyway to flash a rom using odin ? If not are the codes the same for terminal emulator as they are for adb to get cwm working? I'm from the vibrant section of this site running nero v4 right now I have a good understanding of odin for the most part but this not having an easy recovery is bs lol
Click to expand...
Click to collapse
I've never flashed a ROM using Odin, but that doesn't mean that it can't be done. The process should be the same using terminal emulator or adb, just more of a pain. I agree it would be nice to have full CWM Recovery support (or any full recovery support) but I don't have the money to spend on a phone to send to Koush right now to get that done. As soon as I do, this will be done and then I'll have a tester phone for firmware builds. It really isn't that difficult to get it working, though. I've done it probably 30-40 times now and even the first time the only flub was in a typo for the second to last character (thought it was a 1 and not an L)
So you type this stuff in all in one line or what?
willsnews said:
So you type this stuff in all in one line or what?
Click to expand...
Click to collapse
Depending on which parts you are talking about, yes. Each new line is a line of code. If it moves to a new line, hit enter.
phidelt82 said:
Are you doing /system/xbin? The first / is important. You don't need to cd to xbin, though.
Sent from my SCH-I500 using XDA App
Click to expand...
Click to collapse
Yes. Something's definitely up 'cause when I try to use Astro to copy redbend_ua to /system/xbin the paste option is grayed out for that directory.
monthlymixcd said:
Yes. Something's definitely up 'cause when I try to use Astro to copy redbend_ua to /system/xbin the paste option is grayed out for that directory.
Click to expand...
Click to collapse
I can't remember if Astro has R/W options for the root directory. That may be the problem.
phidelt82 said:
Depending on which parts you are talking about, yes. Each new line is a line of code. If it moves to a new line, hit enter.
Click to expand...
Click to collapse
I just ned to get a custom recovery how did you type it in to terminal emulator? Like extacy how?i just dont want to mess up my buddies phone I want yo hook him up not **** him up lol
monthlymixcd said:
Yes. Something's definitely up 'cause when I try to use Astro to copy redbend_ua to /system/xbin the paste option is grayed out for that directory.
Click to expand...
Click to collapse
You guys are confusing the hell outta me I don't know who's answering me and who's answering you I know this pertains to this thread but im right in the middle of this process and its not even my phone
I apologize for the derail... I got mine working. I had a typo. I'm off to voodoo.

[ROOT] Manually backup/restore call history, text messages and contacts

I been performing this myself with great success, but you need ROOT access AND busybox installed. Create a folder on your phone's SD card called tmp. You'll need adb in order to adb shell, and gain root access. (in cmd, adb shell <enter> su <enter> confirm you are on a # prompt not the $ prompt)
Now copy and paste each line, press enter after each line pasted. Confirm the files copied after each line by running ls /mnt/sdcard/tmp/mmssms.db
Code:
cp /dbdata/databases/com.android.providers.contacts/contacts2.db /mnt/sdcard/tmp/contacts2.db
cp /dbdata/databases/com.android.providers.telephony/mmssms.db /mnt/sdcard/tmp/mmssms.db
cp /dbdata/databases/com.sec.android.provider.logsprovider/logs.db /mnt/sdcard/tmp/logs.db
cp /dbdata/databases/com.sec.android.app.memo/Memo.db /mnt/sdcard/tmp/Memo.db
cp /dbdata/databases/com.android.providers.calendar/calendar.db /mnt/sdcard/tmp/calendar.db
Once that is done, mount the phone to your computer and copy the TMP folder to your computer. When you flash the custom rom, you'll have to keep the SIM card out of the phone because you do not want new history items written to the log files.
Next ls -l /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others) to see what permissions/owner they have, if you simply cp the files from /mnt/sdcard/tmp to their locations, you'll get force closes in the application (because it's not able to write log data).
Make note is the owner for each db file. Then back to adb shell, su, cd /mnt/sdcard/tmp (trust everyone knows to copy the tmp folder from PC onto your phone) cp contacts2.db /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others!).
Once the files are copied back to their locations on the device, run the following:
Code:
chmod 660 /dbdata/databases/com.android.providers.contacts/contacts2.db
chown app_15.app_15 /dbdata/databases/com.android.providers.contacts/contacts2.db
Obviously you want to use the app_X.app_X you saw from running ls -l /path/filename before copying the backed up log file.
bravomail said:
This is quick comparative review.
Overall for KB1.
TiBu restore of system setting from JS32.2.1 or JS52.2.1 other than WiFi highly discouraged. I had uncurable Force Close for Browser and for MMS. Say g-bye to your messaging history, or find other ways of transferring it.
Click to expand...
Click to collapse
Original thread is here http://forum.xda-developers.com/showthread.php?t=969343
SMS Backup and Restore is a great app that does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.SMSBackupRestore
Call logs backup and restore also does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.CallLogBackupRestore
Both free and developed by the same guy, I've used both many times without a hitch.
I sync my contacts with gmail, so no problem there.
hauj0bb said:
SMS Backup and Restore is a great app that does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.SMSBackupRestore
Call logs backup and restore also does exactly what it's title indicates, without root.
https://market.android.com/details?id=com.riteshsahu.CallLogBackupRestore
Both free and developed by the same guy, I've used both many times without a hitch.
I sync my contacts with gmail, so no problem there.
Click to expand...
Click to collapse
+1
The manual method is pointless and extra work for nothing. These apps work flawlessly. I've used them many times as well.
I know there are apps which backup the same settings, my whole point for posting is I do not backup contacts with Google. So I kept trying different things until putting this together and I know it's a pain but all that really is done is copying and pasting lines into an SU adb shell.
askpcguy said:
I know there are apps which backup the same settings, my whole point for posting is I do not backup contacts with Google. So I kept trying different things until putting this together and I know it's a pain but all that really is done is copying and pasting lines into an SU adb shell.
Click to expand...
Click to collapse
You do not use google account or you just don't use it for backing up contacts...
I use a Google account but not to sync or backup contacts.
Sent from my SAMSUNG-SGH-I897 using XDA App
Thanks for good info!
Thanks for good info!
I personally don't care about my SMS history. Other people text a lot.
Another alternative is to use Google backup/synchronization. I never tried it. Anyone?
In my experience, backing up phone contacts using Gmail syncing is not 100%. Some fields in the on phone contact records are not properly carried into Gmail contact records and viceversa.
You'd think since Android is Google and Gmail is Google this would work flawlessly.
askpcguy said:
I been performing this myself with great success, but you need ROOT access AND busybox installed. Create a folder on your phone's SD card called tmp. You'll need adb in order to adb shell, and gain root access. (in cmd, adb shell <enter> su <enter> confirm you are on a # prompt not the $ prompt)
Now copy and paste each line, press enter after each line pasted. Confirm the files copied after each line by running ls /mnt/sdcard/tmp/mmssms.db
Code:
Next ls -l /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others) to see what permissions/owner they have, if you simply cp the files from /mnt/sdcard/tmp to their locations, you'll get force closes in the application (because it's not able to write log data).
Make note is the owner for each db file. Then back to adb shell, su, cd /mnt/sdcard/tmp (trust everyone knows to copy the tmp folder from PC onto your phone) cp contacts2.db /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others!).
Once the files are copied back to their locations on the device, run the following:
[CODE]chmod 660 /dbdata/databases/com.android.providers.contacts/contacts2.db
chown app_15.app_15 /dbdata/databases/com.android.providers.contacts/contacts2.db
Obviously you want to use the app_X.app_X you saw from running ls -l /path/filename before copying the backed up log file.
Click to expand...
Click to collapse
Are you doing all this above because
Code:
cp -p
failed to preserve attributes or something? Or do your fingers like the exercise...
Oh, I bet it's because it is that the attributes are getting scrubbed when they are copied off the device to your computer...
I only do this manual method because I want to retain my history and contacts between Roms.
Sent from my SAMSUNG-SGH-I897 using XDA App
I was asking specifically why you didn't use the "-p" preserve attributes flag when using the cp (copy) command. But I now realize your may be storing your backups in a way that blows away the info anyway. so you need to set ownership and permissions manually after restore..
Because I push the files to an external sd card which is copied to my computer.
Sent from my SAMSUNG-SGH-I897 using XDA App
TiBu does this, too. But thanks for the info. It's good too know how to do things manually, too.
Sent from my SAMSUNG-SGH-I897 using XDA Premium App
I don't think titanium backup will backup call history. It does get the contacts and calendar though.
Sent from my SAMSUNG-SGH-I897 using XDA App
I found this thread very useful for the restoration of all my recent messages!!
the backup i have done with smsbackup&restore is 12hour before the disaster
what happened? simply after a normal reboot my Desire HD was going to bootloop! i've tried several restore procedures but i find out that /data partition is somehow "bad", don't know why...
the only thing i can do is backup data partition with clockworldmod and unyaff it on a pc;
then i followed the instructions in the OP and i succedeed in making succesfully a backup of all my messages ;
the only difference is the different path in which mmssms.db is located in Desire HD:
i have in /data/data/com.android.providers.telephony/databases/
thank you again mate, very detailed guide
Glad someone found this useful! This is only compatible with Froyo roms, Gingerbread uses the /datadata folder and I haven't needed to manually backup the files because MIUI backup does it so amazingly well!
Well, this is pretty neat. I'm forever reflashing my phone and having to reload everything.
Which is a p-a-i-n..
One question though, is there anyway to do all this using "adb shell"? I'd love to incorporate this into a batch file I'm making, with the proper credits of course, and it'd be nice to press a button and have the PC do all the hard work.
askpcguy said:
I don't think titanium backup will backup call history. It does get the contacts and calendar though.
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
Super Backup from the Market does all 3:
https://market.android.com/details?id=com.idea.backup.smscontacts&feature=search_result
The apps in post #2 are great too.
Ticklefish said:
Well, this is pretty neat. I'm forever reflashing my phone and having to reload everything.
Which is a p-a-i-n..
One question though, is there anyway to do all this using "adb shell"? I'd love to incorporate this into a batch file I'm making, with the proper credits of course, and it'd be nice to press a button and have the PC do all the hard work.
Click to expand...
Click to collapse
I tried, I had sort of a working bash script but ran into problems trying to get the script root access to do the copying/restoring. Come to think of it, if you wanted to get fancy, you could make a clockwork mod flashable zip. One for backup and one for restore.
-Yes, I know there are apps which might do this however I wanted to learn on my own.
Well, yes, there are backup apps but you have to reinstall those apps and wait while they put your data back in bit by bit. Granted it may not take long but when you're reflashing what seems like once every five minutes, it can take forever!
The zip route seems like a good idea. That way, you can back up, install a rom and restore your details all from one screen. I'll have to have a look at it.
Sent from my U20i using XDA App

[HOW TO] Fully Backup & Restore Android Device

NOTE:
I'm not a developer or something even near to that. I'm a newbie and will be, seems so. All information provided here is copied and compiled from different internet sources. This information is according to best of my knowledge and comprehension and is just for curious souls like me who want to understand things in quite simple words.
I have tested this on different devices. I'll not be responsible for any harm to you or your device. It works perfectly for me. You may try it on your own risk.
Encrypted memory may cause problem in backing up and restoring data. So better decrypt it before proceeding. Or the Recovery should support decryption of /data partition.
WHY YOU NEED TO BACKUP YOUR DATA
For security, in case if device is lost. Read here more about the risks.
If you are going to change your device.
If your device is running out of memory space.
If your device is slowing down or giving random errors and you want a clean start i.e. by factory data reset.
If you are upgrading your Factory Firmware or ROM (OS).
If you are a curious soul like me and interested in experimenting with device.
WHAT TO BACKUP
Backup is a broad term used in many contexts.
PERSONAL DATA
On an android device, backing up personal data like pictures, music, videos, documents, e-books etc. means backing up Internal Memory (/data/media/) and SD card (if you use one). If you have disabled internal memory (D.I.M), your SD Card would be working as Internal Memory.
Personal data might be created by apps (like Camera, Facebook, WhatsApp etc) or imported from internet or other devices by yourself.
APPS & APPS DATA
If you are upgrading your ROM permanently, you might be interested in backing up your apps and their data as well. So that you don't lose important data and don't have to install apps again. System apps are stored in different folders under /system/ while user apps under /data/.
Apps typically store their data in /data/data/ but it's not a rule. Many apps save / backup their data on Internal Memory and/or SD Card as well. That's why you see folders named 'Android', 'data' etc. on Internal Memory and SD Card. Also, there are numerous folders named after app names. These folders may contain Personal Data as well, created by that certain app.
Contacts and messages are also stored in their default apps' data folder i.e. in /data/data/ and are not usually backed up manually.
OPERATING SYSTEM & APPS & APPS DATA
If you are going to install new ROM temporarily, you may want a complete backup so that you don't have to go through the hassle of installing apps and setting up / personalizing your device again. It usually includes /system, /boot and /data partitions.
OS consists of SYSTEM and BOOT. While user apps & apps data is stored in DATA.
PARTITION IMAGES
From a developer's perspective, one may want to backup the whole device partitions, in case if something goes wrong during experimenting.
Read here more about android partitions.
WHERE TO BACKUP
INTERNAL MEMORY (/sdcard) (/storage/sdcard0) (/data/media/0)
This memory can be used to save data if you are not going to wipe / clean it. A Factory Data Reset usually doesn't wipe this but it can. It depends on the device. Similarly, Recoveries usually don't wipe internal memory but you can manually do so. However, formatting /data would certainly erase internal memory. Formatting might be a part of flashable zip if you are going to install new ROM. Flashing Factory Firmware using flasher will also erase internal memory.
EXTERNAL SD CARD (/external_sd) (/storage/sdcard1)
This is a more safer place to save / backup data because it is not wiped unless done manually or accidentally.
PERSONAL COMPUTER (USB Flash drive or Internal / External Hard Disk)
This is the safest place to keep data with abundant space and the least chances of losing / corrupting data.
ONLINE / CLOUD STORAGE
Some apps, including Google offer backing up your data online and auto-synchronizes it. You should certainly avail this option particularly for sensitive and light weight data like contacts, messages, documents, saved passwords, bookmarks, financial transactions etc. WhatsApp also has a good online backup option. You can use apps like Drive, SMS Backup & Restore, FolderSync, KeepSafe etc. to better utilize this option. But technically, this is a limited option.
HOW TO BACKUP
FILE EXPLORER APPS
You can use a file explorer like ES Explorer or Solid Explorer to manually copy files from, say, Internal Memory to SD Card to back it up.
BACKUP APPS
Some default apps have built-in feature to backup data and settings locally and online e.g. GO-SMS, Tasker etc. You can check apps for this feature.
Also, special backup apps like Titanium Backup can backup almost all of your user and system apps and their data. It can also backup contacts, messages, device settings etc. It can create a flashable zip of backed up data to flash through recovery. However, backups from one ROM may not fully work with other ROM's.
CUSTOM RECOVERY
Backing up data when ROM is running isn't safe. When files are being used by OS, they might not be written / read sometimes. So, a custom recovery is the best option to backup/restore data. Custom recoveries (TWRP/CWM) can backup / restore partitions SYSTEM, BOOT and DATA (excluding internal memory) for sure. Some new recoveries offer backing up more (or all) partitions on device. You can choose where to save backup files i.e. Internal Memory or SD Card. Then you can transfer these files to PC as well.
You can also use recovery's File Explorer to copy Internal Memory to SD Card. However, it's a slower process if you have a large number of files to backup.
PC
You can use PC in multiple ways to backup/restore data within device or from/to PC.
First of all, you will often come across different software advertised on net claiming to fully backup your device when connected to PC. They work but are not much useful / reliable according to my experience. Give them a try, if you want to.
Secondly, you can use USB cable to directly connect your device (as MTP in ROM or recovery) to PC or use apps like Wi-Fi File Transfer to wirelessly connect (in ROM) and then explore Internal Memory and SD Card. FTP or SFTP (SSH) server may also be setup on Android to remotely access it from PC if both are on same network.
Thirdly, you can mount SD Card as flash drive (UMS in ROM) or switch off your device, remove SD Card and then insert directly into PC through card reader to manually copy files. This method is faster, to copy large data. However, mounting as UMS in running ROM isn't recommended, particularly if you are using D.I.M. It will crash apps.
In Android 5+ UMS may not be available in USB settings as it has been deprecated in favor of MTP to avoid problems. However, to copy large data from internal SD card is really problematic without direct USB connection. Or what if we need to recover accidentally deleted data from internal memory? We can directly attach internal memory (as in UMS) to PC by a little hacking.
Fourthly and ultimately, like a boss , you can use life saving ADB feature of android to backup/restore your data as well as recovering your device from difficult situations and doing a lot of stuff. It's the best and fastest method to backup Internal Memory to SD Card and then restore (COPY WHOLE FOLDER (within device)). Or you can COPY WHOLE FOLDER (From/To PC) or COPY WHOLE PARTITION IMAGE (within device) or BACKUP / RESTORE APPS & DATA (From/To PC) in seconds.
Read here more about android partitions.
Another application that you can use to backup your phone to computer is Apowersoft Phone Manager. This works greatly in managing your devices plus it make sure that all your files are secured from being corrupted or loss.
doublematteo said:
Another application that you can use to backup your phone to computer is Apowersoft Phone Manager. This works greatly in managing your devices plus it make sure that all your files are secured from being corrupted or loss.
Click to expand...
Click to collapse
I can't determine the efficiency of the Apowersoft tool, but if you want to backup data , this is right way , after the phone data is backuped ,you don't have to worry about the deleted data unable be recovered back ,
The backup files is the best way to recover deleted data from phone
Kindly guide me on restoring app data alone from a nandroid to newer version of an app..
The scenario is that ,I upgraded to a higher android OS but find some of my apps(with no cloud storage),restored from my nandroid ,crashing; probably prompted by the change in OS.
I downloaded the compatible version of the app from playstore,but am clueless how to sync restored app data from nandroid to this version.
DIGVIJAY24 said:
Kindly guide me on restoring app data alone from a nandroid to newer version of an app..
The scenario is that ,I upgraded to a higher android OS but find some of my apps(with no cloud storage),restored from my nandroid ,crashing; probably prompted by the change in OS.
I downloaded the compatible version of the app from playstore,but am clueless how to sync restored app data from nandroid to this version.
Click to expand...
Click to collapse
Would you please mention apps names? Don't uninstall previous version. Just install compatible version over it. It should automatically have previous app data.
The backup program is much simpler than the android recovery program,
I came here looking for the best way to back up my internal storage before activities like flashing a new ROM or firmware. Previously, I'd plug my phone into my PC and just drag and drop the internal storage partition to a folder on my computer, but I'd often have to do it a few times because some file would get hung up, or the phone would randomly disconnect (even though my phone, cables, and computer are all new and high quality).
I'm currently using the TWRP file explorer to copy /sdcard to /external-sd/!InternalBackup, but there is no running log or progress indicator... So, this approach is less than ideal.
I'm still looking for the best method (not necessarily a software that will do it for me) that will do it fast, not get interrupted, and provide good feedback on if it's working and how much longer it will take. (The TWRP method above checks the first 2 criteria, but the 3rd is woefully insufficient.
I'm thinking that the best way to back up the internal SD will be in recovery, otherwise something might be in use and will halt the process.
Any suggestions?
DrPhant0m said:
I came here looking for the best way to back up my internal storage before activities like flashing a new ROM or firmware. Previously, I'd plug my phone into my PC and just drag and drop the internal storage partition to a folder on my computer, but I'd often have to do it a few times because some file would get hung up, or the phone would randomly disconnect (even though my phone, cables, and computer are all new and high quality).
I'm currently using the TWRP file explorer to copy /sdcard to /external-sd/!InternalBackup, but there is no running log or progress indicator... So, this approach is less than ideal.
I'm still looking for the best method (not necessarily a software that will do it for me) that will do it fast, not get interrupted, and provide good feedback on if it's working and how much longer it will take. (The TWRP method above checks the first 2 criteria, but the 3rd is woefully insufficient.
I'm thinking that the best way to back up the internal SD will be in recovery, otherwise something might be in use and will halt the process.
Any suggestions?
Click to expand...
Click to collapse
Commandline solutions are always best. You have better control over them. Use TWRP built-in terminal to run commands.
Simply 'cp' with verbose option "-v" is what fulfills your needs. 'rsync' is better if you want to save time by automatically skipping unchanged existing files. If you want to preserve file attributes and permissions, use 'tar'. Added compression can be achieved by 'xz' or '7za'. All of these commands are stable solutions, with high speed and ability to handle/resume broken/interrupted operations.
TWRP comes with busybox bundled. Busybox utilities have limited functionality and mostly suffice the need but rarely we face unexpected behavior. Instead you can use full static binaries of these commands.
Typing lengthy commands in TWRP shell terminal is somewhat challenging. Either use 'adb shell' or for repeated use, create a shell script and place it in internal memory or SD card. Or you can unpack TWRP image and save script in /sbin directly to run it just as a normal command. Another easy way is to create a flashable zip of your script. This way you can also see progress bar moving if you write a proper script for it.
Hope it helped.
mirfatif said:
Commandline solutions are always best. You have better control over them. Use TWRP built-in terminal to run commands.
Simply 'cp' with verbose option "-v" is what fulfills your needs. 'rsync' is better if you want to save time by automatically skipping unchanged existing files. If you want to preserve file attributes and permissions, use 'tar'. Added compression can be achieved by 'xz' or '7za'. All of these commands are stable solutions, with high speed and ability to handle/resume broken/interrupted operations.
TWRP comes with busybox bundled. Busybox utilities have limited functionality and mostly suffice the need but rarely we face unexpected behavior. Instead you can use full static binaries of these commands.
Typing lengthy commands in TWRP shell terminal is somewhat challenging. Either use 'adb shell' or for repeated use, create a shell script and place it in internal memory or SD card. Or you can unpack TWRP image and save script in /sbin directly to run it just as a normal command. Another easy way is to create a flashable zip of your script. This way you can also see progress bar moving if you write a proper script for it.
Hope it helped.
Click to expand...
Click to collapse
That's a lot of help... But I lack the basic understanding and experience to make use of it all. I'll have to Google it a bit and look at some examples. Thanks!
UPDATE: I did a little research, and I succeeded in using "cp" to do a test move in TWRP (I had to use -r and -v), but even using -v didn't create a progress bar or any indication that files were being moved. It just finished and went to the next new line. Is this expected?
Also... my version of TWRP doesn't seem to have rsync available. When I try to use rsync in TWRP, I get
Code:
sh: rsync: not found
So it seems that TWRP's terminal doesn't have rsync. I'm using TWRP 3.0.2-1
So... I'm currently using the Termux app to do the cp operation. I'd prefer to use rsync, which is supported in Termux, however, unless I do "su" first, it says it doesn't have access to the destination folder. And, when I use "su" I can't use rsync. I get pretty much the same message as when I try to use it in TWRP... something like "rsync not found"
Does this mean that when Termux is using root, it can't use rsync? Does that make sense?
Any help?
Thanks!
DrPhant0m said:
I did a little research, and I succeeded in using "cp" to do a test move in TWRP (I had to use -r and -v), but even using -v didn't create a progress bar or any indication that files were being moved. It just finished and went to the next new line. Is this expected?
Click to expand...
Click to collapse
'cp -r' copies recursively i.e. files/directories under directories and so on. So it's definitely required if you want to copy directories. 'cp -v' shows each file which is being copied, but not the progress during a single file copying. Check 'cp --help' for options.
Also... my version of TWRP doesn't seem to have rsync available. When I try to use rsync in TWRP, I get
Code:
sh: rsync: not found
So it seems that TWRP's terminal doesn't have rsync. I'm using TWRP 3.0.2-1
Click to expand...
Click to collapse
TWRP uses busybox which doesn't have rsync built-in. You can get a copy of static (independently working) rsync binary from many sources like this. Aarch64 will be a bit faster. Check 'getrpop | grep ro.product.cpu' to find your CPU architecture if it's 64-bit or 32. When in TWRP, place binary in /sbin directory. Then do 'chmod 0777 /sbin/rsync' to make it executable. Now you can use rsync. 'rsync --help' will show you options and basic help. Do note, /sbin is on volatile filesystem i.e. it will be gone on reboot. Don't expect it to be permanently there. You can also use rsync from other locations like sd card but that will need to call binary with full path and filesystem may put restrictions on execution.
So... I'm currently using the Termux app to do the cp operation. I'd prefer to use rsync, which is supported in Termux, however, unless I do "su" first, it says it doesn't have access to the destination folder. And, when I use "su" I can't use rsync. I get pretty much the same message as when I try to use it in TWRP... something like "rsync not found"
Does this mean that when Termux is using root, it can't use rsync? Does that make sense?
Click to expand...
Click to collapse
It's expected. When we do 'su' on Termux, it's environment is gone and PATH is set to /system/bin etc. So any binaries which Termux downloaded to /data/data/com.termux/files/usr/bin won't work. There are better options, but easiest is to use 'tsu' instead of 'su' on Termux. It will handle things for you to run Termux binaries in superuser mode. Do 'apt install tsu' when connected to internet. Once installed, simply execute 'tsu'. Now you can use Termux rsync binary.
Or use rsync static bianry instead as explained above. Copy rsync to /system/bin/ or /system/xbin/ etc. and set permissions. SELinux may interfere if it's set to "Enforcing". Do 'getenforce' to check and 'setenforce 0' to set it "Permissive".
DrPhant0m said:
That's a lot of help... But I lack the basic understanding and experience to make use of it all. I'll have to Google it a bit and look at some examples. Thanks!
UPDATE: I did a little research, and I succeeded in using "cp" to do a test move in TWRP (I had to use -r and -v), but even using -v didn't create a progress bar or any indication that files were being moved. It just finished and went to the next new line. Is this expected?
Also... my version of TWRP doesn't seem to have rsync available. When I try to use rsync in TWRP, I get
So it seems that TWRP's terminal doesn't have rsync. I'm using TWRP 3.0.2-1
So... I'm currently using the Termux app to do the cp operation. I'd prefer to use rsync, which is supported in Termux, however, unless I do "su" first, it says it doesn't have access to the destination folder. And, when I use "su" I can't use rsync. I get pretty much the same message as when I try to use it in TWRP... something like "rsync not found"
Does this mean that when Termux is using root, it can't use rsync? Does that make sense?
Any help?
Thanks!
Click to expand...
Click to collapse
This reply is probably a bit late for you, but...
If you install tsu (pkg install tsu) in TermUX and use tsu rather than su, it'll work.
Tsu sets up the runtime context for su properly.
Sent from my OnePlus3T using XDA Labs
BillGoss said:
This reply is probably a bit late for you, but...
If you install tsu (pkg install tsu) in TermUX and use tsu rather than su, it'll work.
Tsu sets up the runtime context for su properly.
Sent from my OnePlus3T using XDA Labs
Click to expand...
Click to collapse
Hey, it's never too late to refine your backup strategy. Thanks for letting me know.
I installed tsu in Termux, and when it finished, I tried to use rsync with su, and got the same "rsync: not found" error. Please see the following output, with my entries in Bold[/B].
Code:
$ [B]pkg install tsu[/B]
[COLOR="Gray"][I]~~
~~[LOTS OF LINES DETAILING THE INSTALLATION OF TSU]~~
~~[/I][/COLOR]
Setting up tsu (1.1)...
$ [B]su[/B]
elsa:/data/data/com.termux/files/home # [B]rsync[/B]
sh: rsync: not found
127|elsa:/data/data/com.termux/files/home #
*** Though I did enjoy watching the movie with my son, I did not pick the name Elsa for my device. That's just what LG called the carrier-free V20, Model US996.
Am I doing something wrong? To be clear.. I just did "rsync" without any commands/switches to see if it would produce the help info. I knew it wouldn't actually attempt to copy anything.
DrPhant0m said:
Hey, it's never too late to refine your backup strategy. Thanks for letting me know.
I installed tsu in Termux, and when it finished, I tried to use rsync with su, and got the same "rsync: not found" error. Please see the following output, with my entries in Bold[/B].
*** Though I did enjoy watching the movie with my son, I did not pick the name Elsa for my device. That's just what LG called the carrier-free V20, Model US996.
Am I doing something wrong? To be clear.. I just did "rsync" without any commands/switches to see if it would produce the help info. I knew it wouldn't actually attempt to copy anything.
Click to expand...
Click to collapse
Lol! You missed the key point: use tsu instead of su.
Instead of typing "su", type "tsu".
But don't take it too hard - I did the same thing when I first started.
Sent from my OnePlus3T using XDA Labs
Got it. Worked just fine. Thanks!
DrPhant0m said:
I installed tsu in Termux, and when it finished, I tried to use rsync with su, and got the same "rsync: not found" error. Please see the following output, with my entries in Bold[/B].
Click to expand...
Click to collapse
I mentioned to use 'tsu' instead of 'su' but probably you missed that.
mirfatif said:
When we do 'su' on Termux, it's environment is gone and PATH is set to /system/bin etc. So any binaries which Termux downloaded to /data/data/com.termux/files/usr/bin won't work. There are better options, but easiest is to use 'tsu' instead of 'su' on Termux. It will handle things for you to run Termux binaries in superuser mode. Do 'apt install tsu' when connected to internet. Once installed, simply execute 'tsu'. Now you can use Termux rsync binary.
Click to expand...
Click to collapse
/data/data/com.termux/files/bin/tsu is just a wrapper i.e. a shell script that sets environment variables for Termux and then executes 'su'.
mirfatif said:
I mentioned to use 'tsu' instead of 'su' but probably you missed that.
/data/data/com.termux/files/bin/tsu is just a wrapper i.e. a shell script that sets environment variables for Termux and then executes 'su'.
Click to expand...
Click to collapse
I see it now. I gave a thanks, though admittedly late. Sorry!
Is backup feasible when sd external card has been mounted extending the internal storage (Android 6.0), working as internal storage as well?
Can some expert comment on this, just not to go crazy for nothing. I don't want to upgrade with last rom by manufacturer and lose my data.
I have ADB , fastboot and usb drivers, but trying and use Helium backup I was unable to pair, even though the phone is connected (I can select onscreen for instance PTP or usb storage, tried both, nothing).
Not even sure about nandroid backup also.
HeyRicardo said:
Is backup feasible when sd external card has been mounted extending the internal storage (Android 6.0), working as internal storage as well?
Can some expert comment on this, just not to go crazy for nothing. I don't want to upgrade with last rom by manufacturer and lose my data.
I have ADB , fastboot and usb drivers, but trying and use Helium backup I was unable to pair, even though the phone is connected (I can select onscreen for instance PTP or usb storage, tried both, nothing).
Not even sure about nandroid backup also.
Click to expand...
Click to collapse
Yes it's feasible but depends on what, how and where you want to backup.
mirfatif said:
Yes it's feasible but depends on what, how and where you want to backup.
Click to expand...
Click to collapse
Any solution is fine to me, I just want to be able to restore apps and launcher (Nova launcher prime) with icons arranged as they are, without having to start all over from scratch.
Other data are on the cloud, so if I can possibly backup some folder (from phone or sd card, if the difference matter in my case) good, or I'll take care of it in advance.
Just having the phone upgraded but not reset from the beginning.
If necessary I can try rooting it. Thx for replying.
how to use a twrp data backup for oder rom?

Categories

Resources