Skip to content
Proyek

ogamaniuk/google-photos-backup

Lihat di GitHub

Tentang

Back up your whole Google Photos library (original files) to storage you own: your AWS S3 bucket or Azure container. Browser extension, bring your own keys, nothing in between.

Desain dan media

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
Mengumpulkan riwayat
dalam 15 hari
Mengumpulkan riwayat
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

Photos Backup for Google Photos

A Chrome and Edge extension that copies your whole Google Photos library, as original files, to storage you own: your own Amazon S3 bucket, your own Azure Blob container, your own Cloudflare R2 bucket, or a folder on your PC.

You bring your own keys. Files go straight from your browser to your bucket. There is no server of ours in between, and no analytics.

Why: in late November 2026 there were news reports of people locked out of their Google accounts, losing Gmail and Photos overnight. If your only copy of twenty years of photos sits in one account, one lockout is enough to lose it. This makes a second copy somewhere you control.

Dashboard while a backup runs

Contents

What it does

  • Copies every photo and video as the original file, not a re-encoded copy.
  • Saves to AWS S3, Azure Blob Storage, Cloudflare R2, or a folder on this PC (through a small local program; a developer option for now).
  • Storage class picker for each cloud destination, from Standard down to Glacier Deep Archive or Azure Archive, with the monthly cost for your library shown before you start. See Storage classes and archive.
  • Resumes. Progress is kept in the browser. Close the tab or the browser, come back, press Resume, and it continues where it stopped.
  • Skips what is already there. On every Start and Resume it lists your bucket and skips files it already holds, even from a fresh browser.
  • Speed presets: Gentle (1 at a time, at most 1,500 items an hour), Normal (3 in parallel) and Fast (6 in parallel), or your own mix of parallel downloads, pause between items and maximum per hour.
  • Include or leave out videos.
  • Shows live speed, time left and an expected finish time.
  • By date tab: a year by month grid that shows how much of each month is backed up.
  • Activity list: one line per saved file. Click it to open the file in the AWS console or show it in its folder on your PC.
  • Stops by itself, and says why, when uploads keep failing, when your storage refuses the keys, when Google signs you out, or when the local disk is nearly full.
  • One Google account per backup. It refuses to mix two libraries.

Files are saved as:

<folder>/<YYYY-MM>/<id>_<original file name>
google-photos/2024-07/Wifblv73NI_PXL_20240714_181502.jpg

<folder> is google-photos/ unless you change it. <YYYY-MM> is the month the photo was taken (UTC). <id> is the last 10 characters of Google's ID for the item, so two files called IMG_0001.JPG never overwrite each other.

By date view

Install

It is not in the Chrome Web Store and won't be. Install it from the release zip (about a minute):

  1. Download photos-backup-extension-<version>.zip from Releases.
  2. Unzip it into a folder you will keep (for example Documents\photos-backup-extension). The browser loads the extension from that folder, so do not delete it.
  3. Open chrome://extensions (Chrome) or edge://extensions (Edge).
  4. Turn on Developer mode (top right in Chrome, left sidebar in Edge).
  5. Click Load unpacked and pick the unzipped folder (the one with manifest.json in it).
  6. Pin the extension and click its icon. The dashboard opens in a tab.

Extensions loaded this way do not update themselves. To update, unzip the new version over the old folder and click the reload icon on the extensions page. Your progress and settings are kept.

Quick start

  1. Sign in to photos.google.com in the same browser. The account shown at the top right of the dashboard is the one that will be backed up.
  2. Choose where to back up. Under Back up to, paste or drop your key into the box: an Azure Blob SAS URL, the access-key .csv file AWS lets you download, or the Cloudflare R2 token page (then type your bucket name). The fields fill in and the connection is tested. You can also pick AWS S3, Azure or R2, fill the fields by hand and press Test connection. No storage yet? See Setting up storage.
  3. Press Start backup. It estimates the library size, scans the library (about 2 minutes per 50,000 items), then copies newest first. Keep the tab open; it can be in the background.

Setting up a destination

Setting up storage

You need storage of your own and a key that can reach only that storage. Each guide takes about 5 minutes and matches the steps shown inside the extension.

  • AWS S3 setup: a bucket, a user with a policy for that one bucket (the extension shows the policy with your bucket name filled in), and an access key. The region is found automatically.

  • Azure Blob setup: a storage account, a private container, and a container SAS URL. Or press Deploy to Azure and let a template create all three:

    Deploy to Azure

  • Cloudflare R2 setup: a bucket and an R2 API token limited to that bucket. Paste the token page into the extension, then type the bucket name.

Test connection writes one small file, <folder>/.photos-backup-test.txt, and lists the folder. It must pass before you start.

Other S3-compatible services (Backblaze B2, MinIO) are not supported yet.

Storage classes and archive

