1

Magento 1.9.1. --) Magento 1.9.4

I am setting up a newer version of our store on a different hosting account. I need to export PRODUCTS. I have tried to do a regular EXPORT and IMPORT but that just gives way too many Errors and I didn't get far trying to fix those.

So I decided to do the Dataflow - Profiles import. I did the export on the old 1.9.1 system, found the file in public_html/var/export, uploaded the file on the new Dataflow - Profiles 1.9.4 server and ran it. It gave me the following Error:

Image does not exist.

It says this:

Found 1057 rows. Starting catalog/convert_adapter_product :: parse
Processed 100% 1057/1057 records Imported 8 records Please wait while
the indexes are being refreshed. Finished profile execution.

And it indeed created 8 products only. Those products seem to have all the information EXCEPT FOR the product image. I have just copied all the images from the old system's media/catalog/product folder to the same (media/catalog/product) on the new 1.9.4 environment. I am guessing this is not correct?

Two questions then:

  1. Where to put the product photos so that they get picked up and inserted into the right products?
  2. Do I have to create all the websites and categories before I run this Dataflow IMPORT?

Is there anything else I should pay attention to?


UPDATED on January 30th, 2019:

I have done what was suggested here (exported the same file on the old 1.9.1 and the new 1.9.4) and gone through all the fields to compared them. Here is what I found:

extra fields in new 1.9.4 system:

website (there is also a websites field on both old and new) - what is
 this field for and do I need to worry about that?
_media_image for example: /t/e/test.jpg
_media_lable
_media_position
_media_is_disabled

Do I need to worry about the _media_.... columns?


Both the old (1.9.1) and new (1.9.4) site's export files have these columns:

image
small_image
thumbnail

The old 1.9.1 exported file has the file paths filled in such as /d/e/productname.jpg while the new 1.9.4 has these empty. What does that mean and what do I need to do here?


extra fields in the Products exported file on the old 1.9.1 system:

cube_category_Bestsellers
cube_category_featured

I have no idea what these are so maybe I could just delete them?


So far I have uploaded all product images in their respective folders into media/catalog/product and that does not seem to be working. Shall I re-upload them/move them to media/import?


UPDATED again later on January 30th, 2019:#

I have now copied all folders, sub folders and files from the media/catalog/product directory into media/import directory and I am getting ready to run the IMPORT again. The only thing I am really still not sure about is the issue with categories. I can create the same categories on the new system but the CSV file seems to only have 1 column concerning categories:

- category_ids

Now the problem is - when I create the same categories in the same category structure, the new system will assign a different category ID, won't it? So what does that mean? Do I have to go through all the 1000+ products and correct the category ID on each? I assume I also have to create the additional websites/stores/storefronts before I run the IMPORT?


UPDATED on February 4th:

I am having a huge problem with categories. When I tried to do the import at first - it gave me Errors saying the categories do not exist. So I created all the categories by hand with subcategories and subcategories of the subcategories, put in all the meta info and all. The issue is that every and each category on the new system has a different category ID than on the old system so I'm having to go through all of them one by one in the exported Excel file and change the numbers. I made me a table of which old category corresponds to which new category but it's driving me completely crazy because:

  1. When I use the REPLACE function of Microsoft Excel - it often does not replace the number correctly especially when working with single digit numbers (it throws the commas off and effectively change the other category ID's on the same product)

  2. after I've changed a number for example 2 to 25; if I later need to search and replace 25 (from the old system to let's say 16 on the new system) then it also replaces a number I already replaced (2 to 25).

Surely, there must be a more sophisticated way to do this?

5
  • you can try product import system->import/export->import this way? this is better compare to data-flow profile also easy Feb 1, 2019 at 8:42
  • @Rakesh Donga I've tried that and that gives way too many problems - magento.stackexchange.com/questions/259237/… Even-though I am now setting up the categories and will correct the category ID's in the exported CSV file. Why do you think the regular import is better? magento.stackexchange.com/questions/259102/…
    – Allysin
    Feb 1, 2019 at 19:11
  • I think you are gone wrong way because it is very easy Feb 2, 2019 at 3:42
  • @Allysin the regular import is a lot faster than Dataflow. But since you are quite far in your migration process it wouldn't make sense to switch the import / export tool. Keep on track
    – HelgeB
    Feb 3, 2019 at 11:27
  • Would you please look at my update above in regards to categories?
    – Allysin
    Feb 4, 2019 at 17:13

2 Answers 2

1
+50

Where to put the product photos so that they get picked up and inserted into the right products?

The default import location for the media files used by Dataflow is media/import (see Mage_ImportExport_Model_Import_Uploader and Mage_ImportExport_Model_Export_Entity_Product for details)

