• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

A Backup Routine for us all

argedion

The TechnoFrog
Jun 20, 2011
6,356
6,303
The Infernal Swamp
I have been on the forums for a year and a half and I can't even count the number of times that I have seen someone come in all panicky wanting to get stuff off their SDCARD when there is a problem with the device. We ofcourse offer the best assistance as we can to help however sometimes that is simply not enough. The very best way to retrieve stuff on the SDCARD is when there are no problems with device.

We here at Phandroid understand your pain and wish to help you develop a healthy backup plan so you can maintain all those precious photos and documents you have collected over the year(s) with your current device. There are several methods we are going to discuss here for both the rooted and non-rooted users. While we could assume that rooted users already have a healthy backup plan we rather not assume and just offer assistance in this desired area of device ownership.

There are several ways to maintain a healthy backup plan however for some it may not be as easy as it is for others. Lets say you have a phone with internal memory of 8gig however you have no external way to put a card in. Lets take it even further and say that you don't even own a computer to plug the device into and make a backup of your precious data then what? Well for you there are some alternatives out there and one of the best ones happens to be Cloud Storage. There are many sites out there that offer free storage. Choose whom you wish to choose and start learning how to upload files on to their servers. Most offer a convenient app to do this for you.

Learning to what to backup can be just as intimidating as finding the right storage cloud for your purposes. Rule of thumb is that if you created it you want it. (Photos taken with camera, Documents you saved etc.) There are a few places that allow you to stream media over to your device by keeping your music and video's on their servers. Amazon and Google Play Music are a couple. They give you reasonable amounts of space so you can keep a bunch of music on their servers. It's your responsibility to know what you need to keep and where the best place to store it is. Now is the time to practice uploading stuff once a day to the cloud of your choice before a disaster happens.

Next are those who are fortunate enough to have a computer that you can back up stuff to and you really don't trust “the cloud” anyways. So what are your options well since you have a computer they are not as limited as those with out a computer. For instance if you have a 32 gig external card and 8 gig of internal you can back up all of it on your computer provided you have ample space to do so. In this example you need about 45gigs of space. (always leave a buffer)

Plugging your device into your computer via its cable allows you several options for backing up. The first and probably one of the easiest is the Drag and Drop Method. This consist of grabbing the contents with a mouse and dragging them to a folder on the computer and dropping that content. (Note: Backup Process's can take a while to complete so you may have to wait a while depending on how much you back up)

Dragging and Droping is nice however it uses up a bunch of resources that you could be using doing other task. No matter what OS you have you can use a script file to save your stuff over to disk for you. If your an advanced user you probably have a folder where you keep your scripts Infact you probably have a backup script for your computer in there. You know its a simple get the mount point and do a copy routine.

So what if your not that advanced then what? What alternatives do you have? This is where Phandroid takes things into their own hands and gets you what you need. A workable script that will do this for you. All you really need to know is how to “Point and Click” Ofcourse there are some things you need to do to get it to that point and these things we will walk you through here.

First you need to get a hold of a powerful little program known as ADB. We have what is known as a Mini SDK here which offers all you will need. Second you will need to place the files on your hard drive and put them in your path variable. A tutorial on how to do this is at the end of the thread where the Mini-SDK is. If you don't wish to change the path variable you will need to change the script to show where your adb is stored. So instead of :

ADB="adb" you will need to make it looks similar to this:
ADB=&#8221;C:\sdk-tools\adb&#8221; <--- needs to be exact and should not contain spaces as a best practice.

So what if your not on windows then you should change accordingly but its just best to place it in your path variable.

ADB=&#8221;/home/user/bin/adb&#8221; or similar

Note - using our Mini-SDK and its installer will create the path for you in Linux or Mac OS X.

The script is designed to save it in your home folder under the format of :
Serailnumber_date so it could look like this:

123456789_20130310

Serial Number refers to the devices serial number and ofcourse the date is the current date. A Windows Version of the script can be found in the "Attached Files" area at the bottom of this post.

Drawbacks or Cons of the Script file. You need to be responsible and ensure that the path variable is handled with caution and to make sure you have no typo's. Also you need to make sure that where it is saving the contents is where you want them. For instance I have a backup drive that I store all my Backups on so it only makes since to keep all my device backups on the same hard drive. This is not in my home folder so I had to modify the save_path variable in the script. Things advanced users will have no issues with.

Pro's of the script is you can set it up to run at certain times all you need to do is insure the device is connected at that time and ready to go.

Download's referenced above:

Old versions:
Windows Version of the script (original version 10-March-2013)
 

Attachments

  • win-backup-sd.zip
    1.5 MB · Views: 686
Last edited by a moderator:
scary alien's Windows versions of the script can be found in the "Attached Files" area at the bottom of the first post.

(sa edit: link updated 27-Feb-2015 to reference version/attachment at the bottom of the first post)


Credits Goes to:
BabyBlues
Scary Alien
EarlyMon
Out Of Phases
palmtree5
argedion

More to follow as they tell me who they are.
 
Last edited by a moderator:
Upvote 0
EarlyMon's *nix backup script, good for Linux, OS X and Windows PCs running CYGWIN

Preferred and supported use - grab our Mini-SDK and then unzip this file in the same sdk-tools folder you used to run the Mini-SDK installer.

Alternatively, use a full SDK distribution and ensure that adb is in your PATH environment variable.

Instructions:

  • unzip backup-sd.sh.zip
  • chmod 755 backup-sd.sh
  • To use:
    • ./backup-sd.sh


Files are saved under:

  • If using our Mini-SDK or Cygwin:
    • sdk-tools/android_storage_backups
  • Otherwise:
    • $HOME/android_storage_backups
Saved directory folders are named:

  • serial-number_date
  • Optionally, serial-number_date_time if run more than once on the same day
  • Multiple devices can be backed up and distinguished by their serial numbers


Note - Cygwin creates a Linux environment under Windows.


Credits Goes to:
BabyBlues
Scary Alien
EarlyMon
Out Of Phases
palmtree5
argedion

More to follow as they tell me who they are.
 

Attachments

  • backup-sd.sh.zip
    1.5 KB · Views: 515
  • Like
Reactions: scary alien
Upvote 0
It should be noted that in order to use ADB you need to enable the USB debugging setting on the phone.

And, to add to the list of drawbacks and cons, even if you have a password lock on the phone, if USB debugging is enabled, and if your phone is lost or stolen, and if the finder/thief is sophisticated - yes, that's a lot of ifs - then they can also use the ADB application to access files and data on your phone.

The likelihood if this happening is probably very, very small, but you should know about this before enabling USB debugging.
 
Upvote 0
Hi

I am going to follow the instructions you have outlined before I root my Samsung Galaxy S3 Mini I8910-N. I have only ever rooted one phone before and I wish I had backed it up.

Before rooting what about using apps like MyBackup Pro, Astro, Samsung Kies?

People talk about Titanium Backup and Clockwork Rom Manager but I think you need root first to use those?

Does your method do a better job than all of them? Is it the only backup method you would use for a pre-root device or would you use an app too, if so which one?

Does your method backup settings for paid apps?
 
Upvote 0
Hi

I am going to follow the instructions you have outlined before I root my Samsung Galaxy S3 Mini I8910-N. I have only ever rooted one phone before and I wish I had backed it up.

Before rooting what about using apps like MyBackup Pro, Astro, Samsung Kies?

People talk about Titanium Backup and Clockwork Rom Manager but I think you need root first to use those?

Does your method do a better job than all of them? Is it the only backup method you would use for a pre-root device or would you use an app too, if so which one?

Does your method backup settings for paid apps?

You do need to be rooted to use Titanium Backup or MyBackup Root - those are app backups. You also need to be rooted for Rom Manager, but proceed with caution, it doesn't support everything and you can get screwed up if your phone isn't supported.

If you're not rooted then MyBackup Pro or Carbon, plus SMS Backup+ with either one, is the way to go for app backups.

Ours is not an app backup and doesn't try to be.

This is strictly an sd card backup, known to work with some phones, not all, so you will want to verify it by giving it a try before trusting it. If our method doesn't work for you, then you have to mount as USB storage when you plug in your phone and use drag and drop to backup your sd card.

Hope this helps! :)
 
  • Like
Reactions: Frisco
Upvote 0
You do need to be rooted to use Titanium Backup or MyBackup Root - those are app backups. You also need to be rooted for Rom Manager, but proceed with caution, it doesn't support everything and you can get screwed up if your phone isn't supported.

If you're not rooted then MyBackup Pro or Carbon, plus SMS Backup+ with either one, is the way to go for app backups.

Ours is not an app backup and doesn't try to be.

This is strictly an sd card backup, known to work with some phones, not all, so you will want to verify it by giving it a try before trusting it. If our method doesn't work for you, then you have to mount as USB storage when you plug in your phone and use drag and drop to backup your sd card.

Hope this helps! :)

Thanks, it does help! :)

What about my settings and firmware, can they be backed up? Regular phone settings and settings for installed free and paid apps?

