Using a Digital Ocean Droplet to backup Google Takeout to Backblaze B2
Google Takeout allows exporting all your Google data, but requires a modern browser, with GUI and JS. The total data can be huge (~36GB for my last export), so downloading it to my local machine and uploading it can be slow (even on a Gigabit connection). Instead, this approach uses a remote machine to perform the sync.
This was inspired by this post but I already had a Digital Ocean account, and find it a lot easier to use than AWS.
One Time Setup
Digital Ocean setup
The machine is set up with XFCE, X2Go (I tried xrdp and it was really slow), and rclone.
- Create a Droplet with 4-8GB of RAM so we can run a desktop and a browser. I just picked the default Ubuntu.
- Set up your SSH keys.
- SSH as
apt update && apt install rclone xubuntu-desktop x2godesktopsharing- this seems to also install Firefox.
usermod -aG sudo nikhil1
usermod -aG admin nikhil1
- Copy your SSH public key to
systemctl restart x2goserver
rclone config- Now follow the instructions to get B2 setup below. I call this remote just
Backblaze B2 bucket setup
- Use the B2 website to create a bucket for your Takeout data.
- Create an Application Key with read-write access to this bucket.
- Finish the
rclone configsetup above with the application key details.
- On your laptop/home computer install
x2goclient. On ChromeOS, this is
sudo apt install x2goclientin the Linux container.
- Launch x2goclient and create a new session config. The Host is your Digital Ocean droplet IP and the SSH key is the private key (lost several minutes because I accidentally put my public key here). Select XFCE as the desktop.
- You should now be able to connect using x2go and get a remote desktop.
Power off and snapshot the Droplet
We don’t want the droplet running except the couple of minutes it takes to back up. In addition, even powered off Droplets are still charged. Instead, it is cheaper to store as a snapshot and re-create a new Droplet from a snapshot. So power off the droplet. Then create a snapshot. Once the snapshot is ready, destroy the droplet. Digital Ocean estimates it will charge me $0.22 per month for the snapshot.
Every time you want to backup a Takeout
You can set Takeout to schedule backups at a frequency. It will then email you when the backups are ready to download.
- Create the Droplet from the snapshot (in the Images tab).
- If the IP has changed (very likely), edit the x2goclient config with the new IP.
- Connect to Remote Desktop.
- Log in to your Google Account via the remote desktop and download all Takeout files to a folder
- SSH into the droplet with the same user.
rclone -vP sync google-takeout/ b2:your-bucket-name. NOTE:
syncwill delete old files. This is the behavior I want since each Takeout contains all your data ever, so older Takeouts can be deleted. If you do not want this, use
rclone lsl b2:to verify the result.
lslshows sizes and timestamps. This recurses by default.2
- Destroy the droplet for security and to save money. This will ensure you are logged out of your Google Account and your Takeout files are not lying around on the Droplet.