Real Use Case

Use Case #21: Cloudinary Escape

Migrating from Cloudinary to Supabase Storage without breaking image URLs.

W

William Welsh

Author

Dec 30, 2025
7 min read

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

MetricValue
Images migrated50,247
Migration time4 hours
Broken links0
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.

W

William Welsh

Building AI-powered systems and sharing what I learn along the way. Founder at Tech Integration Labs.

View Profile
Share this article:

Related Articles

View all →