Jump to content

Importing products from SQL file directly to PS Database


grsinternet

Recommended Posts

I have 10mln products. Product has only name and price. Importing via standard PS import form it takes 1sec for 100products. It means I would have to sit all day and import manually products to database.

Instead of that I want to generate SQL files to do it faster, directly to database.

I have found that PrestaShop 1.7.6.4 creates records in these tables for products:
ps_category_product
ps_product
ps_product_lang
ps_product_shop
ps_stock_available

If I will create similar records in my SQL files as PS does on import. Will it work correctly?
Or there are other alternatives for this?

Thanks!

Link to comment
Share on other sites

En la importación de PS estándar demora porque recorre linea por linea.

Tienes que crear una consulta con insert masivo.
Es mucho mejor practico y rápido en la carga de mysql.

Ejemplo : 

insert into (nombre, precio) values
( "nombre1", "precio1"),
( "nombre2", "precio2"),
( "nombre3", "precio3");

etc...

 

 

  • Like 1
Link to comment
Share on other sites

There's more tables involved, I would export the SQL results and import them using the CSV product/combination structure PS shows you in Advanced Parameters->Import.

Either this or writing a php script which will call the PS functions for adding products.

Or, finding a module for it, there might be some free ones.

  • Like 1
Link to comment
Share on other sites

Apart from tables which you have mentioned, there are following tables as well.

ps_image
ps_image_lang
ps_image_shop

Inserting the data in above tables will be very challenging using the SQL.

>> In case, you are having product combinations (attributes) then there are more tables as well. 

>> Apart from that, I am not sure how you are going to manager the product reference key (i.e. MySQL generated product id in other tables)

So its advised to use the default import feature OR try some addons for the same. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...