Skip to content

Craft 6 upgrade guide: reuse Craft 5 image transforms - #801

Open
riasvdv wants to merge 2 commits into
mainfrom
rias/craft6-upgrade-transform-paths
Open

riasvdv wants to merge 2 commits into
mainfrom
rias/craft6-upgrade-transform-paths

Conversation

@riasvdv

@riasvdv riasvdv commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Copy, please review and rewrite as necessary

Description

Adds an Image Transforms step to the Craft 6 upgrade guide, after Run Migrations. The upgrade clears the transform index, and Craft 6 stores transforms below a _{volumeUid}/ folder, so every Craft 5 transform is regenerated. The new step explains how to move the existing transform folders so Craft reuses them.

Craft 5:  blog/2024/_thumb/sunset.jpg
Craft 6:  _{volumeUid}/blog/2024/_thumb/sunset.jpg

Evidence

Each claim in the section was checked against craftcms/cms 6.x:

  • Path: ImageTransformer::getTransformBasePath() returns '_'.$volume->uid.'/'.$folderPath. Craft 5's version returns {transformSubpath}/{folderPath}. Both are relative to the transform disk's root, not the volume's subpath.
  • Folder and file names: getTransformString(), getTransformSubfolder() and the transform filename produce the same names in Craft 5 and 6, including the /{assetId} subfolder used when the format changes.
  • Local disks: getTransformUrl() checks the disk, finds a moved file that isn't stale, and records it, so its URL is returned directly.
  • Remote disks: generateTransformedImage() returns early when the file already exists and is newer than the transform's last change, so the image isn't processed again.
  • immediately: the GraphQL immediately argument and named transforms keeping their _handle folder ship with the fix for [6.x]: Upgrade discards the transform index, and GraphQL named transforms lose their handle (all transforms regenerate to new paths) cms#20588. On 6.0.0-beta.1, GraphQL named transforms look for the parameter-based folder name instead, so this section should go out with that release.

Related issues

Craft 6 stores transforms below a _{volumeUid}/ folder and the upgrade
clears the transform index, so describe how to move existing transform
folders and how Craft picks them up again.

Related: craftcms/cms#20588
Amp-Thread-ID: https://ampcode.com/threads/T-01a1c75f-81cb-7691-a8d8-f4023e7fe794
Co-authored-by: Amp <amp@ampcode.com>
@riasvdv
riasvdv requested a review from a team as a code owner November 10, 2026 22:27
@netlify

netlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for craft-docs ready!

Name Link
🔨 Latest commit 38eda36
🔍 Latest deploy log https://app.netlify.com/projects/craft-docs/deploys/6af39ab34210a5c82f17f0f0
😎 Deploy Preview https://deploy-preview-801--craft-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant