Changing between services which hold a lot of your data, like email providers or file/photo syncing services, can be a pain. Thankfully, in response to the EU's data portability regulations under the GDPR (General Data Protection Regulation), many services now allow you to export all or part of the data they hold on you. This ruling brought easier ways to get exports of otherwise difficult to access data, such as being able to dump all your saved photos from a Facebook Messenger conversation, or downloading all your saved files and photos from a platform like Google Drive or Google Photos.
Google offers this option for Photos (among its other services) via takeout.google.com, where you can select some or all of the data the company holds on your account and export it as a series of .zip dumps. We've already covered how to export all your photos from Google Drive before on XDA, but unfortunately, Google makes this a slightly harder process than necessary by storing your photos' metadata separately from each photo.
We'll show you how to export all your photo data via Google Takeout, and keep hold of their associated metadata while you're at it.
Google Photos app gets a new set of AI features for a more organized experience
Google Photos on Android and iOS get another set of AI features to help you find your photos easily and organize your galleries.
How to export your data from Google Photos
Before getting into anything too complicated, we'll cover how to export your data from Google Photos. Follow the steps below to download your data.
- Navigate to takeout.google.com and login with your Google account.
- Once logged in, you should see a screen as shown below. The number of services available may depend on what Google services you've used in the past.
- Start by deselecting all services using the Deselect all checkbox
- Scroll down to Google Photos on the Takeout list and tick the box. By default, this will select all your photo albums. By clicking All photo albums included, you have the option to limit your export to specific years or Albums in your account.
- Scroll to the bottom of the page and press Next Step.
-
You'll be asked how you want to receive a link for your file. We suggest leaving the defaults here, so that it will send a link to your account email to download things once prepared, and save the files as .zip files. You'll also be asked what size your .zip files should be - we'd suggest leaving this at the default of 2GB.
A smaller file size means more unique .zip's to export, but may help reduce problems recombining your metadata later on - hence we'd suggest the default unless you're exporting hundreds of GBs, then raise it to 5GB.
- Once you've chosen your options, hit Create export. Once your export is complete, Google will email you a link that escorts you back to takeout.google.com to download your files.
- Download and extract your .zip files. We'd suggest you keep them separately inside a folder for now - i.e. don't combine the extracted folders yet. Don't delete your original .zips either - you'll want to keep these in case something goes wrong.
How to combine your exported photos and metadata
Taking a look at your exported and extracted .zip files, you might notice some things. Firstly, all the photos are lacking metadata. Secondly, each JPEG file has an accompanying .json file, which, if you inspect it, you'll find it contains the metadata for that file. This is a quirk of how Google's data export works, and can be a pain if you're trying to move to a new platform or service. If you were to re-upload all those files directly, you'd lose the date and time, camera, location, and other important data associated with the photos.
Thankfully, we can fix this with a little bit of Python. Follow the steps below to recombine your metadata and photos.
-
To recombine your photos and metadata, we'll be using a tool called GPTH (Google Photos Takeout Helper). It's FOSS and available as both a source and binary on Github. We've chosen this since it has good support across macOS, Linux, and Windows.
Source: Github - Browse to GPTH's Releases page for the latest version. At the time of writing, this was v3.4.3. You can find the Releases section in the right-hand sidebar of Github.
- Download the binary for your platform. In my case, this is for macOS. Place this in the same directory as the extracted folder you downloaded from Google Takeout earlier.
-
Open a command prompt and browse to the directory where your folders and downloaded binary is stored. If you're on macOS or Linux, you'll need to grant executable permission using the command below.
sudo chmod +x gpth-macos
There are some extra steps for macOS. You'll also need to enable Rosetta emulation if you're on an Apple Silicon Mac, and tell Gatekeeper to ignore the file. Do this with the following two commands:softwareupdate --install-rosetta
Followed by:xattr -r -d com.apple.quarantine gpth-macos
How I built a Google Photos alternative on my NAS with PhotoPrism
If you have a NAS, combining PhotoPrism with Nextcloud can make for a great Google Photos alternative.
-
On Windows, simply double-click the downloaded .exe file to run it. On macOS and Linux, you can run it from the terminal using:
./gpth-macos
or./gpth-linux
- Follow the prompted instructions to select a target 'Takeout' folder and a target output folder. The script will run through each library in the folder, keeping them separate while merging the metadata and original photos into a single file. You'll also be asked if you want to combine your finished photos into one large folder, or into year/month folders - this one's personal preference.
- You'll also be asked how you want to handle albums. We'd recommend using the default option here, but if you encounter issues importing your files or transferring them to another device, re-run this process and select duplicate-copy. This will take up more disk space (double what the original photo download required), but is ultimately the least likely to fail.
- Once the script has run, navigate to your target folder. You should see combined files with all your metadata intact, safe to import into another photo management service of your choice.
Exporting Google photos can be tedious
Getting your photos out of Google Photos can be a bit of a headache, especially if you're planning on migrating directly to another service (or even to a self-hosted service on your NAS). We'd recommend keeping your file sizes and script runs small, between 2GB and 5GB, in order to minimize the chance of crashes, disk space, or memory issues which could interrupt the process. Keeping your files separate can also make them far easier to upload again later to another service in small blocks, especially if your internet speed isn't blazing fast.
