Ever wanted to backup your device without the hassle of flipping SD cards or USB sticks?
Maybe there is no TWRP recovery available for your device but you still want to make a backup?
Why not use the computer directly over your network?
![Wink]()
All you need is a rooted device, might work without root but I never tried.
I always disliked that TWRP does not include user data in a backup.
And at some stage I got sick and tired of botting into recovery and flipping SD cards, so I tried this:
Connect a USB cable to the box and use ADB to make a backup.
As you guessed it the box does not really support this
![Frown]()
No fastboot either
![Frown]()
Then I remembered that ADB works over the network too and to my surprise the box agreed to let me use it.
As said I only test on my X96 but the same should work on most if not all Amlogic boxes.
Please see this as a work in progress as I would like to encourage more people to use this way of making backups.
It could also be a very easy way to provide modded firmwares as there is no need for a custom recovery.
Simply create your firmware and then make a backup, if you want even with all userdate included - just make sure to remove account, network and other personal settings first
![Wink]()
I think you know hat I mean
But how exactly do we make use of this now?
Download the supplied archive and unpack to a folder on your PC - I named it tools so we have a reference here..
I have a fully working SDK, Java and all on my system but assume the tools should work as standalone versions too.
Start your box and check your IP in the network settings - you need it.
Open a command prompt with Admin rights in the Tools folder.
Now type
adb connect YOURIP where
YOURIP is the IP address of the box.
For example adb connect 192.168.1.9
The deamon will start and connect to your box, you can confirm by typing adb devices.
It will show the IP as a connected device.
Now, of course we could use some weird commands and type them into our command prompt...
I suggest to simply type
backup and press enter
![Wink]()
This will start the batch file that creates images of the following partitions:
Boot
Bootloader
Recovery
System
After this it will create a folder "sdcard" in the Tools folder and copy your userdata from the internal memory there.
The backup is complete now.
I inlcuded another batch file (backup_all) which tries to create images of all accessible partitions that I find on the OTA firmware.
Here the loop and mmcblk partitions are excluded as I assume there should be no real need for them.
With this you have full backup to restore a messed up device assuming the mount points and partitions were not changed by your modded rom.
The last (backup_all_full) includes all available partitions and some might not be fully accessible, so only try if you must and have enough space on your drive.
Again, not all partitions might work, try at your own discretion.
If you only want to backup and restore the userdate then please use the userbackup and restore files.
Restore:
I only included a restore.bat to write the following partitions:
Boot
Bootloader
Recovery
System
Plus the created userdata.
This will only work if the rom you tried out did not change vital parts of the system layout.
For example if the device tree blob, partition sizes, mount points were not changed from the original.
As long as you use roms designed for your device it will always get you back and running.
Of course you need to be able to get an IP connection through ADB - if that no longer works you have to flash the original firmware with the Amlogic tools.
The backup of the internal memory can laways be copied back to a working device.
What to expect from all this?
Nothing really! It is a simple creation with no additional checks, you could say "quick and dirty".
It should work for all X96 models that run the OTA firmware or one of my mods.
For other devices you might have to change the partition names in the batch files.
In my case they are found in /dev/block/, so a simple ls /dev/block from the ADB shell will give you these names.
IMHO the real benefit apart from having a complete backup directly on the computer is for people without a TWRP recovery.
Not only can you get all you need to port one but you can also modify your system by using the image files in a ROM kitchen (or do it manually).
If you like the idea then please check your system and try it out!
Upload or post your modifications to the batch files together with the device name and type so other can benefit too.
Let me know how it works!
Download the backup tools
here.