VirtueMart Forum

VirtueMart 2 + 3 => Installation, Migration & Upgrade => Topic started by: werian on November 01, 2012, 22:51:43 pm

Title: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on November 01, 2012, 22:51:43 pm
Hello there!

Few days ago I just develop & release simple plugin, which helps you with migration process of additional images from Virtuemart 1 to Virtuemart 2.
Here is download: http://joomstuff.com/free/plg_vm1_additional_images_migrator.php (http://joomstuff.com/free/plg_vm1_additional_images_migrator.php)
Use this plugin after VM 1 => VM 2 migration process, when your old VM 1 tables still exists into target, new database.
Plugin migrates only product additional images, not the first one, which is migrated with standard VM 1 => VM 2 migration process.


Installation is simple - use your Joomla installer, then publish plugin in plugins panel.

Migration process:

1. Old Virtuemart 1 tables musts exists in your actual database! (especially #__vm_product_files table), with the same prefix, as your Virtuemart 2 database prefix.
2. Put this url into your browser address bar: www.your_vm2_site.com/index.php?convertVm1Images
3. You will get this form:

(http://joomstuff.com/free/migration_images_vm1.png)

4. You can optionally update images titles & descriptions from Virtuemart 1 database, if you want that - check it.
5. Put "Start process" to begin images migration.
6. You will get this message on complete:

(http://joomstuff.com/free/migration_images_vm1_success.png)

Changelog:
- version 1.1 - added function to generate thumbnails from plugin
- version 1.2 (27.01.2013) - fixed SQL bug



Regards, sorry for my poor English & have fun!  ;)

Łukasz Duda / Luke Duda
http://joomstuff.com/
http://dodatkijoomla.pl/
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: infin8 on November 02, 2012, 20:42:22 pm
Hi,
Sounds awesome and thank you so much for sharing this migration tool, however, the zip file is corrupt, please upload again.  ;)
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on November 02, 2012, 20:56:39 pm
Indeed, nice fail :/
Everything should be fine now.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: infin8 on November 02, 2012, 21:14:14 pm
Łukasz you are a LEGEND!!!!!  8)

Updated titles, descriptions, meta data: 1454
I migrate 1361 images.

Thanks mate, you have saved me so much time!
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on November 02, 2012, 21:30:34 pm
Thanks :)
Tomorrow i will update reviews migration plugin :)
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: patrick356356 on November 21, 2012, 21:08:16 pm
 ;D ;D ;D
You are my absolute hero!!! I don't know how to thank you enought for this plugin.

/ Patrick
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: gain on November 25, 2012, 18:38:29 pm
Thank you very much for this plugin. You save me lots of time...
Thanks again... :D
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Milbo on November 27, 2012, 09:58:30 am
Great work, when you know how to add it to the core, would be nice. On the other hand, that way the marketing effect is better for you. Whatever, good work
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: gain on November 28, 2012, 09:29:51 am
Just noticed that the plugin works only with images, not with other filetypes (I have pdf manuals also)...
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on November 30, 2012, 14:15:21 pm
@Milbo
Thanks Milbo for that words, it's very good feeling heard somethink like that, especially from you...
I could add this script into VM 2 migration source, but my knowledge about SVN & working in dev don't exists. I'm just alone-dev, and have no idea how to break that :(

@gain
I see you pronblem, I will try to solve that in new version, but it will be difficult.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: bytelord on November 30, 2012, 17:09:31 pm
@werian

Great work man!
You could make the changes to migration source and send the files to Max, he will adjust it to the core

Regads
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: gain on December 01, 2012, 09:42:59 am
@gain
I see you pronblem, I will try to solve that in new version, but it will be difficult.

np, I've done it by myself with a custom script...

So I'm wondering: from db structure seems that I can upload a pdf once and referring it to many products (sometimes manuals are for a range of products, not only one) and adding associations in #__virtuemart_product_medias works like a charm...
But I can't find a way to do that from the administrator user interface... am I noob or is not implemented yet?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: bytelord on December 01, 2012, 17:17:20 pm
Hello,

Not sure exactly what are you seraching, may be the open under media selection the option Role?? Have two options file is Displayable or file is Downloadable.

Regards
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: gain on December 03, 2012, 17:44:53 pm
I've noticed that the plugin publish all the images... I've several images unpublished.
I've solved with this SQL (inspired by werian's one):
Code: [Select]
UPDATE `#__virtuemart_medias`
SET published = 0
WHERE REPLACE(file_url, 'images/stories/virtuemart/product/', '') IN (
  SELECT REPLACE(file_name, '/components/com_virtuemart/shop_image/product/', '')
  FROM `#__vm_product_files`
  WHERE file_published = 0
)
works obviously with the default vm path... change it if you've changed it in the backend.

Hello,

Not sure exactly what are you seraching, may be the open under media selection the option Role?? Have two options file is Displayable or file is Downloadable.

Regards

Thanks for your reply, I've tried this option right now but I can't see any difference...

But, well, I'm searching a way to add an image, already in vm, to a product.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: patrick356356 on December 07, 2012, 17:26:36 pm
Hi Werian,

Just discovered a lot of pictures missing after import but most worked fine. Any idea what could be wrong? For example an article had 4 pictures before but now only 2. I don't see any pattern in the number of pictures imported per product, it seems totally random.

I also had some pdf:s that didn't import at all. But that's a separate thing I guess...

Regards
Patrick
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: FrankA on January 05, 2013, 02:47:15 am
Hmm, not worked for me at all?

I have these files with right prefix from vm1.5
 Structure j25_vm_category
Structure j25_vm_category_xref
Structure j25_vm_manufacturer
Structure j25_vm_manufacturer_category
Structure j25_vm_product
Structure j25_vm_product_category_xref
Structure j25_vm_product_mf_xref
Structure j25_vm_product_price
Structure j25_vm_product_relations

Looked at source of php and do not see need for others... so what might be missing?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: FrankA on January 05, 2013, 19:10:10 pm
Backed up... reinstalled VM and ran again with same results.  Tried the thumbnail creation and that threw up an internal server error... but have memory set to 128M.

This site has 800 items and about 3,000 images so not the end of the world if I have to add pics back in manually but this seems such a simple task I cannot understand why it fails. Also the next site to be migrated has 5,000 items and 20 or 30k images... so need to solve for that.

Is this going to be integrated into a future VM migration as it seems odd that if everytime a new VM version we have to manually rebuild so much of the site?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: FrankA on January 05, 2013, 20:47:50 pm
A little more info from error log
Code: [Select]
Sat Jan 05 02:42:09 2013] [warn] [client 92.152.xx.xxx] mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/XXXXX.info/httpdocs/jupgrade/plugins/system/vm1_additional_images_migrator/vm1_additional_images_migrator.php on line 106, referer: http://XXZZZZZ.info/jupgrade/index.php?convertVm1Images
which refers to code
Code: [Select]
$product_images = $db->loadObjectList();
foreach($product_images as $product_image)

So I presume it looks in the old table  for each product to retrieve the file name and add a record to the new version table. I did notice that in vm_product_files it includes path in file name! But I guess that is supposed to be...

Anyway I am lost on how to resolve this one  :-\
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on January 28, 2013, 15:14:41 pm
New version of plugin - I found SQL bug. Now plugin should be fine.
Thanks for @FrankA.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on February 24, 2013, 10:33:38 am
Version 1.3 allows you rename ".JPG" images to ".jpg".
".JPG" don't works with Virtuemart 2!
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: traintracts on March 16, 2013, 23:00:42 pm
I tired to do this.  I downloaded the plug in and installed it in my joomla 2.5 backend and I put the link in the browser, like you said:  http://www.your_vm2_site.com/index.php?convertVm1Images

And I got a big pop up screen that says:  "server not found."   I am sad.  How can I make it work?

My e-mail is:  susan.mulford@gmail.com
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on March 17, 2013, 12:58:25 pm
Did you enabled pluign in Joomla backend?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: FrankA on April 23, 2013, 13:16:40 pm
I presume that this is intended to run on joomla 2.5?

Migrations from VM1 to VM2 were being done after upgrading joomla to 2.05... but currently advice 'seems' to have been quietly changed to migrating VM1 to VM2 on jommla 1.5.25 (or 1.5.26 depending which solution you read). Is there any impact on this plug-in werian, will it work on joomla 1.5?

I still have one major site to upgrade 1.5 to 2.5 and vm 1.1.9 to 2.

Also I just used this script again on a fairly restricted shared server vm migration. Took several attempts as the server gave up on it most attempts but it did complete the job in the end, but server never let script get back to display result.... I think some images never got reset... will have to do a manual check on each product... but certainly the bulk went through OK.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: lostmail on April 29, 2013, 12:47:13 pm
..followed the install plugin - started the script.

1300 thumbnails generated

But no additional images in products added.. :-[
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: FrankA on April 29, 2013, 13:54:30 pm
Thumbnail generation is a separate function in the tool. You need to use button left to add the additional images. Note also you need the vm1 tables renamed with j25 prefix... same prefix as your joomla install
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: shikar1860 on May 19, 2013, 12:26:15 pm
Migrating additional images with this plugin doesn't work for me.
I get an error message:

Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/mysite/plugins/system/vm1_additional_images_migrator/vm1_additional_images_migrator.php on line 132

This line is: foreach($product_images as $product_image)

Does anyone have an idea how to fix this?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Spule on September 18, 2013, 14:46:29 pm
Hello there!

Few days ago I just develop & release simple plugin, which helps you with migration process of additional images from Virtuemart 1 to Virtuemart 2.
Here is download: http://joomstuff.com/free/plg_vm1_additional_images_migrator.php (http://joomstuff.com/free/plg_vm1_additional_images_migrator.php)
Use this plugin after VM 1 => VM 2 migration process, when your old VM 1 tables still exists into target, new database.
Plugin migrates only product additional images, not the first one, which is migrated with standard VM 1 => VM 2 migration process.


The Link to the addtional images migrator is unfortunately broken. Is there annother option were you can download it?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Maxim Pishnyak on September 18, 2013, 19:52:45 pm
Yes.

[attachment cleanup by admin]
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Spule on September 19, 2013, 00:05:35 am
Thank you very much!  :)
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Maxim Pishnyak on September 19, 2013, 21:57:37 pm
You're welcome!
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: svarmuza on September 26, 2013, 19:43:24 pm
Greetings...
I can' manage to migrate additional images...  I get message.. "I migrate 0 images."... and i think i did procedure as explaned:

1. I have old VM tables in my 2.5 database with correct 2.5 prefix
2 I installed plugin and enabled it
3. my old image folder is in /components/com_virtuemart/shop_image/product  .... with all images there  (and i have it also in images/stories/virtuemart/product too)

when i click START PROCESS i get message "I migrate 0 images."

I would be very happy if someone could help me with this.
Thanks,
Sasa
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Maxim Pishnyak on September 29, 2013, 20:55:04 pm
Your Joomla version?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: svarmuza on September 30, 2013, 19:08:46 pm
Greetings,

My Joomla is version 2.5.14, and VM 2.0.22a

Thank you very much for helping.

Cheers,
Sasa
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Maxim Pishnyak on October 03, 2013, 15:19:10 pm
1. I have old VM tables in my 2.5 database with correct 2.5 prefix
It should be 1.5 prefix.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: svarmuza on October 03, 2013, 17:20:53 pm
Hi Maxim,
when i rename my old VM tables in new 2.5 database with original old jos_  prefix I get this error.
Quote
Warning: Invalid argument supplied for foreach() in .../plugins/system/vm1_additional_images_migrator/vm1_additional_images_migrator.php on line 132
I migrate 0 images.

But I'm not sure that i should have old prefix, but new of 2.5 database (in the first post of this thread it is mentioned that old VM tables should have correct prefix of new 2.5 database)

Quote
1. Old Virtuemart 1 tables musts exists in your actual database! (especially #__vm_product_files table), with the same prefix, as your Virtuemart 2 database prefix.

Thank you very much for trying to help me...
Sasa
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Maxim Pishnyak on October 03, 2013, 17:24:09 pm
You could pm me access and I could look into it. Phpmyadmin access is welcome also.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Maxim Pishnyak on October 04, 2013, 16:17:25 pm
It could be issue with your php settings. Ask your hosting support to turn off "safe mode" in your PHP. Safe mode is not welcome in Joomla.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: svarmuza on October 05, 2013, 21:06:06 pm
Hi Maxim,
Big thanks for checking my issue and helping me.
I have one copy of the site on my localhost machine... and I have the same problem as on live server migrating additional photos, although safe_mode is turned OFF on my local server....

But the good news is that i managed to migrate additional images somehow by manipulating database in phpMyadmin. Yes, it took me whole night untill 5 AM but finally i managed to solve this:)

Thanks one more time for everything.
SAsa

Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: barboss on December 11, 2013, 09:46:37 am
I have errors while renaming
Warning: mysql_affected_rows() [function.mysql-affected-rows]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /plugins/system/vm1_additional_images_migrator/vm1_additional_images_migrator.php on line 325