Under the destination fields there is a Storage class (AWS, R2) or Access tier (Azure) picker. A line under it shows what your scanned library would cost a month in that class, how files come back, and the minimum number of days each file is billed for. Archive classes get an amber warning.

Approximate list prices per TB a month (AWS us-east-1, Azure East US with LRS redundancy, Cloudflare R2). Prices change; check the provider's pricing page.

Provider Class $/TB a month Min. days Getting files back
AWS S3 Standard (default) 23 none Right away
AWS S3 Standard-IA 12.50 30 Right away, fee per GB read
AWS S3 Glacier Instant Retrieval 4 90 Right away, fee per GB read
AWS S3 Glacier Flexible Retrieval 3.60 90 Restore first: minutes to 12 hours
AWS S3 Glacier Deep Archive 0.99 180 Restore first: 12 to 48 hours
Azure Hot about 18 none Right away
Azure Cool about 10 30 Right away, fee per GB read
Azure Cold about 4.50 90 Right away, fee per GB read
Azure Archive about 1 180 Rehydrate first: up to 15 hours (under 1 hour at high priority)
R2 Standard (default) 15 none Right away, no download fees, first 10 GB a month free
R2 Infrequent Access 10 30 Right away, $0.01 per GB read

Storage class picker with the cost for the scanned library

For a just-in-case copy, Glacier Deep Archive or Azure Archive is the cheapest, but files take hours to restore. For the 340 GB example library that is about $0.34 a month in Deep Archive, against about $7.80 in S3 Standard.

Good to know:

  • Azure's default is Account default: whatever the storage account is set to. The Deploy to Azure template sets Cool.
  • AWS also charges per upload, and archive classes charge more: per 1,000 files, $0.005 in Standard up to $0.05 in Deep Archive. For 52,000 files that is about $0.26 or $2.60, once.
  • A file deleted or moved to another class before its minimum days is still billed for the rest of them.
  • Azure Archive works only on storage accounts with LRS, GRS or RA-GRS redundancy. Test connection checks the account and says so.
  • Changing the class only affects files uploaded afterwards. Files already copied keep their class, and progress is not reset.
  • Resume and "already backed up" work with every class, because listing works on archived files too.
  • The connection-test file is always written as Standard (AWS, R2) or Hot (Azure), so testing again never pays an archive minimum.

How to get archived files back is in the AWS and Azure setup guides.

How it works

  1. Listing. The extension asks Google Photos for your library the same way the photos.google.com web app does, using your signed-in session. It gets metadata only: an ID, a download link, the date taken, and whether each item is a photo or a video. Nothing is downloaded at this stage.
  2. Downloading. For each item it downloads the original: photos with the =s0-d-I form of the photo link, videos with the =dv link. (The better-known =d link returns a smaller, re-encoded JPEG, not the original.)
  3. Uploading. Each file goes straight from your browser to your bucket, signed with your keys (AWS Signature Version 4 for AWS and R2, or an Azure SAS URL).
  4. Tracking. Each item's status is saved in the browser (IndexedDB), so a closed tab loses nothing. Your bucket is the final word: on every Start and Resume the extension lists it and marks what is already there as done.

Google's download links only work with your Google session cookies. Without them Google returns a sign-in page. That is why the copying has to happen in your browser and cannot be handed to a server.

The honest part: internal endpoints

Google closed full-library access in its Photos Library API in March 2025. Apps can no longer read your whole library through an official API. This extension therefore uses the internal endpoints of the Google Photos web app, the same requests your browser makes when you scroll through photos.google.com.

What that means for you:

  • It can break without warning when Google changes its web app. If listing or downloads stop working, check Issues and update when a fix is out. Your existing backup is not affected.
  • It only reads. It never changes or deletes anything in your Google account.
  • It is not an official Google product, and Google does not support it.

Privacy and security

  • No server of ours. The extension talks only to Google Photos (to read your library) and to the storage you configure (to write it). There is no backend, no account with us, no analytics, no crash reporting.
  • Keys stay in your browser. Your AWS or R2 keys or Azure SAS URL are stored in the extension's local storage in your browser profile and are sent only to AWS, Azure or Cloudflare R2. They are not encrypted at rest, so anyone who can use your browser profile can read them.
  • Use a key that can reach only one bucket or container. The setup guides show how, and how to revoke the key when you are done.
  • Your Google account email is read from the Google Photos page only to label the backup and to refuse mixing accounts. It stays in the browser.

Full details: PRIVACY.md and SECURITY.md.

Speed

Measured on a real library of 51,799 items (2004 to 2026), Chrome on Windows, a home internet connection:

Step Result
Estimate library size before scanning about 3 s, within about 5%
List the whole library (metadata only) 119 s, about 437 items/s
Copy with 3 parallel downloads (Normal) about 8.8 MB/s, 3.6 photos/s
Where the time goes about 98% is the download from Google
Whole library about 340 GB, roughly 11 hours

Your speed depends mostly on your download speed from Google. Gentle is capped at 1,500 items an hour, so a library of about 52,000 items takes at least 35 hours on Gentle.

Originals check: spot checks of photos were byte-for-byte the size Google records for the original. Videos matched Google's recorded sizes exactly.

Limits

  • Very large files (over about 2 GB) may fail. They are listed under Failed and the rest of the backup continues.
  • Edits are not re-copied. If you edit a photo in Google Photos after it was backed up, the backup keeps the version it copied.
  • Deletions are never copied. Deleting something in Google Photos never deletes it from your backup.
  • Live Photos: the still image is backed up, not the motion part (yet).
  • Not exported yet: albums, captions, favorites, and other Google Photos metadata. The date taken is in the folder name and, for most photos, in the file's own EXIF data.
  • New photos are not picked up automatically. Press Rescan library, then Resume, from time to time.
  • One Google account per backup. To back up a second account, use a second browser profile.
  • Google may rate-limit or flag unusual activity. That is why Gentle exists. If you see errors from Google, switch to Gentle.

FAQ

Is this allowed by Google? It automates what you can do by hand in the Google Photos web app for your own account: open each photo and download it. It is not affiliated with or endorsed by Google, and Google's terms of service discourage automated access to its services. Use the Gentle preset if you want the backup to look as much like normal use as possible. You are responsible for your own account.

Why not use Google Takeout? Takeout is Google's official export and is worth knowing about. It gives you zip archives that you download and unpack yourself. This extension copies file by file into your own bucket, resumes after interruptions, and skips what is already there, so you can run it again later to pick up new photos. Using both is fine.

Does it need my Google password? No. It uses the session of the Google account you are already signed in to in the same browser.

Can it delete anything in my Google account? No. It only lists and downloads.

What happens if I close the tab or the computer sleeps? The backup stops. Progress is saved after every file. Open the dashboard again and press Resume. Files that were half copied are copied again.

Can I move the backup to another bucket later? Yes. Change the destination in Back up to and press Resume. It copies everything to the new place, skipping whatever is already there. The library scan is kept.

I reinstalled the extension. Does it start from zero? It scans the library again (about 2 minutes per 50,000 items), then lists your bucket and skips everything already in it.

How much does the storage cost? That depends on your provider, region and storage class. A library of about 52,000 items was about 340 GB: roughly $0.34 a month in Glacier Deep Archive, $5 in R2 Standard, $7.80 in S3 Standard. See Storage classes and archive. The setup guides list what you are charged for.

Can I use Cloudflare R2, Backblaze B2 or MinIO? Cloudflare R2, yes (since 0.6.0). Backblaze B2 and MinIO not yet.

Does it work in Firefox or Safari? No. Chrome and Edge only for now.

Development

The extension has no build step and no dependencies. It is plain JavaScript modules in extension/.

  • Load it: chrome://extensions → Developer mode → Load unpacked → pick the extension/ folder. After a code change, click the reload icon.
  • Demo mode: open the dashboard, then add ?demo=1 to its address (chrome-extension://<id>/run.html?demo=1). It runs the same dashboard on a fake 4,000-item library, in its own database. Nothing is downloaded or uploaded.
  • Local folder destination: run node receiver/server.mjs (Node 18 or later, no dependencies). It listens on http://127.0.0.1:8787 and saves to backup/. Set BACKUP_DIR to use another folder or drive. Uploads are refused when less than 2 GB is free (MIN_FREE_GB to change). Then pick This PC in the dashboard.
  • Release zip: powershell tools/pack.ps1 writes dist/photos-backup-extension-<version>.zip, with the version taken from extension/manifest.json. Pushing a tag v<version> (matching the manifest) makes GitHub Actions (.github/workflows/release.yml) build the same zip and attach it to a GitHub Release.

Layout:

Path What it is
extension/gphotos.js Google Photos client: session, listing, size estimate, downloads
extension/engine.js Scan, queue, parallel workers, speed, time left, auto-pause
extension/destinations.js AWS S3 and Cloudflare R2 (SigV4 in the browser), Azure Blob (SAS), local receiver, storage classes
extension/keyparse.js Recognises a pasted or dropped key (Azure SAS URL, AWS key .csv, R2 token page)
extension/store.js IndexedDB progress store
extension/run.html, run.js, run.css Dashboard
extension/timeline.js By date grid
extension/mock.js Fake library for demo mode
receiver/server.mjs Local receiver for the This PC destination
deploy/azure.json ARM template behind the Deploy to Azure button
tools/pack.ps1 Builds the release zip

See CONTRIBUTING.md for how the internal endpoints are used and what to check when Google changes them, and TESTING.md for the manual test guide.

License

MIT. See LICENSE.

Google Photos is a trademark of Google LLC. This project is not affiliated with or endorsed by Google.

Jelajahi proyek terkait

Memuat…