Taking my data back from iCloud and Dropbox
Leaving Dropbox, moving 60,000 of our family's photos onto my own server, and cutting $30 a month from my cloud bills without losing a single file
Nine hundred and fifty gigabytes
In August I opened my iCloud storage page and found 950.7 GB in use: 497.4 GB of Photos, 264.8 GB of iCloud Drive, and 63.6 GB of Messages. I was paying Apple every month to keep our family's memories on a server I'll never see, while a perfectly good copy sat on a drive next to my desk.
- Photos497.4 GB
- iCloud Drive264.8 GB
- Messages63.6 GB
- Other124.9 GB
Dropbox was the other bill, and the bigger mess. Years of college design work, wedding footage and old downloads lived there, and I’d been moving it to iCloud for a long time. Dropbox was slow to download from, so I’d start a batch, leave it, and pick it back up whenever I had time. Over months that left the same folders half-copied in both places, and I couldn’t trust either one to be the real copy. That, more than the bills, is why I wanted my data back on drives I own: Dropbox gone, and iCloud down to the 200 GB plan, then lower.
Dropbox goes first
Dropbox was the easy half. I pulled everything down into one folder, merged it with what was already in iCloud Drive, and worked through it with an agent: cut the obvious duplicates, keep the final cut of every wedding video and drop the raw clips, rename everything in lowercase with underscores. Once it was sorted, I deleted it from Dropbox.
Photos were the hard half.
Then the photos
Our photos already had a better home. I run Immich on my own machine, with the originals on an external drive, and it had been importing for months. The obvious move was to delete everything from iCloud Photos that Immich already had.
The hard part was the word "already." Deleting a photo from iCloud Photos deletes it everywhere: the Mac, the phone, the cloud. I'm married with two kids. If I got this wrong, a photo from one of their first years could be gone for good, and those aren't files you can download again. I needed proof for every one of our photos before I deleted it, not a feeling.
Filenames lie
My first pass was cheap. I listed every asset in the Photos library with osxphotos, which reads the library's database without downloading anything. Then I dumped every asset from Immich's Postgres database: checksum, filename, size, creation date. I joined the two lists on filename, date and dimensions.
The result looked great and proved almost nothing. About 90% of the library's 60,461 assets looked present in Immich. Only 145 could actually be proven, because almost the whole library was "iCloud-optimized." The Mac held small previews, not originals, and I couldn't hash a file I didn't have.
A filename is only ever a soft match, and this library showed why. Snapseed exports had mangled names. Several Immich assets shared the same name and size. Photos shared with me through Messages sat in their own corner of the library with half-empty metadata. A soft match is a good hint, but I wasn't going to delete anything on a hint.
The rule
So I made one rule and held every script to it:
A photo leaves iCloud only when the SHA1 of its original equals a checksum Immich already stores.
Immich stores a SHA1 checksum for every original it ingests. So proof was cheap once I had the original file: download it, hash it, look the hash up. If it matches, delete it from Photos. If it doesn't, leave it alone and put it on a list. Never delete anything from Immich.
Download, hash, evict
The Mac didn't have room to download the library all at once, so the work ran in batches:
- Sort candidates by year and cut them into batches capped by count and size.
- Use osxphotos to download each batch's originals to a temp folder on the NVMe.
- Hash every file and check it against Immich's checksums.
- Delete the matches from Photos in chunks, then empty the temp folder.
- Write everything to a log so a crash or a restart loses nothing.
The guardrails mattered more than the pipeline. A batch wouldn't start unless the boot drive had at least 35 GB free, and it would abort if free space fell below 25 GB, because iCloud filled the disk faster than I expected. The long runs got their own terminal session outside the editor, because the editor's background shell kept killing them mid-batch. The main run took 101 batches over four days. Cleanup stretched the whole effort to almost a month, from August 24 to September 19.
macOS asks for confirmation before deleting photos, and it won't let a script click that button. One-by-one prompts were unbearable, so deletes were grouped into chunks of 50 to 400 photos and saved up until the end of each wave. That way I clicked through a stack of dialogs once, instead of hovering over the machine all night.
When deleted doesn't mean deleted
Two things surprised me.
First, "Recently Deleted" is a holding area, not a trash can I could forget about. After every wave I hashed what was in it against Immich again before emptying it. One check covered 11,320 items and found zero misses, but I wasn't going to assume that.
Second, the phone. When I turned iCloud Photos back on from my iPhone, the library suddenly grew by 2,017 items I'd already deleted. The phone still had its own copies and pushed them back up to the cloud. My lesson: pick one device as the source of truth and turn sync off everywhere else before deleting anything. For me that source of truth is Immich, not any Apple device.
The leftovers
Hashing doesn't end with everything matched. It ends with a pile of things that didn't match:
| Leftover | Items | What happened |
|---|---|---|
| True misses: originals Immich didn't have | 8,898 | Uploaded to Immich, hashed again, then deleted |
| "Shared with You" photos from Messages | 480 | 170 were already in Immich and 310 were uploaded first. PhotoKit balked at deleting them, so they went last |
| Snapseed exports with broken names | 341 | Most matched under their camera names by size, date and dimensions. The rest were renamed and uploaded |
Where it lives now
Leaving iCloud didn't mean trusting a single drive instead. Our photos live in three places now:
| Copy | Where | What it's for |
|---|---|---|
| Immich | The server at home, originals on an external drive | The copy we actually use, from our phones, over Tailscale |
| Two local drives | 4 TB between them | Everything that came out of iCloud Drive and Dropbox |
| S3 Glacier Deep Archive | AWS, encrypted with age before upload | The day the house burns down, for about $0.50 a month |
Immich isn't open to the internet. Our phones reach it over Tailscale, a private network made of nothing but our own devices, so the server in the house is a tap away from anywhere and invisible to everyone else. No ports opened, no public address. It still feels like one of the quiet wonders of modern technology.
Before anything goes to Glacier, it's encrypted on my machine with age, using a key only I hold. Amazon stores ciphertext, not our photos.
Deep Archive is the cheapest storage AWS sells. For us it comes to about fifty cents a month. The catch is getting it back: a restore takes hours, and there's an egress fee to download it. That's fine. It's insurance, not a library. I've never had a house fire, and if I ever do, paying to get back every photo of our kids will be the easiest bill I've ever paid.
Where it landed
| Before | After | |
|---|---|---|
| iCloud used, not counting Messages | 887.1 GB | 211.3 GB |
| iCloud Photos | 497.4 GB | 0 |
| iCloud Drive | 264.8 GB | 57.4 GB |
| Assets in Photos | 60,461 | 0 |
| Originals in Immich | 66,799 | 73,949 |
| Proven by SHA1 and deleted | — | 55,851 |
| Dropbox | Paying | Gone |
| Off-site backup | — | Glacier, ~$0.50/mo |
| Photos lost | — | 0 |
Between Dropbox and iCloud, that's at least $30 a month back already. iCloud Drive is next. The 200 GB plan is the next stop, not the last one.
Trust the hash
Every shortcut I was tempted by, like soft matches, filename lookups or "it's probably in there," would have been fine for 90% of the library. The last 10% is where the photos we actually care about live: the badly named ones, the shared ones, the ones from a phone I forgot was syncing.
Hashing is slow and boring, and it's the only reason I can say "photos lost: 0" and mean it.
Our photos live on a drive we own now. Dropbox gets nothing, Apple gets a smaller check every month, and I don't have to wonder where anything went.
The recipe
If someone wants to do this with an agent like Claude Code, this is the brief I'd hand it. It assumes a Mac with Photos signed in to iCloud, an Immich server that already has the photos, and a person nearby to click through macOS's delete dialogs.
Goal: remove photos from iCloud Photos only when Immich already holds the exact same original. Never delete anything from Immich.
The rule: a photo leaves iCloud only when the SHA1 of its full-resolution original equals a checksum Immich already stores. Filename, date, size and dimension matches are hints for sorting work, never proof.
Before starting:
1. Ask me to pick one source of truth (Immich) and turn off iCloud Photos sync on every other device, so nothing deleted gets pushed back.
2. Install osxphotos. Get read access to Immich's asset checksums, from its Postgres database or its API, and save them to a local set.
3. Pick a temp folder on a drive with room, and set two floors for the boot drive: a minimum free space to start a batch, and a lower one that aborts the batch. iCloud downloads fill a disk fast.
Each batch:
1. List candidates with osxphotos, oldest year first, capped by count and total size.
2. Download those originals to the temp folder.
3. SHA1 every file and look it up in Immich's checksums.
4. Queue matches for deletion. Put misses on a list and leave them alone.
5. Empty the temp folder and append everything to a log, so a crash or restart resumes where it stopped.
Deleting:
- macOS asks for confirmation before deleting photos and won't let a script click it. Group deletes into chunks of a few hundred and tell me when a stack of dialogs is ready.
- Before emptying Recently Deleted, hash its contents against Immich again. Stop and tell me about any item that doesn't match.
Leftovers:
- For each miss, upload the original to Immich, confirm Immich's checksum now matches, then queue it for deletion like any other match.
- Treat "Shared with You" photos and edited exports (Snapseed and the like) as their own lists. Show them to me before doing anything.
Run long jobs in their own terminal session, not a background shell that can be killed. When you finish, report: photos proven and deleted, misses uploaded, items still on a list, and photos lost (should be 0).