This is more or less a howto to use nextcloud as a backup destination for your android smartphone.
- nextcloud server (can be at home or in a DC)
- android version with seedvault, I use LineageOS 18.1 (Android11) for my Xiaomi mi5 smartphone
- nextcloud client app installed on your smartphone and configure it with your nextcloud credentials.
- adb installed on your pc/laptop
If you have flashed a custom rom on your phone, you already have adb installed since you need that to flash the rom.
On your smartphone configure seedvault to use nextcloud as target:
Settings/System/advanced/backup. Since you already have the nextcloud app configured with your credentials, this is very straightforward. Nextcloud is available as a target, Click it and it is set. See this video:
When you configure seedvault, at a point you will see a 12 word passphrase. Note these and make sure to save them somewhere safe. It’s your only option to restore the data later. If you loose this passphrase, you will not be able to restore the backup!
Now do your backup by tapping the 3 dots on the top right corner and select ‘backup now’
When the backup is finished, you will see the backup in nextcloud as a hidden directory .SeedVaultAndroidBackup
Now the most important part: restore
Today I just did a factory reset to test the restore part. This has a few quirks but in the end I am quite pleased with the result.
When you do a factory reset, at some point you are prompted to do a restore. BUT… since you have backupped to nextcloud, and the phone doesn’t have a configured nextcloud client yet, this is like a catch22.
Luckily there is a way around this.
- do the initial setup of Android, without restoring the backup.
- Install f-droid, nextcloud client and configure nextcloud client with your nextcloud account.
- configure seedvault. When the 12 word passphrase shows accept it. Then in the confirmscreen make sure to change the passphrase to the passphrase you used with the backup!
- activate the developer options: go to settings/about this phone. scroll down and tap ‘Build number’ 7 times.
- go back to settings. Go to System/Advanced/Developersoptions/Enable USB Debugging
- Connect your phone to your pc using an USB cable
- on your phone allow the pc to connect to your phone
- open a terminal
- start the restore procedure with this adb command :
adb shell am start-activity -a com.stevesoltys.seedvault.RESTORE_BACKUP
Now the quirks (besides the way around direct restore during Android setup). There are quite some aps that don’t allow for backup. The configuration of those apps will not be restored. For example: I use k9 mail as mail IMAP client. The app doesn’t allow backup. So I had to reconfigure it manually after it was restored.