Skip to content

Instantly share code, notes, and snippets.

@dllud
Created March 4, 2016 00:51
Show Gist options
  • Save dllud/ecc3cce06ee987931985 to your computer and use it in GitHub Desktop.
Save dllud/ecc3cce06ee987931985 to your computer and use it in GitHub Desktop.
How to backup an encrypted CyanogenMod Android

How to backup and restore an encrypted CyanogenMod Android

The easiest way to backup a CynogenMod (CM) based Android, such as Replicant, is to enter ClockworkMod Recovery (CWMR) and use the backup/restore feature. However that won't work in a device with Full Device Encryption (FDE) because the /data directory is encrypted and therefore unaccessible in CWMR.

Thus we'll have to use backup apps that work within CM, when /data is accessible. The following procedures can be used to backup and restore all your apps, data and settings, using only free software.

Backup

  1. Install oandbackup. Go to preferences > cryptography, enable encryption and set up your OpenPGP email. Back in preferences enable copy own apk and special backups.
  2. Use oandbackup to backup data+apk for all your user apps. Tip: use batch backup with sort and filter.
  3. Still within oanbackup, do a data only backup for all system apps except: Android System (android), Settings (com.android.settings), Settings Storage (com.android.providers.settings) and Wallpaper (wallpaper). These would break your new CM installation if imported into it.
  4. Move the backup files, usually located on /sdcard/oandbackups, to an external location, for instance your PC.
  5. Install Slight backup and use it to backup your system settings.
  6. Move the backup files, located on /sdcard/backup, to an external location. Slight backup does not encrypt backups. Make sure to store them safely.

Restore

  1. Copy oandbackups and backup directories into your sdcard.
  2. Install oandbackup, its apk should be inside oandbackups directory.
  3. Use oandbackup batch restore to restore all your backups.
  4. Install Slight backup and restore your system settings.
  5. Reboot your phone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment