Guide

Move from Cloudinary to Fileboy

Map Cloudinary's URL options to Fileboy transforms, import your library with a script, check it, and cut over without breaking pages.

Migration guide · in this guide

  • What moves, and what does not
  • 1. Map your URLs
  • 2. Import your library
  • 3. Write down the new IDs
  • 4. Check the import

Published

What moves, and what does not

Moving from Cloudinary means two jobs: copying your originals into Fileboy, and changing the image URLs in your app. The two services use different URL formats, so this is a change to your code, not a switch to flip.

Before you start, read the Fileboy and Cloudinary comparison, in particular where Fileboy is the weaker fit. Generative AI effects and a full marketing asset library are not things to move across. If you rely on them, keep Cloudinary for those and move the rest.

Check your file count and total size against the plan you want on the pricing page first. Uploads past an app's file or storage limit are refused, and nothing is stored.

1. Map your URLs

A Cloudinary delivery URL puts options in the path, such as w_400,c_fill. A Fileboy URL has one path, /images/get/FILE_ID, and the steps go in ?transform=, separated by semicolons. These are the options with an equivalent:

  • w_400 becomes resize:400x_ (the underscore means: work the height out).
  • w_400,h_300,c_fill becomes resize:400x300~fit:cover. Roughly: c_fill also takes a gravity, and Fileboy's position option is the nearest match.
  • c_fit becomes resize:400x300~fit:inside. Roughly the same.
  • c_pad becomes resize:400x300~fit:contain~background:hex(fff). Roughly the same.
  • f_auto becomes format:auto, and f_webp becomes format:webp.
  • q_80 becomes quality:80. q_auto has no equivalent, so pick a number.
The same image, before and after
https://res.cloudinary.com/YOUR_CLOUD/image/upload/w_400,h_300,c_fill,f_auto/shop/boots.jpg

https://api.fileboy.io/images/get/FILE_ID?transform=resize:400x300~fit:cover;format:auto

Anything not listed, such as generative effects, face detection or named transformations, has no mapping here: check each one by hand. Fileboy presets can stand in for named transformations, so you define a set of steps once and refer to it by name.

2. Import your library

This script lists your Cloudinary images and asks Fileboy to fetch each one from its Cloudinary URL with uploadFileFromUrl. Nothing is downloaded to your machine. It writes the old public ID into each file's metadata, so a second run skips what is already there, and the same metadata gives you the old ID to new ID map afterwards. It needs your Fileboy private key, which also lets it create folders from your public ID paths.

import-from-cloudinary.mjs
import { v2 as cloudinary } from "cloudinary"
import { Fileboy } from "@cd2/fileboy-node"

cloudinary.config({
  cloud_name: process.env.CLOUDINARY_CLOUD_NAME,
  api_key: process.env.CLOUDINARY_API_KEY,
  api_secret: process.env.CLOUDINARY_API_SECRET,
})
const fileboy = Fileboy({
  publicKey: process.env.FILEBOY_PUBLIC_KEY,
  privateKey: process.env.FILEBOY_PRIVATE_KEY,
})

const failed = []
let cursor
do {
  const page = await cloudinary.api.resources({
    resource_type: "image",
    type: "upload",
    max_results: 100,
    next_cursor: cursor,
  })

  for (const asset of page.resources) {
    try {
      // Skip what an earlier run already imported
      const done = await fileboy.listFiles({ metadata: { cloudinaryId: asset.public_id }, limit: 1 })
      if (done.data.length > 0) continue

      const parts = asset.public_id.split("/")
      const name = parts.pop() + "." + asset.format
      const file = await fileboy.uploadFileFromUrl(asset.secure_url, {
        name,
        metadata: { cloudinaryId: asset.public_id },
        ...(parts.length > 0 && { folderPath: "/" + parts.join("/") }),
      })

      // A cheap check: the stored size should be the size Cloudinary reported
      if (file.fileSize !== asset.bytes) {
        console.warn("Size differs for " + asset.public_id, file.fileSize, asset.bytes)
      }
    } catch (error) {
      failed.push(asset.public_id)
      console.error(asset.public_id, error.message)
    }
  }
  cursor = page.next_cursor
} while (cursor)

