Jump to content

Manage products directly in database


yomas

Recommended Posts

Hi all !

 

I recently made a shop for a photographer who wanted to sell his work.

 

I used the prestashop import module to import his 1200 photos, it worked but was very slow and has many bugs...

Furthermore I next imported his combinations, more than 40 000 lines in database where written using the same import module...

 

THAT WORKED BECAUSE I WAS WORKING IN LOCAL ^^

 

Now the website is online, and it's just impossible to import like 200 products at the same time with the import module (moreover for the combinations !!).

 

I was wondering if somenone has reached to only use directly mysql import to manage imports ? cause all the addons module like store commander are heavy to work with.

 

The deal of this post is to share experiences of users like me that doesn't want to use the prestashop classical way to add product, but directly act in the database.

 

Hoping this topic will launch a good brainstorming.

 

Best reagrds.

Link to comment
Share on other sites

Doing the import in SQL directly, or do it is feasible is pretty risky/complex for Db integrity.

 

Best you can do is do the import as you did locally, then make a full db backup / restore on the online system.

 

All other scenario will lead to massive problems

Link to comment
Share on other sites

Doing the import in SQL directly, or do it is feasible is pretty risky/complex for Db integrity.

 

Best you can do is do the import as you did locally, then make a full db backup / restore on the online system.

 

All other scenario will lead to massive problems

 

Hi there !

 

I know acting directly in database is risky, it's the purpose of this topic ^^

How to manage from sql with no risks !!

 

I already do many operations via sql, like assign products to different categories, change their price, add combinations and attributes... But that only on already created products.

 

I would like to manage product creation in sql, and I'm sure this is possible without any risks if it's well done ^^

 

Your idea of bakuping the base to work in local and reload it online is not bad, for example my client is importing between 50 and 150 product each week !!

 

Furthermore when I imported the combinations for all 1200, it took 72H to make it !!!

 

So at least 7~8H for 120 products...

 

I've seen this : http://addons.prestashop.com/fr/edition-rapide-modules-prestashop/7951-massive-customizable-xml-importer.html

 

Maybe an alternative way...

Edited by yomas (see edit history)
Link to comment
Share on other sites

Short answer no this is impossible.

 

Long answer, no, you need to create records in product, product attribute, product_attribute_combination, category_product, image, product_lang and depending on your version you may need the slibbing tables same name post fixed with _shop.

And I may have forgot some in this list.

This is painfull, and not feasible thru SQL only. You need to collect the id of your last inserted product and/or attribute to populate the other tables. Trust me dont do that.

Link to comment
Share on other sites

Allright so no easy light solution to import massive products and combinations ?

 

I already tried store commander, I think it's to heavy for the user. I'll try the one I mentionned above but it's true that managing lots of products is complicated in Presta...

Link to comment
Share on other sites

1.5.5 ^^

 

I now know well how to use import in presta, but it's so slow... The fact is that importing many products often becomes very annoying...

 

First import products, then combinations : I have at least 32 possiblities for each products, so for 100 products it makes 3200 combinations for import... And that takes very long ^^

 

I told you the truth, 72h for the first combination import ^^

I was oftenly looking in the database to see if it was always running !

Link to comment
Share on other sites

72h for 1200*32 combinations? That is only 38400 records, sound like you got some other system problem here.

 

During massive import you should disable most (if not all) of the modules.

 

That rates make me think of issues in your MySQL optimisation and/or your hardware (disk)

Link to comment
Share on other sites

Hi again !

 

Sorry for the late response !

 

As I sayd I was working on my local machine, now the site is hosted on Gandi.net.

 

I'll try to make a small import to see if it works better but not convinced :'(

 

You say all modules should be disabled during import ? For a site in production that's not possible ^^

 

In fact dowloading the db to make import in local again then re upload it is not possible since the client wants to do it himself ;-)

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...