Migrate Pictures

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Greetings,

I'm currently in the process of migrating a former access DB over to Nop's sql DB.  I have mapped out my products, however, have come across a stumbling block in the form of pictures.  I see that the Picture table can suck in a binary image, however, there is also a physical image on the system in Nop.Web.Content.Images.Thumbs.  To add to my confusion, some images have multiple images in varying sizes.

Ex.  I uploaded an image (Test Product.jpg) that is 500 x 353 px to a product.  The image is now resting within Nop.Web.Content.Images.Thumbs as 0000002_test_product.jpg.  I have a DB record for it in Picture with a binary version for the record.  I then went out to the store and looked at the item.  Another three images were generated when I did so.  Now I have 0000002_test_product_70.jpg, 0000002_test_product_125.jpg, and 0000002_test_product_300.jpg.

I'm mostly curious, when I start my conversion (I'll transfer the images to the Thumbs folder and rename them appropriately, plus add a DB entry) if I need to just insert the image alone in it's renamed format or do I need other copies of the file for the three different sizes?  I imagine why the different images appear is for sizing due that their sizes correspond to new sizes of the images.

Any direction would be appreciated.  Thanks.

Kindest Regards,
Chad
11 years ago
Thumbs are generated automatically as the pictures are referenced based on page visit.

You don't indicate how your migrating the data.  I'd suggest you look at the Import capability on the admin products page.  Even if you are building some other migration mechanism for product info, you can then use Export, update the spreadsheet with picture file names, and then use Import.  (you must have Sku's on your product variants for this to work)
11 years ago
I think I figured it out, or it seem so.  The way I'm migrating my data is I have a Console App that runs and grabs all the data from an Access DB.  I then match the data up to the Nop DB and insert the records accordingly.

The solution I came up with was I read in a list of the images to be uploaded first, then individually go through the list and add an entry into the Picture table.  Once the row Id is returned, I add it to a list of a class I created to store the PictureId, ProductId, and FileName.  I then add my record into Product_Picture_Mapping.  Lastly, I actually copy the original file over to the Nop folder that has the images and rename it appropriately with '000000' (give or take a 0 pending the id) + PictureId.  It appears to work so far since my products do display their appropriate picture.  Thanks for the help regardless.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.