How to backup your Google Pixel Phone locally

Last update: $Id: pixel-backup.md,v 1.2 2025/01/05 11:49:35 cvs Exp $

My last phone was a Samsung phone and I was used to the comfort of easy backups with their Smart Switch app. When switching to a Google Pixel phone I recognized there is no easy way to backup it unless you use the included cloud backup. Since I don't want to send all my data to Google (besides all the data they already have), the following article describes a "simple" way to backup a Google Pixel phone locally. Keep in mind that the process here does not offer the same comfort as a full backup and restore as with Smart Switch and other solutions!

You need the following:

Install adb

In case you are using Linux or BSD, install adb from your distribution's package repository. On Windows or macOS you can use the provided binaries.

Enable debug mode and USB Debugging

To backup your phone using adb you need to manually enable the debug mode on your phone. Go to Settings -> About Phone and tap so long on "Build number" that the debug mode gets enabled. Depending on your Android version you might have to confirm with your screen lock credential. Afterwards, enable "USB debugging" on your phone via Settings -> System -> Developer Options.

Screenshot of the developer options of the Pixel phone

Now start the command prompt of your choice, i.e. a Terminal emulator on BSD, Linux and macOS or the command prompt (cmd.exe) on Windows. Connect your phone via USB and use the following command to check that your phone is correctly recognized.

$ adb devices
List of devices attached
33XXXXXXXXXXXXXX  unauthorized

Here, the phone is listed as unauthorized, i.e. you have to manually verify the fingerprint on your phone. Once you did that, the phone is listed as device:

$ adb devices
List of devices attached
33XXXXXXXXXXXXXX  device

Start the backup

Start the backup with the following command from the terminal. You can freely choose the filename but I would recommend to keep the .ab extension. Note that this generates a full backup including all apps, settings, etc.

$ adb backup -f backup-pixel8-20250105.ab -shared -all -apk -obb -system

You can remove options to save backup time and storage space. I would recommend to keep -all and -shared.

$ adb backup -f backup-pixel8-20250105.ab -shared -all -apk -obb -system

In case you get the following error message and adb aborts, you have to confirm the USB debug connection on your phone.

adb: unable to connect for backup: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.

Otherwise, adb's output should look similar to the following:

WARNING: adb backup is deprecated and may be removed in a future release
Now unlock your device and confirm the backup operation...

Now check your phone and confirm the backup by pressing on Back up my data. Do not set an encryption password here since you need to convert the backup in a later step. You can easily encrypt your backup afterwards.

Screenshot of the Pixel phone to confirm the backup

As soon as that's done the backup starts. Be aware that the adb prompt doesn't change until the backup is completed! Depending on the amount of data you have on your phone the process might take only a few minutes or over an hour.

Convert Backup with Android Backup Extractor

Since the default archive format adb generates is not very useful to access certain files from the backup, you need to convert it. There is a free tool called Android Backup Extractor available you can use to convert the ab file to a so called tarball. This format can be read with tar(1) on a Unix (-like) systems including macOS and 7zip on Windows. You might need to install Java. Use it as follows and adjust the file names to match the ones you choose.

$ java -jar abe.jar unpack backup-pixel8-20250105.ab backup-pixel8-20250105.tar
0% ... 100%
20493770240 bytes written to backup-pixel8-20250105.tar.

It shows the progress bar in percent until the conversion is finished.

Disable Developer Options

For security reasons, you should disable the developer options in the settings afterwards.

How to restore the Backup

Fortunately, I never had to perform a full restore :) The above commands save the most important data so in case of a lost or broken device I could restore the most import data manually to the new phone.