Keyword

K2 Import/associate +10k Images

  • Thomas Brown
  • Thomas Brown's Avatar Topic Author
  • Offline
  • New Member
More
3 weeks 5 days ago - 3 weeks 5 days ago #177724 by Thomas Brown
K2 Import/associate +10k Images was created by Thomas Brown
Hello,
I am in the process of migrating from a custom Drupal component (multiple tables with image paths) to Joomla K2 (no image path). We have mapped all the fields and are migrating the data but the images are assigned differently in K2 and there appears to be no way to associate images without going through and uploading them via the K2 admin. I have just over 10,000 images to associate with K2 Items... Is there a way to do this? I found a few posts from 9 years ago that seemed to hack the core files to accomplish this. Any guidance would be greatly appreciated.

I can add all of the images to the media/k2/items/src directory but how can we then associate the image name to the K2 item?
Last edit: 3 weeks 5 days ago by Thomas Brown.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 9 hours ago #177762 by Fotis
Replied by Fotis on topic K2 Import/associate +10k Images
I would recommend this:
- Embed the imported images as an <img> tag at the very top of the imported content (text).
- Use this plugin github.com/getk2/k2-iaki to convert these images to K2 images, meaning images that are referenced as a different property in each K2 item object.

Otherwise, if you know the ID for each import Drupal post in K2 you can easily move its image into the /media/k2/items/src/ directory and rename it according to this pattern:
md5("Image" . $ID_OF_THE_ITEM);

By moving the Drupal images in that folder (I assume a single image per post), you essentially create your K2 image registry. Then you can use this PHP (CLI) script github.com/getk2/rebuildK2imageCache to generate 6 images per K2 item ("small" to "extra large") that K2 uses in different parts of the site (e.g. "Medium" size for categories, "Large" for the item view).

If it's unclear, let me know.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Thomas Brown
  • Thomas Brown's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 5 days ago #177821 by Thomas Brown
Replied by Thomas Brown on topic K2 Import/associate +10k Images
Any tool you recommend for re-naming 10K images? This seems like a odd way to manage images. Mapping file names then changing to include the item ID and not the file name itself.... I can see this request as a need to create a better import process. Having the images in the content is not optimal.

Basically it sounds like I need to set the path in the introtext then some how change the file names to Image."itemID" - move those images to the media/K2/items/src directory - then run the rebuild Image Cache. Then remove the <img> tag from the introtext. Is this what you are saying?

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 4 days ago #177829 by Fotis
Replied by Fotis on topic K2 Import/associate +10k Images
It's either/or. It's not both.

Either insert the existing images names into the content.

Or rename them according to the pattern I mentioned while moving them to a specific folder.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

More
1 week 16 hours ago #177877 by mjmartino
Replied by mjmartino on topic K2 Import/associate +10k Images
This is a better way :)
Map fields for core joomla with images fields.
Core article migrate to k2 ;)
You won't have to mess around with the lack of ID images in DB.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
6 days 8 hours ago #177891 by Fotis
Replied by Fotis on topic K2 Import/associate +10k Images
Indeed @mjmartino. I'm working on such a migration right now and the changes will be ported back to K2 really soon.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum