- Posts: 2
COMMUNITY FORUM
K2 Import/associate +10k Images
- Thomas Brown
- Topic Author
- Offline
- New Member
Less
More
3 years 10 months ago - 3 years 10 months 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?
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 years 10 months ago by Thomas Brown.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
3 years 10 months ago #177762
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks 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:
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.
- 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.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Thomas Brown
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
3 years 10 months 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?
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.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
3 years 10 months ago #177829
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks 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.
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.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- mjmartino
- Offline
- Senior Member
Less
More
- Posts: 45
3 years 10 months 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.
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.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
3 years 10 months ago #177891
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks 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.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.