console.log("Failed: " + failed.length, failed)

A sketch to adapt. The Fileboy calls are the library's, but check Cloudinary's SDK for its current call names and fields. Assets of the private or authenticated type need signed URLs to be fetched. Documents are raw assets, so run it again with resource_type: "raw". Try it on one folder first.

Fileboy fetches each address itself, so it must be a public internet address. A fetch that stalls for 60 seconds, or takes more than nine minutes, is refused with url_fetch_timeout, and one file can be up to 5 GB. For Cloudinary videos, use the video upload in the Mux guide: uploadFileFromUrl is for files and images.

3. Write down the new IDs

Your database holds Cloudinary public IDs. Add a column for the Fileboy ID and fill it from this map, keeping the old column until you have checked everything.

export-map.mjs
import { writeFile } from "node:fs/promises"
import { Fileboy } from "@cd2/fileboy-node"

const fileboy = Fileboy({
  publicKey: process.env.FILEBOY_PUBLIC_KEY,
  privateKey: process.env.FILEBOY_PRIVATE_KEY,
})

// Fileboy kept the old id in each file's metadata, so it can write the map for you
const map = {}
let cursor
do {
  const page = await fileboy.listFiles({ hasMetadata: ["cloudinaryId"], limit: 100, cursor })
  for (const file of page.data) map[file.metadata.cloudinaryId] = file.id
  cursor = page.nextCursor ?? undefined
} while (cursor)

await writeFile("cloudinary-map.json", JSON.stringify(map, null, 2))
console.log(Object.keys(map).length + " files in the map")

In your code, the helper that built Cloudinary URLs becomes one that builds Fileboy URLs from the stored ID:

// Before (Cloudinary's SDK)
cloudinary.url("shop/boots", { width: 400, height: 300, crop: "fill", fetch_format: "auto" })

// After
fileboy.buildImageUrl(fileboyId, {
  transforms: [
    { type: "resize", width: 400, height: 300, fit: "cover" },
    { type: "format", format: "auto" },
  ],
})

A client that has a private key adds a short-lived signature to the URLs it builds. For URLs that go into pages, build them with a client that has only your public key, or write the URL yourself as shown above.

4. Check the import

  • Count: the number of entries in cloudinary-map.json should equal the number of images in Cloudinary. Re-run the import: it should report no new files, and an empty Failed list.
  • Sizes: the import script warns when a stored size differs from the one Cloudinary reported. Look at every warning.
  • Pictures: open twenty or so images at the sizes your pages use and compare them with the originals, including a transparent PNG and the biggest file you have.
  • URLs: request a transformed URL and check you get an image back, for example curl -I "https://api.fileboy.io/images/get/FILE_ID?transform=resize:400x_;format:webp" should answer 200.

5. Cut over

  • Create your Fileboy app's keys and set the app's allowed origins to your site. Keep the private key on your server only.
  • Match privacy: if your Cloudinary assets are private, turn on signed URLs for the Fileboy app before you move them.
  • Point new uploads at Fileboy first (the React uploader or a server upload), so no new files land in Cloudinary while you move the old ones.
  • Run the import once more to pick up what arrived in the meantime, then export the map again.
  • Switch the URL builder in your app to Fileboy, behind a flag or on one page first, and compare those pages with the old ones.
  • Leave Cloudinary as it is for a few weeks. Old emails, caches and other sites may still point at it. Only remove assets when your own logs show no more traffic, and keep a copy of the map.

Checked against the current libraries in November 2026. Found something that no longer works? Tell us.

Still choosing a tool?

Fileboy is small on purpose. This comparison says where it fits and where another option is the better call.

Get a key and run this code

Create a free app, copy your keys into the example and run it. The free plan needs no card.