K2Bridge / Guide
Keep K2 images and attachment downloads working
A K2 import moves the article text. The images and attachment files stay on the old server until you copy them. This walkthrough shows what K2Bridge writes, which folders to copy, and how to prove every file is there. The site, item numbers and file names below are fictional.
Online version: https://sidecarsoft.com/guides/k2-migration-images-attachments/
What K2Bridge writes, and what it leaves to you
Link to sectionK2Bridge does not copy media. It does not copy images, attachment files or galleries. It writes references: text paths that point at files you must put on the new server yourself.
The product page lists these exclusions word for word: "Comment text, users/passwords, media files, galleries, menus, modules, templates, permissions and other extension data. Attachments become links only; copy image and attachment files separately. Old K2 URLs are not guaranteed."
| K2 media | What K2Bridge writes into the Joomla 5 article | What it does not do | Your job |
|---|---|---|---|
| Item image | The Intro Image and Full Article Image fields get the paths media/k2/items/cache/{hash}_M.jpg and {hash}_XL.jpg. The hash is the MD5 of the word Image plus the K2 item ID, the name K2 itself uses. | It copies no image file. | Copy the folder media/k2/items/cache. |
| Item with no image | The same two paths. Version 1.0.2 fills both image fields for every item, including items that had no image in K2. | The files never existed, so these paths cannot work. | Clear both image fields on those articles, or the pages show a broken image. |
| Attachment | A list of download links appended to the article text. Each link is media/k2/attachments/{file name}, with no leading slash. | It copies no attachment file. | Copy the folder media/k2/attachments, and check where the links resolve (see below). |
| Image or link inside the item text | The text as it was. The specification does not say that paths inside the text are rewritten. | It does not copy the files these paths name. | Copy the files, or edit the paths. |
| Gallery or video plugin | Nothing. "Galleries, video plugins, menus, modules, templates, permissions and other extension data are not migrated." | It does not handle galleries. | Plan galleries and video as separate work. |
Use --no-attachments on the command line to leave the attachment links out. Then no attachment link is written at all.
A link is not a file
Link to sectionA path in an article is only an address. The browser asks the new server for that address. If the file is not there, the visitor sees a broken image or an error page instead of the download.
The K2Bridge test fixture shows this on purpose. In its words, the front-end capture "deliberately shows that limitation, including the broken image; a download link alone does not mean its file was transferred."
So the check after an import is never "is there a link?". The check is "does the server send the file at that exact address?".
Check direct file access
Link to sectionCheck article visibility and attachment access separately. Joomla viewing access levels determine who may view content such as articles. A file served directly from a public media folder can still open at its known URL without opening the article. Restricting the article or hiding its link is not proof that the file is protected.
The published K2Bridge exclusions include media files and permissions; attachments become links only. The import does not establish protected downloads. Follow the private article guide for article access, then check the file separately.
On an isolated staging copy, use a harmless fictional attachment and a fresh logged-out browser session. Open the restricted article, then paste the known attachment URL directly into the address bar. Record the intended audience and both results. Do not use confidential or customer files for this rehearsal.
| Visitor and file | Article result | Direct file result | Decision |
|---|---|---|---|
| Guest; fictional member briefing PDF in a public media folder | Restricted article does not open | Known attachment URL opens the PDF | Article restriction passes; file confidentiality fails. Stop before copying confidential files. |
Stop if a confidential file opens for a guest, or if its direct-file access is unknown. Keep confidential files out of public media folders and pause their transfer or launch until a separately chosen access-controlled delivery method has been verified for guests and intended users. A working link, an obscure filename or the download attribute is not an access check.
This is a migration checklist, not a protected-download feature or a server-configuration recipe. The distinction between article and direct-file checks is an operational conclusion from Joomla content access levels and K2Bridge's stated exclusions.
Step 1: build a path sheet (fictional site)
Link to sectionList every path the new site will ask for, next to the file that must answer it. The fictional old site is old.example on a Windows host. The new Joomla 5 staging site is new.example on Linux, installed in the web root. Item 1042 has an image, item 1043 has none, and item 1057 has two attachments.
| Row | Path in the Joomla 5 article | File on the old server | File to place on the new server | Expected check result and action |
|---|---|---|---|---|
| 1. Item 1042, intro image | media/k2/items/cache/e5d6b2287375a08cd0c4ee7d5ab1a8fc_M.jpg | media/k2/items/cache/e5d6b2287375a08cd0c4ee7d5ab1a8fc_M.jpg | The same path and name | The image shows in the category list. |
| 2. Item 1042, full image | media/k2/items/cache/e5d6b2287375a08cd0c4ee7d5ab1a8fc_XL.jpg | media/k2/items/cache/e5d6b2287375a08cd0c4ee7d5ab1a8fc_XL.jpg | The same path and name | The image shows on the article page. |
| 3. Item 1043, no K2 image | media/k2/items/cache/24eb469de76283bf95760d20fb997762_M.jpg and _XL.jpg | None | None | Not found. Clear both image fields in the article's Images and Links tab. |
| 4. Item 1057, attachment "Venue map" | media/k2/attachments/Venue-Map.PDF | media/k2/attachments/Venue-Map.PDF | media/k2/attachments/Venue-Map.PDF, capitals kept | The PDF downloads. |
| 5. Item 1057, attachment "Seating plan" | media/k2/attachments/seating-plan.pdf | media/k2/attachments/Seating-Plan.pdf (renamed by hand; Windows still served it) | Rename it to seating-plan.pdf | Not found on Linux until the names match letter for letter. |
| 6. Image inside the item text of 1057 | images/news/2019/Stage.JPG | images/news/2019/Stage.JPG | images/news/2019/Stage.JPG | The image shows. The path was never rewritten, so the folder must exist. |
| 7. Link inside the item text of 1042 | https://old.example/images/flyer.pdf | images/flyer.pdf | images/flyer.pdf, then edit the link to the new site | It works only while the old host is online. Fix it before the old host shuts down. |
Rows 3, 5 and 7 are the ones that fail silently. An import report cannot find them, because the import itself did what it says.
Step 2: copy the folders as they are
Link to section- Copy media/k2/items/cache and media/k2/attachments from the old site root to the same paths under the new Joomla root. Keep every folder and file name unchanged.
- Check the K2 attachments folder setting on the old site first. K2's code saves attachments to media/k2/attachments by default, but a K2 site can set another folder. K2Bridge links always point at media/k2/attachments, so copy the files there.
- Copy every folder that the item text names, for example images/news/2019. The importer did not move these files either.
- Copy with an archive or SFTP so the files arrive byte for byte. Compare file counts and sizes on both sides.
- Do not move the files into the images folder unless you also edit every path. The Joomla Media manager shows "by default the images folder", so files under media/k2 do not appear there. That is expected. Joomla also warns about its Path to Files Folder option: "Changing to another path than the default 'images' may break your links."
- Keep the old K2 originals in media/k2/items/src as an archive. K2 saves the uploaded image there and the resized copies in media/k2/items/cache. K2Bridge refers only to the cache copies.
Case-sensitive paths
Link to sectionMicrosoft documents the difference: "Windows file system treats file and directory names as case-insensitive." and "Linux file system treats file and directory names as case-sensitive."
On the fictional old Windows host, a link to seating-plan.pdf still found Seating-Plan.pdf. On the Linux host, the same link finds nothing. Most Joomla hosting runs on Linux, so check names letter for letter: Venue-Map.PDF and venue-map.pdf are two different files there.
Fix a mismatch on one side only. Either rename the file to match the link, or edit the link to match the file. Do not keep two copies with different capitals.
Relative URLs: where the browser really looks
Link to sectionK2Bridge writes the attachment links as media/k2/attachments/{file name}, with no leading slash. That is a relative reference. RFC 3986 says relative "implies that a 'base URI' exists against which the relative reference is applied." Its own example resolves "g" against http://a/b/c/d;p?q to "http://a/b/c/g", and "/g" to "http://a/g".
For a fictional article at https://new.example/news/venue-update, the browser can therefore ask for https://new.example/news/media/k2/attachments/Venue-Map.PDF. That address does not exist. Some Joomla setups turn such paths into site-root paths before the page is sent, and some do not. Do not assume: open the article on the front end and copy the real link address of one attachment.
If the address is wrong, change the links in the article text to a root path, /media/k2/attachments/{file name}. If Joomla runs in a subfolder, put the subfolder first. Check images inside the item text the same way.
The links also carry the download attribute. MDN notes that "download only works for same-origin URLs". If you move attachments to another host, the browser opens them instead of saving them.
Step 3: find missing files before visitors do
Link to sectionRun these checks on staging, after the copy and before you change DNS. Use the counts from your own path sheet.
| Check | How | Pass when |
|---|---|---|
| Attachment files | Count the rows in the K2 attachments table and the files in media/k2/attachments on the new server | The counts match (in the example: 2 for item 1057) |
| Every path in the sheet | Open each path as a full URL on staging, on a phone and on a desktop | Each one returns the file, not a not-found page (rows 1, 2, 4 and 6 in the example) |
| Items without an image | In the Joomla 5 database, list the articles whose images field names a file that does not exist | None remain (row 3 in the example) |
| Exact letter case | Compare each attachment file name on the server with the link in the article | Every name matches exactly (row 5 in the example) |
| Real link address | On the front end, copy the address of one attachment link and one image | It points at the site root, not at a path under the article |
| Old host | Paste each article's HTML into the old-host link checker with old.example as the old domain | No link, image or file points at old.example (row 7 in the example) |
| After launch | Read the server's not-found log for paths under /media/k2/ and /images/ | No entries for a week |
Keep the old server and its files unchanged until every row passes. K2Bridge only reads the source database, and copying files does not change the old site either.
What this walkthrough does not cover
Link to sectionGalleries and video plugins are not migrated by K2Bridge, so this guide has no copy steps for them. Plan them as separate work and test them on staging.
Comments, menus, modules, templates and permissions are also outside the import. For old K2 URLs and redirects, use the URL preservation checklist.
Sources
- K2Bridge product page: scope and exclusions
- K2Bridge guide: scope and limits (images, attachments, galleries)
- K2 source code (getk2/k2): item model, image cache and attachments folder
- Joomla 5 help: Articles: Edit (Images and Links)
- Joomla 5 help: Media
- Joomla 5 help: Media: Options (path to files folder, legal extensions)
- RFC 3986, section 5: resolving relative references
- Microsoft Learn: case sensitivity in Windows and Linux file systems
- MDN: the a element and its download attribute
- Joomla: Access Control
All sources read on 20 November 2026. The image and attachment paths were also checked in the K2Bridge 1.0.2 package code. The Joomla pages are the official help screens served by help.joomla.org. The site, item numbers and file names are fictional; the hashes are the real K2 names for those fictional item IDs. Direct-file access addition: access-control documentation from the Joomla project and published K2Bridge exclusions read 23 November 2026; the visibility row is fictional, not a measured result.