Use Case #21: Cloudinary Escape
Migrating from Cloudinary to Supabase Storage without breaking image URLs.
William Welsh
Author
Use Case #21: Cloudinary Escape
Cloudinary's pricing model rewards you for staying. Every image URL is a lock-in mechanism.
We had 50,000 images. The bill was $800/month. Time to leave.
The Challenge
Every image had a Cloudinary URL. Those URLs were in database records, cached in browsers, indexed by Google, shared on social media. You can't just delete them.
The Migration Strategy
Claude designed a multi-phase approach:
Phase 1: Inventory - Query database for all Cloudinary URLs. Found them in 7 different tables, 12 different columns. 50,247 unique images.
Phase 2: Download - Batch download all images to local storage. Organized by original upload date to maintain structure. Added retry logic for failed downloads. 3 images were gone (404). Acceptable loss.
Phase 3: Upload - Bulk upload to Supabase Storage. Maintain folder structure. Generate new URLs.
Phase 4: URL Mapping - Create a mapping table: old Cloudinary URL → new Supabase URL. This becomes our redirect source.
Phase 5: Database Update - Update all 7 tables with new URLs. Batch updates, 1000 rows at a time.
Phase 6: Redirect Layer - For the URLs we can't update (browser caches, Google index, social shares): Edge Function that intercepts old URLs and 301 redirects to new ones.
The Numbers
| Metric | Value |
|---|---|
| Images migrated | 50,247 |
| Migration time | 4 hours |
| Broken links | 0 |
| Monthly savings | $750 |
The Redirect Layer
This was the clever part. Old URLs still work - they just redirect. Over 3 months, redirect traffic dropped from 10,000/day to 200/day as caches refreshed. We can remove the redirect layer once it hits near-zero.
Cloudinary Lock-in: Defeated
They make it hard to leave on purpose. But with a systematic approach, any vendor lock-in can be escaped.
Migration completed December 2025. ROI: 3 weeks.
William Welsh
Building AI-powered systems and sharing what I learn along the way. Founder at Tech Integration Labs.
Related Articles
View all →Use Case #6: Mock to Production Database
The app looked great but everything was fake. Claude created 20+ database tables, wrote RLS policies, generated seed data, and wired up real API calls.
Use Case #13: Zero-Downtime Migration
The client needed to move from Vercel to Netlify mid-production. Claude orchestrated the migration with DNS cutover, zero downtime, and automatic rollback capability.
Use Case #14: RLS Policy Debugging
The query was correct. The data existed. But Supabase returned nothing. Claude traced it to a recursive RLS policy that created an infinite loop.