Backing up Android with BitTorrent Sync and TitaniumBackup

With BitTorrent Sync being available on Android, this means you can simply and securely make a backup of your Android device to your home computer using Titanium Backup and BitTorrent Sync from anywhere. The beauty of this method is that there's no middleman you need to trust with your data as it's encrypted from end-to-end.

To follow this guide, you'll need to install Titanium Backup and BitTorrent Sync on your Android device and BitTorrent Sync on your computer.

Photo Backup

BitTorrent Sync makes photo backup a trivial process. Simply launch the BitTorrent Sync app and select the BACKUP tab. Tap the add folder button and select the DCIM folder from your sdcard. Make note of the secret key that is generated.

Now, from the BitTorrent Sync client on your computer, add a new sync folder using the secret key generated on your phone and a location for the backup on your computer. Once complete, your devices should connect and being transferring data.

Note that, by default, BitTorrent Sync will not backup over cellular data, but that can be changed in the settings if you have the data available to do so.

App Backup with Titanium Backup

Note that Titanium Backup requires root to run.

  1. Setup Scheduled Backups in Titanium Backup

    In order to keep an updated backup, you need to enable scheduled backups in Titanium Backup. There are two profiles that come pre-setup with Titanium; one that backups new apps, and one that checks for changed data in previously backed up apps. The defaults are reasonable, but I like to update them to run more frequently. I set the modified data check to run daily and the new app check twice a week (Wed and Sun).

    Check to enable both scheduled backups.

  2. Setup BitTorrent Sync on Your Phone

    Just like with photos, you'll want to add a new folder to the BACKUP tab in BitTorrent Sync. The directory you want to add can be found in the Overview tab of Titanium Backup. The entry you're looking for is "Backup directory". It should be something like "/storage/emulated/0/TitaniumBackup". Make note of the secret key generated on the phone.

  3. Setup BitTorrent Sync on Your Computer

    Again, from the BitTorrent Client on your PC, add a new folder using the secret key from your phone. The devices will connect and you're on your way to having a backup of all the apps on your Android phone.

Notes

  • In order to have a continual backup, your computer will need to be on all the time. If that's a problem, you might benefit from a Raspberry Pi + BitTorrent Sync setup.
  • By default BitTorrent Sync only backups over Wifi, this is probably what you want, but it can be changed if you have the data available on your cell plan.

Secure File Syncing

This is a follow up to my previous post Single Point of Failure, where I detailed my switch to self-hosted/distributed alternatives to various Google services so I wasn't completely reliant on one provider. At the time I didn't cover file syncing, since Dropbox was doing a fine job for me. However, for a couple of reasons, one being that the Dropbox Linux client is significantly slowing down my system, I've decided to move to a different tool. Conveniently, with the recent NSA Prism revelations, secure distributed alternatives to tools like Dropbox have been enjoying a lot of exposure, so it's been easy to find good alternatives.

The two tools that I'm now using are:

  1. Git Annex + Git Annex Assistant
  2. BitTorrent Sync

Both are really promising, but for different reasons.

Git Annex

Git Annex offers the ability to distribute files across many locations and uses Git to keep track of the location(s) any given file is available from. It also gives you the ability to recall a file from a remote location to your current device. This is really powerful for managing a large amount of data when you don't have room for it all on one machine.

The assistant functionality automates the syncing between repositories. It has a nice webapp which provides a GUI for managing remotes and sync strategies. These remotes can be additional git repositories, encrypted rsync destinations, local drives, EC2, and more. The assistant is still under active development, so it's not 100% stable or feature-complete, but it's definitely usable and the underlying functionality is pretty solid.

At the time of writing (July 20th) there's a crowd-funding campaign going on to support another year of full time development on git annex. If you want to support a good open source project, head ond over and contribute a few bucks (or bitcoins.)

BitTorrent Sync

BitTorrent Sync is the second tool I'm using for file syncing. It's much less complex then Git Annex. It's all about keeping folders in sync across multiple systems. The setup is pretty simple:

  1. Add a folder to the client and generate a unique secret key.
  2. From any other computer, choose a folder and give it the secret key.
  3. Let the computers auto-discover each other, or specify an address.

BitTorrent Sync has clients for all the major desktop operating systems and an Android app.

What to use?

For the time being, I'm going to use both. I'm trying out Git Annex as a central store for anything I care about. Using it, I can setup a backup with the encrypted rsync remote as well as directly sync when I need to my different computers on an as-needed basis. This allows me to track all my old projects and miscellany in a single place.

BitTorrent Sync is going to handle more transient syncing needs. This includes things like my workspace and desktop wallpaper collection since they're ever changing and could be rebuilt from scratch if really necessary.

Web Access

In addition to the two syncing services listed above, I also have ajaxplorer setup on a remote VM and pointed at a BitTorrent Sync folder setup on the VM. This allows me to make files available when I'm on the road, at work or don't have access to a trusted machine with the client installed.

Further Reading