When I try to import pictures I have this errors
Warning: imagejpeg() [function.imagejpeg]: Unable to open '_90x90/home/site/images/stories/virtuemart/product/resized/tmpForThumb_php1t6pEk.jpg' for writing: No such file or directory in /site/administrator/components/com_virtuemart/helpers/img2thumb.php on line 318

Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: mfarooqi on February 04, 2014, 14:56:22 pm
Hello there!

Few days ago I just develop & release simple plugin, which helps you with migration process of additional images from Virtuemart 1 to Virtuemart 2.
Here is download: http://joomstuff.com/free/plg_vm1_additional_images_migrator.php (http://joomstuff.com/free/plg_vm1_additional_images_migrator.php)
Use this plugin after VM 1 => VM 2 migration process, when your old VM 1 tables still exists into target, new database.
Plugin migrates only product additional images, not the first one, which is migrated with standard VM 1 => VM 2 migration process.


Installation is simple - use your Joomla installer, then publish plugin in plugins panel.

Migration process:

1. Old Virtuemart 1 tables musts exists in your actual database! (especially #__vm_product_files table), with the same prefix, as your Virtuemart 2 database prefix.
2. Put this url into your browser address bar: www.your_vm2_site.com/index.php?convertVm1Images
3. You will get this form:

(http://joomstuff.com/free/migration_images_vm1.png)

4. You can optionally update images titles & descriptions from Virtuemart 1 database, if you want that - check it.
5. Put "Start process" to begin images migration.
6. You will get this message on complete:

(http://joomstuff.com/free/migration_images_vm1_success.png)

Changelog:
- version 1.1 - added function to generate thumbnails from plugin
- version 1.2 (27.01.2013) - fixed SQL bug



Regards, sorry for my poor English & have fun!  ;)

Łukasz Duda / Luke Duda
http://joomstuff.com/
http://dodatkijoomla.pl/


I've tried this same process. several times.. but i get nothing instead "I migrate 0 images."

I done following steps
1. my vm1 table names were like j25_vm_tablename .. i  renamed them to j25_vm_tablename
2. my vm2 table names were like j25_virtuemart_tablename .. i renamed them too j25_virtuemart_tablename ..
Uploaded files.. but couldnt' get any result.

Can you please tell me what could be the issue?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: Darkheart on February 17, 2014, 12:26:07 pm
Thanks! Saved me hours of work!
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: csho on May 23, 2014, 18:21:39 pm
I use virtuemart 2.6 and I lost my additional images after migration, the above script didn't worked on me, any thoughts?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: onli333 on August 22, 2014, 05:46:12 am
Please, please, please, upload the file again. Link in the first post does not work. :'(
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on September 15, 2014, 23:07:19 pm
Uploaded once more time.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: onli333 on September 16, 2014, 03:27:44 am
Thank you very much!!! :)
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: werian on September 16, 2014, 16:39:05 pm
Tell my if it works fine, cause I made this kind of code really long time ago.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: onli333 on September 17, 2014, 09:04:57 am
Thank you. The plugin works. I'm happy)) Thank you very much  :)
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: vt.prusov on October 07, 2014, 07:05:04 am
Hi! I've Joomla 2.5.6 and Virtuemart 2.0.0, but after 3 min of script work there is "I migrate 0 images". I've installed plugin, publish it, I have old and new DB with correct prefixes, safe_mode is OFF on the server. What can be reason?
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: vt.prusov on October 07, 2014, 09:36:12 am
solved! There were too many goods and images, so I had to divide a key SQL query to some parts and run them step by step. It works! Thank you!
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: edthenet on January 15, 2015, 06:57:33 am
i have tested it. It worked fine for me. Thanks for this
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: multisant on September 28, 2015, 13:36:18 pm
Hi,

The download link is down. Can it be uploaded again? Thanks in advance.

EDIT: Ive found a download link on the previous page. Works good, thanks!
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: mfarooqi on July 11, 2017, 18:05:30 pm
I tested all links .. none of them is working. I remember I had downloaded that years back. And found i back in my hard drive's archives.

Here is the ZIP file attached.
Title: Re: Products additional images migration from Virtuemart 1 to Virtuemart 2 -solution
Post by: disday on March 07, 2019, 17:23:49 pm
Good day! This feature is actual for me now. I've installed plugin but cant execute it, link from first post doesnt work already.
plugins/system/vm1_additional_images_migrator/vm1_additional_images_migrator.php in browser doesnt run anything.
Someone can help me?
Thanks!