Jump to content

Product Import/export


Recommended Posts

Dears, 

 

I've been struggling with this issue for almost a week now with no solution. 

Been browsing the forum, all solutions didn't work or it was in spanish which I don't understand. 

 

I had prestashop 1.6.0 on a godaddy host. It was filled with bugs, broken modules ..etc. 

Got a new host (a2) and installed the latest fresh prestashop on it. 

 

ALL I want to do is migrate "only" products, orders, customers, address. That's it. 

No issues exporting/importing everything except (products). I have 450 products in my store. 

Importing them in the new site always causes 500 internal error, tried the following: 

 

  • purchased 3 modules from prestashop addons that didn't work 
  • tried to locate php.ini with no success / don't know how to create one (so i can increase memory limit)
  • contacted host and inquired about memory limit (it is 256MB). 

My questions are:

 

  1. what is the solution to importing large number of products? 
  2. is there a way to split a CSV file into multiple files with -50 products in each? tried excel but whenever I save it just mess the file and everything in it. 
  3. is there a way to export selected products rather than the whole list? 

 

Regards, 

Link to comment
Share on other sites

Just 450 products and you are facing issue in import. Please check the server configurations, it will be fix asap.

 

If not then let me know.

 

 

Turn on dev mode for error 500, it might be a small thing that can be fixed in 5 minutes, the rest of the import might be okay

 

 

Thank you both for the swift reply. 

I turned on debug mode and this is what I got: 

 

[PrestaShopDatabaseException]

Duplicate entry '2-239' for key 'PRIMARY'

 

INSERT INTO `psmr_category_product` (`id_category`, `id_product`, `position`) VALUES ('2', '239', '7'), ('37', '239', '7')

at line 791 in file classes/db/Db.php

 

786. if ($webservice_call && $errno) {

787. $dbg = debug_backtrace();

788. WebserviceRequest::getInstance()->setError(500, '

 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);

789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {

790. if ($sql) {

791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');

792. }

793.

794. throw new PrestaShopDatabaseException($this->getMsgError());

795. }

796. }

Link to comment
Share on other sites

Looks like a product is trying to be associated to a category twice. Delete the entry for category 2 and id_product 239 (there should be one only), then try again and see if you get another.
There should not be duplicates in a raw sql dump, so you can also check if you have duplicate entries in your original table.
If you use csv, make sure you didn't write the category name twice

Link to comment
Share on other sites

Looks like a product is trying to be associated to a category twice. Delete the entry for category 2 and id_product 239 (there should be one only), then try again and see if you get another.

There should not be duplicates in a raw sql dump, so you can also check if you have duplicate entries in your original table.

If you use csv, make sure you didn't write the category name twice

 

You mean edit the csv file? how do I do that? 

I've checked the product and made sure it is associated in 1 category not 2. Exported the products again and imported them. 

 

*please note I'm not an expert so bear with me when explaining things*

 

this is what i got, when I refreshed after the error, 150 products were imported out of 450 

 

Request Timeout

This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

Link to comment
Share on other sites

You mean edit the csv file? how do I do that? 

I've checked the product and made sure it is associated in 1 category not 2. Exported the products again and imported them. 

 

*please note I'm not an expert so bear with me when explaining things*

 

this is what i got, when I refreshed after the error, 150 products were imported out of 450 

 

Request Timeout

This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

 

 

actually it is less .. . each product is imported twice .. 

I checked the csv and there are no duplicates there

Link to comment
Share on other sites

I tried splitting the file using Terminal (split) command on my mac into many files each has 40 raws. 

 

The good news: the first file was imported successfully with no issues - rest of the files were messed up by Terminal somehow .. 

 

If there was a way to split the csv, this would solve every problem. 

Link to comment
Share on other sites

Maybe the best is to open it in some spreadsheet, edit it so that only 40 are left and then save or export it.

 

 

I have found an online website that can edit csv. 

I split the products csv into 16 different files each containing only 30 products! 

Managed to import 6 successfully but the 7th one got (Request Timeout This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.). 

 

I calculated the average time for the 6 that were imported, each file took 3-4 minutes .. 

I sent my host an email explaining this and asking if it's possible to increase timeout time. .. 

 

It's really frustrating. 

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