Can my firmware be backed up? I already have a copy of the firmware I found online so maybe it's not required...
 
  • Like
Reactions: EarlyMon
Upvote 0
Thanks, it does help! :)

What about my settings and firmware, can they be backed up? Regular phone settings and settings for installed free and paid apps?

Can my firmware be backed up? I already have a copy of the firmware I found online so maybe it's not required...

in order to save app settings you will need a program like Titanium Backup. As far as system settings the only thing I can think of is a nandroid.

Be careful with firmware that can brick you in a flash. (pun intended)

This backup is only for the internal/external storage device and not for anything else.
 
  • Like
Reactions: EarlyMon
Upvote 0
I'm trying to get the script to work with my S4 and I get

# adb: C:\sdk-tools\adb.exe
# snum: * daemon not running. starting it now on port 5037 *
# nc: * daemon not running. starting it now on port 5037 *
# card1: none
# card2: none
# wdate: 20131125
# wtime: 0514
# target1: C:\sdk-tools\android_storage_backups\* daemon not running. starting it now on port 5037 *_20131125_0514
# target2: C:\sdk-tools\android_storage_backups\* daemon not running. starting it now on port 5037 *_20131125_0514_2nd

It then just gives up. I will paste the whole debug log here if that would be OK....
 
Upvote 0
Windows script firs not work for me first.
Windows7 x64

Reason was first run of line
[HIGH]"%adb%" get-serialno > tmp_work [/HIGH]locks file tmp_work0, and all later writes into fails.
Then I change it like
[HIGH]
"%adb%" get-serialno > tmp_work0
set/p snum= < tmp_work0
[/HIGH]Maybe, it will be usable for somebody.

This helped me a ton. I was seeing things like this:
[HIGH]Press any key to continue . . .
The process cannot access the file because it is being used by another process.
[/HIGH]

The first line ""%adb%" get-serialno > tmp_work" was locking the "tmp_work" file for some reason. Killing adb.exe in process explorer freed it up, but the script still dies first.

iav's fix fixes it for the next run, but then the new file "tmp_work0" is locked as well. I fixed mine by having the script kill & restart adb before each run. Technically that means the file may be locked after the script is over, but at least the script runs successfully.

Where it says "pause", add this beneath:
[HIGH]
...
echo # start the backup or [control-c] to quit:
echo #
pause

REM Restart adb.exe to make sure it's not locking the tmp_work file
"%adb%" kill-server
"%adb%" start-server

rem
rem get this device's serial number
rem
...
[/HIGH]
 
Upvote 0
This is backing up the External SD on the Note 10.1

How to make it backup the internal SD?

This is designed to back up both unless there are processes blocking it.

On a rooted device, it won't care and simply back up both.

If there are blocking processes then you'll want to try a drag and drop backup from your pc using the built-in access. Less convenient but it's the results that count.
 
Upvote 0
Just tried the windows script. But obviously it does not work on CM10.2. Although I have galaxy s4 with just one sdcard, the script reports that there are multiple sd-cards installed which of course is just not the case.

I think the problem is that the internal sdcard is present on various paths like /storage/emulated/0 and /storage/emulated/legacy and /storage/sdcard0, and the external card is at /storage/sdcard1.

Can anyone update this script to make it with with CM 10.2 which is based on android 4.3.1?

Thanks a lot
 
Upvote 0
Hi, I'm trying to figure out if this tool will be able to do what I want but after reading through everything I'm still not 100% sure.

I would like to back up my Bionic entirely, system, data, internal storage, external sdcard, etc. Will this tool be able to do what I'm hoping? I'm rooted and ROMed to a 4.4.4 based ROM if that matters.

EDIT: Also, sorry for bumping an old thread :/
 
Upvote 0
Hi, I'm trying to figure out if this tool will be able to do what I want but after reading through everything I'm still not 100% sure.

I would like to back up my Bionic entirely, system, data, internal storage, external sdcard, etc. Will this tool be able to do what I'm hoping? I'm rooted and ROMed to a 4.4.4 based ROM if that matters.

EDIT: Also, sorry for bumping an old thread :/

No worries about the bump my friend! :)

The issue here is that you're using a Motorola.

Don't get me wrong - I totally dig Motorola.

However - we use a standard debugging call to pull off the backup - and Motorola uses a standard trick to block that method on a lot of models.

We don't do /system or traditional /data - only user storage, meaning internal and/or sd card data or media storage.

Despite what I said about Motorola, the game opens up often for rooted users.

Nonetheless, you're wise to proceed with caution. :)

Sorry that I can't be more black and white but the truth is what the truth is. ;)
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones