Announcement

Collapse
No announcement yet.

How to do a FAST backup and recovery

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to do a FAST backup and recovery

    OK Titanium backup is cool and all but what I did not like was doing a restore when you have 100 apps installed. You have to one by one install them be responding to the install dialogs. Royal pain!

    So I was looking for a faster way to restore apps. I found I could do it FAST with ADB.
    Of course you have to be fully rooted to do this. You also need ADB and the ADB drivers installed. Later I will do a tutorial for how to get ADB without installing the entire SDK. You only need about 7 files in a folder! Also a tutorial on how to install the ADB drivers. YES they ARE a pain to get installed on some systems.



    So my final process which works and is fast. Again you need ADB and Titanium backup.
    To backup:
    1) Install titanium backup and do a BATCH backup all user app + system data
    2) This will back up all apps to adb_appsback folder on your sdcard.
    3) Connect USB and use ADB and type the following.
    adb start-server
    adb shell
    # su
    # busybox cp -r data/app/* /sdcard/adb_appsback

    OK Thats it. You not only have a backup with titanium that you can use without ADB and you also have all the apps backed up ready for a fast restore with ADB. NOTE: This ADB command does not backup apps that use the SDCard e.g. are installed or partially installed on SDcard. For instance some large games like FLComando.

    OK some might be asking.... Well why not also back up the App data with ADB? Well you can do that with this:
    busybox cp -r data/data/* /sdcard/adb_databack
    However when I restored the data using
    busybox cp -r udisk/adb_databack/* /data/data
    On reboot I got all kinds of force close on system apps. It seems some things like the framework, etc do NOT like to be restored in this way! So this is why I use Titanium backup to resotre the app data. It's smarter and handles things properly.


    OK so to do a restore.
    You can use titanium backup the slow way as always or you can do this procedure which will have you restored in NO TIME! You would do this right after a ROM flash for instance.
    1) Plug in USB cable and do the following in ADB
    adb start-server....
    adb shell
    # su
    # busybox install sdcard/adb_appsback/* /data/app

    OK all apps are back on the tablet super fast. Now we need to restore the app and system data. Titaniium back up does this best.
    1) Launch titanium backup
    2) Select BATCH Restore all apps + data
    3) At the top of this restore screen click "Data only". This is important as we already put back all the apps and we just need the data.
    4) Now click run the batch operation.
    It will restore all data and you wont have to press yes to every install prompt it will just run.

    You should reboot after this restore!

    Finally as I said some apps that are on SDcard may not be back.. Just go into titanium backup and do the BATCH Restore missing apps + data. Yes on this one you will have to answer all the install prompts but it should only be a few apps that are like this.

    MUCH faster than just using titanium backup.

    Well thats how I found how to do it on a tablet that does not have nandroid, etc on it.
    If you know a better way let me know but this does work well for me.

    Bob
    "Pzebacz im, bo nie wiedzą, co czynią"
    "Прости им, они не ведают, что творят"
    "Perdona loro perché non sanno quello che fanno"
    "Vergib ihnen, denn sie wissen nicht, was sie tun"
    "Vergeef hen want ze weten niet wat ze doen"
    "Pardonne-leur car ils ne savent pas ce qu'ils font"
    "Perdónalos porque no saben que lo que hacen"
    "Oprosti im, jer ne znaju što čine"
    "Forgive them as they know not what they do"






    #2
    Very interesting Bob, thank you for sharing this tip. My son has TONS of games on my Arnova and this might be the answer to help speed things up every time I reflash. Thank you.

    Comment


      #3
      FYI I would like to add.... Even if you do not have the ADB drivers installed on your PC you can actually use this SAME PROCESS by installing a terminal emulator (free from the Market) and doing this right from the Tablet!!!!

      Remember we are using busybox to backup and restore which busybox is built in the Tablet!

      So you can backup FAST to your SDCard within a terminal emulator by:
      1) Install the Terminal Emulator free from the Market.
      2) Using a file explorer make a folder on your SDCard. In this example I use adb_backup as my folder name
      3) Run the Terminal Emulator app and at the prompt type SU. You will get a prompt from Superuser asking for permission. Click yes of course.
      4) At the terminal # line type: busybox cp -r data/app/* /sdcard/adb_backup
      This will backup all apps to your SDCard in the folder called adb_backup


      Now to restore after a ROm flash:
      1) After you flash a ROM, install a Terminal Emulator free from the Market.
      2) Run it and at the prompt type SU. You will get a prompt from Superuser asking for permission. Click yes of course.
      3) At the # line type: busybox install sdcard/adb_backup/* /data/app
      4) Once this is done REBOOT! (you can use the pin hole or reset button whichever you have).
      5) Now on reboot, run Titanium backup and restore all apps with data but as I explained in the first post make the setting "data only".

      Within minutes you are restored!

      Bob
      "Pzebacz im, bo nie wiedzą, co czynią"
      "Прости им, они не ведают, что творят"
      "Perdona loro perché non sanno quello che fanno"
      "Vergib ihnen, denn sie wissen nicht, was sie tun"
      "Vergeef hen want ze weten niet wat ze doen"
      "Pardonne-leur car ils ne savent pas ce qu'ils font"
      "Perdónalos porque no saben que lo que hacen"
      "Oprosti im, jer ne znaju što čine"
      "Forgive them as they know not what they do"





      Comment


        #4
        sdcard usually have fat32 filesystem, so you will lose all permissions and file owners. Use tar instead of simple copy.

        Comment


          #5
          Sorry to burst any bubbles here but I have done this exact proceedure probably 20 times and while the permissions thing maybe true, I have had no issues what so ever!

          Bob
          "Pzebacz im, bo nie wiedzą, co czynią"
          "Прости им, они не ведают, что творят"
          "Perdona loro perché non sanno quello che fanno"
          "Vergib ihnen, denn sie wissen nicht, was sie tun"
          "Vergeef hen want ze weten niet wat ze doen"
          "Pardonne-leur car ils ne savent pas ce qu'ils font"
          "Perdónalos porque no saben que lo que hacen"
          "Oprosti im, jer ne znaju što čine"
          "Forgive them as they know not what they do"





          Comment


            #6
            Here is the sample:
            # ls -l /data/data/com.android.wallpaper
            ls -l /data/data/com.android.wallpaper
            drwxrwx--x app_36 app_36 2012-02-16 20:56 shared_prefs
            drwxr-xr-x system system 2011-03-11 21:01 lib
            # busybox cp -r /data/data/com.android.wallpaper /sdcard
            busybox cp -r /data/data/com.android.wallpaper /sdcard
            # ls -l /sdcard/com.android.wallpaper
            ls -l /sdcard/com.android.wallpaper
            drwxrwxr-x system sdcard_rw 2012-02-18 09:08 shared_prefs
            drwxrwxr-x system sdcard_rw 2012-02-18 09:08 lib

            As you can see, permissions changed from 771 and 755 to 775, as well as owners changed to system:sdcard_rw. After restore you will require to fix ownership, or get nonchangeable preferences.

            And tar:
            # busybox tar -czf /sdcard/backup180211.tar.gz /data/data/com.android.wallpaper/*
            busybox tar -czf /sdcard/backup180211.tar.gz /data/data/com.android.wallpaper/*
            tar: removing leading '/' from member names

            I will extract to /data/local/tmp:
            # busybox tar -xzf /sdcard/backup180211.tar.gz -C /data/local/tmp
            busybox tar -xzf /sdcard/backup180211.tar.gz -C /data/local/tmp
            # ls -l /data/local/tmp/data/data/com.android.wallpaper
            ls -l /data/local/tmp/data/data/com.android.wallpaper
            drwxrwx--x app_36 app_36 2012-02-18 09:15 shared_prefs
            drwxr-xr-x system system 2011-03-11 21:01 lib

            So just not forget to cd / before restore

            Comment


              #7
              Thanks for the code snippet. Tar is the linux users friend for sure, ranks right up there with rsync.

              Comment


                #8
                ADB in 7 files without all SDK

                Bob, I'm interested in your lean suggestion -- when you get a spare moment.
                I found this link; is this what you mean?
                http://forum.xda-developers.com/show...74&postcount=2

                Thanks,

                Originally posted by Finless View Post
                So I was looking for a faster way to restore apps. I found I could do it FAST with ADB.
                Of course you have to be fully rooted to do this. You also need ADB and the ADB drivers installed. Later I will do a tutorial for how to get ADB without installing the entire SDK. You only need about 7 files in a folder! Also a tutorial on how to install the ADB drivers. YES they ARE a pain to get installed on some systems.
                Bob
                Last edited by jrm; 03-30-2012, 08:21.
                Rob / jrm
                _________________
                N7P rooted w/ Finless #1011V1.5 (was V1.4)

                Comment


                  #9
                  Originally posted by Finless View Post
                  You also need ADB and the ADB drivers installed. Later I will do a tutorial for how to get ADB without installing the entire SDK. You only need about 7 files in a folder! Also a tutorial on how to install the ADB drivers. YES they ARE a pain to get installed on some systems.
                  Hi, Bob.
                  I need Your tutorial.
                  Your prompt reply will be highly appreciated.
                  Arnova 10 G2 & finless' 2.2b PRO

                  Comment


                    #10
                    Don't mean to drop in and mess things up, but why not just spend the 4$ on titanium pro? Im not one for paying when you don't have to, but this one is worth it, if only for the 0 click restore feature.

                    Tapatalk_NB7_Finless 1.5 ROM

                    Comment


                      #11
                      Originally posted by swlaraut View Post
                      Don't mean to drop in and mess things up, but why not just spend the 4$ on titanium pro? Im not one for paying when you don't have to, but this one is worth it, if only for the 0 click restore feature.

                      Tapatalk_NB7_Finless 1.5 ROM
                      I paid for TB Pro. It's not a function of being cheap. It's that Titanium restores aren't bullet proof and can, in some circumstances, really mess things up, especially if you are moving between Android versions, i.e. Gingerbread to Ice Cream Sandwich. The adb method described above, or the terminal method, can minimize these problems.

                      Dumped down the innertubes from my Arnova 10 G2.
                      Asus Transformer TF300T - ROOTED, with TWRP recovery and stock Jellybean
                      HTC Rezound - ROOTED with S-OFF, running stock ICS
                      Android obsessed since April 29, 2010

                      Comment


                        #12
                        Hi folks

                        Thanks to everyone who have taken time and gone out of their way to support our budget tablets, im a new G2 owner and currently using the near perfect finless 1.5 rom, thanks for making our tabs the best they can be, it is very much appreciated from this side of the world

                        Quick question about this restoration and backup method, and i hope im not out of line posting here, what im sure is a very nobby question, i hope im not hijacking a thread here or posting in the wrong section

                        If not,

                        If im understanding the method of this particular restore method, and assuming, for compatibility reasons, that this method is the best way to restore apps after a rom change

                        my question is,

                        1-could i not simply, use a root capable file explorer to move the contents of the app folder into the user made adb_backup folder rather then using adb, for semi noobs like me, who, ill be honest, would rather use a one click method?especially if we are testing many roms, in a short space of time

                        If so, does this mess up the permissions and would this need to be mended after the fact?
                        As Bob has mentioned, does that even matter?

                        2- Another question, is there a method in the android linux adb world to make a sort of batch file you might find on windows, where you type the commands in a text program, save em, and when ever you need to use this method, you simply

                        -one click backup apps
                        -flash a new rom
                        -one click restore apps
                        -and then manually titanium restore DATA

                        If so, would this not be a very handy tool for someone to create? Would it be possible to create a apk installer for this

                        3-One final question, and sorry, i only meant to ask the one originally, but this ones been bugging me for a bit, and ive not found a definitive answer to it yet, but, is there a CWM method for our G2 tablets, 9 G2 in particular, to do a nand backup?
                        Having that option, would make life so much easier for testing out new roms

                        Edit - Found my answers more or less, so not to worry

                        Thanks again to everyones effort and time to support our tabs and again sorry for my noobish questions.
                        Last edited by banderos; 05-10-2012, 10:08. Reason: Searched

                        Comment


                          #13
                          I know a lot of people have been able to make this work... but I can't.

                          When I type:
                          # busybox cp -r data/app/* /sdcard/adb_appsback

                          I get error saying :
                          cp: can't create '/sdcard/adb_appsback/.....'

                          It seems that the cp command is not able to create new sub-directories in /sdcard

                          How did you guys get this to work


                          Originally posted by Finless View Post
                          OK Titanium backup is cool and all but what I did not like was doing a restore when you have 100 apps installed. You have to one by one install them be responding to the install dialogs. Royal pain!

                          So I was looking for a faster way to restore apps. I found I could do it FAST with ADB.
                          Of course you have to be fully rooted to do this. You also need ADB and the ADB drivers installed. Later I will do a tutorial for how to get ADB without installing the entire SDK. You only need about 7 files in a folder! Also a tutorial on how to install the ADB drivers. YES they ARE a pain to get installed on some systems.



                          So my final process which works and is fast. Again you need ADB and Titanium backup.
                          To backup:
                          1) Install titanium backup and do a BATCH backup all user app + system data
                          2) This will back up all apps to adb_appsback folder on your sdcard.
                          3) Connect USB and use ADB and type the following.
                          adb start-server
                          adb shell
                          # su
                          # busybox cp -r data/app/* /sdcard/adb_appsback

                          OK Thats it. You not only have a backup with titanium that you can use without ADB and you also have all the apps backed up ready for a fast restore with ADB. NOTE: This ADB command does not backup apps that use the SDCard e.g. are installed or partially installed on SDcard. For instance some large games like FLComando.

                          OK some might be asking.... Well why not also back up the App data with ADB? Well you can do that with this:
                          busybox cp -r data/data/* /sdcard/adb_databack
                          However when I restored the data using
                          busybox cp -r udisk/adb_databack/* /data/data
                          On reboot I got all kinds of force close on system apps. It seems some things like the framework, etc do NOT like to be restored in this way! So this is why I use Titanium backup to resotre the app data. It's smarter and handles things properly.


                          OK so to do a restore.
                          You can use titanium backup the slow way as always or you can do this procedure which will have you restored in NO TIME! You would do this right after a ROM flash for instance.
                          1) Plug in USB cable and do the following in ADB
                          adb start-server....
                          adb shell
                          # su
                          # busybox install sdcard/adb_appsback/* /data/app

                          OK all apps are back on the tablet super fast. Now we need to restore the app and system data. Titaniium back up does this best.
                          1) Launch titanium backup
                          2) Select BATCH Restore all apps + data
                          3) At the top of this restore screen click "Data only". This is important as we already put back all the apps and we just need the data.
                          4) Now click run the batch operation.
                          It will restore all data and you wont have to press yes to every install prompt it will just run.

                          You should reboot after this restore!

                          Finally as I said some apps that are on SDcard may not be back.. Just go into titanium backup and do the BATCH Restore missing apps + data. Yes on this one you will have to answer all the install prompts but it should only be a few apps that are like this.

                          MUCH faster than just using titanium backup.

                          Well thats how I found how to do it on a tablet that does not have nandroid, etc on it.
                          If you know a better way let me know but this does work well for me.

                          Bob

                          Comment


                            #14
                            Originally posted by balle View Post
                            I know a lot of people have been able to make this work... but I can't.

                            When I type:
                            # busybox cp -r data/app/* /sdcard/adb_appsback

                            I get error saying :
                            cp: can't create '/sdcard/adb_appsback/.....'

                            It seems that the cp command is not able to create new sub-directories in /sdcard

                            How did you guys get this to work
                            Create the directory *first* with an app explorer, THEN run the commands in terminal mode.
                            Asus Transformer TF300T - ROOTED, with TWRP recovery and stock Jellybean
                            HTC Rezound - ROOTED with S-OFF, running stock ICS
                            Android obsessed since April 29, 2010

                            Comment

                            Working...
                            X