cancel
Showing results for 
Search instead for 
Did you mean: 

Assign product to category by SQL with CSV

SOLVED

Assign product to category by SQL with CSV

Hello!


We have over 110'000 products (4400 config products) and we  need to assign all of them to few categories. Yesterday we run a script but will take a lot of time (20h = only 4000 products).

 

I think the best option will be to do it directly in sql.


We have a csv with:
SKU of config product | root category | subcategory

 

I found some information the best will be create table in sql based on the csv but what later?

 

Thanks for help!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Assign product to category by SQL with CSV

Hello @lukaszwoznb0bb 

 

For huge count of products, you can first create URL's of those product name from script and update, then it will take pretty less time, here is a blog with example of code, please check this once and let us know if it helped or not :

https://bsscommerce.com/confluence/how-to-import-a-large-number-of-products-in-magento-2/

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

View solution in original post

1 REPLY 1

Re: Assign product to category by SQL with CSV

Hello @lukaszwoznb0bb 

 

For huge count of products, you can first create URL's of those product name from script and update, then it will take pretty less time, here is a blog with example of code, please check this once and let us know if it helped or not :

https://bsscommerce.com/confluence/how-to-import-a-large-number-of-products-in-magento-2/

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy