How to save OS + data as Time Machine does for Mac?

Hi,

Is there a way to save all the OS + data like a Time Machine for Mac ?

I would like to hit a button to get an encrypted file from which I can restore later all the OS with it’s data, messages, photos and everything. I have the feeling copying/pasting isn’t enough, am I right ?
Thanks. :slight_smile:

1 Like

No and as far as I know, there is no app available in any android market which such a feature.

Doesn’t Titanium backup perform some of these functions?

Only on.apps and app data, not on OS

There is Magisk module called TWRP Helper that patches TWRP to force it to include user’s data into backup.

You can also use adb.

Boot intoo TWRP first before using these commands:

adb shell mount

find the dev name for data:

/dev/block/mmcblk0p28 on /cache type ext4 (rw,seclabel,relatime,data=ordered)
/dev/block/dm-0 on /data type ext4 (rw,seclabel,relatime,resgid=1065,data=ordered)
/dev/block/dm-0 on /sdcard type ext4 (rw,seclabel,relatime,resgid=1065,data=ordered)

Now use adb to pull all the RAW data:
adb pull /dev/block/dm-0 data.img

Your data is now stored in data.img.

To restore:
adb push data.img /dev/block/dm-0

1 Like

yes, but with time maschine you could restore only one file out of an old backup. I don’t think that there is really a way on android to do that

It’s a fine thing, but, uh…

  • Bugs and Shortcomings

  • Only the English language strings are patched to reflect the inclusion of Internal Storage in Data back-ups. If you use TWRP in a language other than English, your back-ups will still include Internal Storage , but the messages displayed by TWRP will be misleading.

  • For reasons that have yet to be ascertained, uninstallation of the module currently results in the reverse-patching of the TWRP image being attempted twice. The first attempt is successful and returns the image to its former state, but the log of this is then overwritten by a second, unsuccessful attempt. Bear this in mind when viewing the uninstallation log and trying to reconcile the messages here with the actual state of the device’s recovery partition.

2 Likes

In linux you can mount it since it’s ext4 format.
sudo mount -o loop data.img data
data is a folder which you can browse data after mount.

1 Like

as long as it isn’t encrypted :wink:

When you log in to TWRP its decrypted, so that’s also no issue.

Yes, that’s right, but when you transfer it to a secure place like PC, you have no access. you have first transfer it back to device

I just tested that, it’s not encrypted because adb pulls it. You log into TWRP, data is decrypted then adb pulls it, the resulting image is not encrypted.

Ah, ok, sounds good …

adb backup do not make the job ?

adb backup -apk -shared -all -f /home/$USER/backup_android.ab

adb restore /home/$USER/backup_android.ab
`

I did a lot of testing, but did not find any good reliable backup solution. The adb backup command will be depricated, and i did not got good results with the command. Did you test this?, result?

I use once before test an other ROM.
And i can restore it great!
I use ubuntu with android-tools from this distribution.

I tested to backup 1 app, did not work at all. Backup was made, but restore did not work. (tested on /e/ Pie).

With time maschine I’m able to restore one file out the backup.
When adb backup and restore is working, it’s always a full restore, not only one file. And that’s what the user is looking for.

what does that backup actually contain?
does it include also pictures, contacts, downloaded files? or do you need to backup that “manually”?
Does it work with all apps data? or are there some app that do not allow to backup their data that way (e.g. bank apps)?