Last night I tried some test imports with varying levels of success. With almost 10,000 customers to import, it made it through roughly 25% before locking up.
I quickly discovered that when importing customers, the import module seemed to be emailing each ‘new’ customer?!? Is the import triggering the email generation for new accounts? If so, is there a configuration setting I can use to disable emails for new accounts while importing customers?
I temporarily set my php config for sendmail script /dev/null to prevent sending emails, but this crashed the import script completely. Could the email function be somehow related to my import failing?
I tried doing a customer import… working off of a backup of the osCommerce database… and I went in an modified all the email addresses of the customer records in the database I was importing from, and since I had the same email address on all the customer records the script bombed after the first customer record it imported… but I did confirm that it tried sending an email to the address when running the import.
It looks like it fired off some kind of signup to the newsletter.
From: Owner [mailto:owner@example.com] Sent: Monday, April 28, 2008 11:54 PM To: Matt Johnson Subject: Newsletter subscription success
I decided to get a little more creative with overwriting the customer record email addresses in backup database that I was importing from.
I ran this query to overwrite all the customer email addresses in the customers and orders tables:
update customers set customers_email_address = concat(cast(customers_id as char(25)), '@example.com');
update orders set customers_email_address = concat(cast(customers_id as char(25)), '@example.com');
Please DO NOT run this query if you don’t know 100% what you are doing with SQL queries, and what the implications to the database is. It will overwrite all customer email addresses in the database it’s executed against, and you really don’t want to run it against an osCommerce database that’s in use.
Anyway, I ran this, then tried to do an import of the customers and orders… and it got through 100% of the 9930 customers, and it acted like it was moving on to import orders, but it didnt’ get a single order imported. There were a lot of bounced email messages because of the fake email addresses, but it made it through importing all of them.
I’m wondering if there is some kind of log or somewhere that might give me a clue why this thing just stops like it does in the middle of an import.
I tried the new version (1.0.19700) on importing customers, and it looks like it’s still trying to send out emails because a bunch of postfix processes started up indicating it’s trying to send emails and getting bounced because I populated all the customers with fake email addresses.
I think our problem is coming from the function _saveCustomer starting line 740 into app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php with line 773 into this file $customer->sendNewAccountEmail();
you can find sendNewAccountEmail into app/code/core/Mage/Customer/Model/Customer.php and that s basiclly sending email ...
The function _saveCustomer is being use into app/code/core/Model/Mysql4/Oscommerce.php into the function importCustomers starting line 350 without any lock regarding emails when importing !
So.... you think we can comment something out to solve this?
these changes have not been been tested and remember it should stay as a workaround to test oscommerce import tool and report bugs to Magento until they fix it !!
do not edit any files if you dont know what you’re doing !
for new account welcome email
comment out app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php line 773
$customer->sendNewAccountEmail();
becomes
// $customer->sendNewAccountEmail();
for the newsletter sucess email
comment out app/code/core/Mage/Newsletter/Model/Subscriber.php into subscribe function the if starting line 310