[HOWTO] use Seedvault early to understand Android backup

Integration of Seedvault is an ongoing task and as of 0.18 not yet ready, see the epic Backup app settings (&31) · Epics · e · GitLab to the /e/ teams plans. It is present though on releases since 0.14 maybe.

The main advantage of using Seedvault now is quickly reinstalling packages on restore, as all apks are backed up, even if Apps opt-out to userdata backup. Some userdata is restored, see bottom section for limitations.

You’ll use the backup- and activity-manager to configure and start on-screen dialogs. If you use this, mind Seedvault is not yet supported.

# check if backup manager is enabled
adb shell bmgr enabled
# if not, enable
adb shell bmgr enable true
# list transports
adb shell bmgr list transports
    com.android.localtransport/.LocalTransport
    com.stevesoltys.seedvault.transport.ConfigurableBackupTransport
# choose the seedvault transport, after which the prior list command will prefix it with a *
adb shell bmgr transport com.stevesoltys.seedvault.transport.ConfigurableBackupTransport

#(whithout doing this you'd get a W BackupTransportManager: Transport com.google.android.gms/.backup.BackupTransportService not registered)

# set target backup store, set necessary values
adb shell am start-activity com.stevesoltys.seedvault/.settings.SettingsActivity

# note down the passphrase from seedvault or make a screenshot

# in the upper right in the menu is the option to "backup now"
# after completing, you'll be able to see which apps only have their apk backed up, and which userdata too

# restore: start dialog to do a restore (or from settings)
adb shell am start-activity com.stevesoltys.seedvault/.restore.RestoreActivity
#(same as adb shell am start -a com.stevesoltys.seedvault.RESTORE_BACKUP)

# wheres the backup? should be in case of sdcard. You can find the apks and all..
/storage/<id>/.SeedVaultAndroidBackup/

#(!) if you do the restore on a another target system you should register the seedvault transport there too
#After setup, the configured backup will run regularly.

As a regular tester of new development images, quick recovery from failure is welcome. Getting to know Seedvault is valuable to understand Androids backup system and its limitations - it’s not a binary solution

Android lets Apps define in their manifest if they allow to be backed up, which matching paths to consider, what type of backup it is (cloud-backup, device2device) what target and if it is encrypted. From my first look at it I created an issue mainly to document the current limitation and reference it later

My personal motivation is mainly backup of “accounts”, as these are cumbersome to re-enter. It’s not within Seedvaults capabilities yet and possibly needs cooperation from DAVx5 developers. From the ticket you should at least read this:

Creating a positive-list of settings that are backed up, including the default apps can set expectations.

15 Likes

I see from the developers’ link that GDrive is used. Is this absolutely necessary, or the link is intended for learning purposes only ?

it’s just implementation docs, per default no backup location is offered but the local transport. If you add a webdav /e/ Account it will be offered as backup location. You as a user can add any backup location as target that is compatible with Androids Storage Access Framework.

1 Like

I experimented with SeedVault in LOS builds a while ago, and I found that backup and restore to/from a NextCloud account (e.g. ecloud) can take a very long time. Much easier & quicker to backup to external SD card

2 Likes

This sounds quite helpful for people who want to upgrade from P to Q or Q to R - if both source and target version support seedvault well enough that at least these manual steps work :slight_smile:

When I tried seedvault with LOS it also worked perfectly fine with an USB OTG adapter and a normal USB flash drive. I find it quite reassuring to have the backup on a different physical device in case of loss/damage to the phone (I also had lots of SD card failures over a handful of years so my trust in them is limited :wink: ).

4 Likes

Indeed. Some people are planning to test that scenario on devices for which a test R build is available. If it does work, then there is a sensible path for Q → R data migration if a Q build is released with SeedVault enabled before - or at the same time as - the R build. It needs a new build for users, as they probably shouldn’t be asked to kick off SeedVault usind adb :slightly_smiling_face:

It also works - though very slowly - backing up to a NextCloud / e Cloud account

2 Likes

In general, reading the seedvault issues/pullrequests is educational, they contain discussion+concepts. Those on apk backup for example: #18 culminating in #64.

@petefoth nextcloud got a concerted effort last summer in their issues #95 and #96. Some nextcloud perf improvement from a calyx contributor. If you’d want them you need to backport as in #175. Seedvault is dependant on target api level (as long as the backup format is stable one can restore older backups in newer versions though). Not sure what version the /e/ Seedvault (prebuilt apk) is at, dumpsys says 1.0.0, but that was the version string for a long time.

1 Like

Is there a build for Samsung s9+ with seedvault available?
I only have local transport and it simply refuses to backup apps with the flag set to false :frowning:
Would be quite helpful to have a way to override it - would help me to move to newer phone…

Android 12 will start to ignore allowBackup for device2device backup. Not sure how cumbersome a backport is. I think the star2lte must’ve multiple builds available with hidden Seedvault in it?

I am using the official build and, unfortunately, that one seem to not include the SeedVault.
And I cannot seem to find a way how to update from stable to dev without loosing exactly the data I’d like to backup :slight_smile:

You have to wait for a e-0.18 to see the premises of seedvault on your device.
But e-0.18 need some fixes for now, it is not ready to be released as stable yet

Have you tried the steps outlined in the first post in this thread for configuring and starting SeedVault from adb? As far as I know, SeedVault has been present in all /e/ ROMs since around e0.14, but it is hidden in the normal setting UI.

1 Like

SeedVault is not enabled in the UI of e-0.18. It can still only be invoked via adb as outlined in the first post in this thread.

According to this post, e0-18 is becoming available

1 Like

My misunderstood, as i have seen some seedvault screens during the first boot setup process, asking for restoring a backedup system, and choosing from internal storage or from nextcloud, due to that is a serranolte Unofficial Test Build e-0.18-r from /e/ official sources
I don’t have any screenshots of that, but,




.

2021.08.27 seems ok, but 2021.08.13 was buggy
and some talk about version “0.18.2”

1 Like

I just installed official 0.18 for S9+ and I don’t seem to have SeedVault. The list of bmgr only shows local transport.
Am I doing something wrong, perhaps?

No,
it is because you use dev or stable build…

following seedvault development I see the backup format is getting a new revision for Android 12: k/v files will move into a sqlite db. This will result in less ops per entry on SAF ops and sync. Good for nextcloud sync speed, but will maybe be less efficient on traffic volume (whole sqlite db has to be transfered). But if it’s only a few megabytes in sensible backup time intervals, it’s a better tradeoff.

1 Like

SQLite databases generally compress very well.
If HTTP compression is used, it should not be a problem :slight_smile:

I’m using e/OS 0.19 and after enabling the backup manager with adb, listing the transports lead to the following result:

$ adb shell bmgr list transports
    android/com.android.internal.backup.LocalTransport

Is seedvault removed in version 0.19 or why isn’t it shown here?

I’ve checked if a restart leads to any difference, but it doesn’t.

Q or R? I still see the seedvault transport in 0.19 Q

1 Like