Search code examples
prestashopcvsimport

Prestashop CVSImport does not import my existing 17000 customers


I try to import my existing customers to the new site which is prepared using prestashop. I prepared the cvs file as in the samples.I have over 17000 existing customer records. When I tried to import whole file I managed to insert around 5000 records. I thought that maybe this number is too high for prestashop it causes some memory problems. Later I divided original file into smaller files which have 5000 records at most than I could import around 1500 records :) Later I tried file with 1000 records result was even smaller.

In the end I tried file with 200 records at most and I could import around 87 using cvsimport. This is meaningless. Everytime I clear the table before cvsimport... I don't get an error. It looks like import finishes correctly but when I check the # of records I see the bad result....

Is this a known issue? How can I solve this ?


Solution

  • I also inserted the customers usind sql script. I utilized excel to prepare the sql scripts. First I divided my data to 17 different tabs later I prepared sql for 1000 records at most. Even if I enter data with sql script I had problem with data bigger than 1000 records.

    This is a sample sql

    INSERT INTO ps_customer(active, id_gender, email,passwd, lastname, firstname, newsletter,optin) VALUES (1,9, "email@yahoo.com", MD5(CONCAT('cookiekeycookiekeycookiekey','password')),"surname","name",1,1);

    Later you should run the script below otherwise you can not login

    INSERT INTO ps_customer_group (id_customer,id_group) SELECT id_customer,3 FROM ps_customer WHERE id_customer NOT IN (SELECT id_customer FROM ps_customer_group)

    In my existing data I had the address in the same table but in prestashop adres is stored in another table. I prepared the sql below to use the customerid s in address table.

    INSERT INTO ps_address(id_customer, id_country, id_state, alias, company, lastname, firstname, address1, postcode, city, phone, phone_mobile, vat_number) VALUES
    (( SELECT id_customer FROM ps_customer WHERE email = "email@hotmail.com" ), 211 , 0 , " Adres1 "," "," Surname "," Name ","Adress details "," 10000 "," İstanbul "," tel1 "," mobile tel "," "));

    That all ...

    Ferda