EDIT 31.01.:

Now the problem is - when I create the same categories in the same category structure, the new system will assign a different category ID, won't it? So what does that mean? Do I have to go through all the 1000+ products and correct the category ID on each? I assume I also have to create the additional websites/stores/storefronts before I run the IMPORT?

Yes you will have to change the category ids in the csv before the import. You can try to build the category structure in the order the category ids are assigned in the old system (i.e. lowest not build-in category id on the old system first) - that might work and you should be able to import the products without change of category ids.

There is also the possibility to reassign the product to categories using sql import. But for this import you need a csv file category_id,product_id,position. It should be possible to create this list using skus and category names and joining the old and new databases tables using this criteria - please let me know, if the first approach doesn't work and you want to go this way

Regarding websites/stores: you need the websites and stores your exported csv file contains. I guess, you can also skip that columns and import all products to admin store.

Update 4.02. - SQL approach for migration of prodcut category mapping. The clue is to get the data from catalog_category_product and map the entity_ids for products and categories from old system to the new system

I assume the following for the proposed approach:

  • the url_path for each category is the same in the old and new system. If not please change url_path with other category attribute you didn't change
  • all categories are available in the admin store (otherwise you will have to repeat the select with store_id from 1 to max of your store_id)

1. On old system: Select the products of categories with produkt sku, category url_path and position and export the result to a csv file

SELECT p.sku, v.value AS url_path, ccp.position
FROM catalog_product_entity p
JOIN catalog_category_product ccp on ccp.product_id = p.entity_id 
JOIN catalog_category_entity c on c.entity_id = ccp.category_id
JOIN eav_attribute a on a.attribute_code = 'url_path' and a.entity_type_id = 3
JOIN catalog_category_entity_varchar v ON c.entity_id = v.entity_id and v.attribute_id = a.attribute_id and v.store_id = 0;

2. On new system: Import the products with Dataflow to an arbitrary category which exists

3. On new system: create a new table and import the csv from the statement above

CREATE TABLE `tmp_catalog_category_product` (
      `sku` varchar(64) DEFAULT NULL,
      `url_path` varchar(255) DEFAULT NULL,
      `position` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

4. On new system: delete all prodcut assignments to category

truncate catalog_category_product;

5. On new system: insert all correct product to category assignments

insert into catalog_category_product (
select v.entity_id, p.entity_id, t.position 
from tmp_catalog_category_product t
JOIN catalog_product_entity p on p.sku = t.sku
JOIN eav_attribute a on a.attribute_code = 'url_path' and a.entity_type_id = 3
JOIN catalog_category_entity_varchar v ON v.attribute_id = a.attribute_id and v.store_id = 0 and v.value = t.url_path
);
  1. On new system: rebuild category index

  2. On new sytem: delete the temporary created table (after checking that everything is fine):

    drop table tmp_catalog_category_product;
    
13
  • Thank you for helping. I've put an update on the original post up above - would you please look?
    – Allysin
    Jan 30, 2019 at 18:14
  • The images have to be in media/import before you start the import. Copying the images in media/catalog/product won't help because you need the references to the files in the database. Dataflow inserts this data only if the file is importet, i.e. file exists in media/import
    – HelgeB
    Jan 30, 2019 at 18:29
  • Thank you Helge. Would I copy the contents of media/catalog/product to media/import and then run the import?
    – Allysin
    Jan 30, 2019 at 18:39
  • No, the media/import directory is flat, there have to be all files in the directory. In media/catalog/product you have one digit subdirectories whith other one digit subdirectories.
    – HelgeB
    Jan 30, 2019 at 18:42
  • That's what I was afraid of! How do I extract the images from the folders and sub-folders in order to put them all in Media/import? There must be thousands of them - it would take forever to do that by hand...
    – Allysin
    Jan 30, 2019 at 18:49
0

Follow following three steps and re-import it.

1) Export products file from newer version and compare it with older versions in any csv editor.

2) correct columns in older csv and change them as per newer csv order exact match

3) no issue for product images can be copied later need to check images entry in csv file, yes exact match mean you have same categories structure

3
  • Thank you for your answer. I understand everything except the bit about images. How do I do it so that the products pick up the corresponding product photos? I don't understand this part at all. I have more than 1000 images and I just need to copy them over somehow. It's not possible for me to do it one by one....
    – Allysin
    Jan 29, 2019 at 20:48
  • you will not copy one by one you will copy complete folder and will not change anything in directories after that take care of directory permissions. Jan 30, 2019 at 8:27
  • Thank you for helping. I've put an update on the original post up above - would you please look?
    – Allysin
    Jan 30, 2019 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.