Results 1 to 10 of 18

Hybrid View

  1. #1
    Join Date
    Feb 2008
    Location
    NZ
    Posts
    60
    Plugin Contributions
    0

    Default Re: Importing Customers

    Quote Originally Posted by pinetreecandles View Post
    If you have access to myphpadmin you can use that to move your customers over. That is what I did from OSC to Zen. I exported only the address book, address book format, customers, and customers info tables, then did the same with zen cart. I compared the two and made the changes that were needed for the conversion and put them into the database via an SQL query. It took awhile, but it can be done. Got passwords and all. I don't know a bit about mysql, but it worked.

    Unless your product ID's are identical, your out of luck getting your products over without a ton of errors and if you have made any adjustments to any of the product tables, the mods made to import from osc wont work.

    Good luck
    How do I do the query part - like do I put to make the query? I think that will be why I was getting an error because I tried to import the new file but it didn't like it.

  2. #2
    Join Date
    Feb 2008
    Location
    West Virginia
    Posts
    137
    Plugin Contributions
    0

    Default Re: Importing Customers

    ok, that is the part that is hard to explain. I didn't really make a query. I modified the tables I exported from zen cart. I made sure I added the "Drop Table" and had "Complete Inserts" marked before I exported the tables I needed.

    So I knew what the format was to look like, I created a test account and that was exported along with the data. I then copied and pasted the data from those same tables from osc onto the zen carts. Example below is from test account using Customer table.

    OSC cusomters table with info...
    Code:
    [DROP TABLE IF EXISTS `customers`;
    CREATE TABLE `customers` (
      `customers_id` int(11) NOT NULL auto_increment,
      `customers_gender` char(1) NOT NULL default '',
      `customers_firstname` varchar(32) NOT NULL default '',
      `customers_lastname` varchar(32) NOT NULL default '',
      `customers_dob` datetime NOT NULL default '0000-00-00 00:00:00',
      `customers_email_address` varchar(96) NOT NULL default '',
      `customers_default_address_id` int(11) default NULL,
      `customers_telephone` varchar(32) NOT NULL default '',
      `customers_fax` varchar(32) default NULL,
      `customers_password` varchar(40) NOT NULL default '',
      `customers_newsletter` char(1) default NULL,
      `customers_group_id` smallint(5) unsigned NOT NULL default '0',
      `customers_group_ra` enum('0','1') NOT NULL default '0',
      `customers_payment_allowed` varchar(255) NOT NULL default '',
      `customers_shipment_allowed` varchar(255) NOT NULL default '',
      PRIMARY KEY  (`customers_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=250;
    
    
    INSERT INTO `customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `customers_dob`, `customers_email_address`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `customers_password`, `customers_newsletter`, `customers_group_id`, `customers_group_ra`, `customers_payment_allowed`, `customers_shipment_allowed`) VALUES(2, 'f', 'demo', 'Jones', '1975-03-11 00:00:00', '[email protected]', 2, '207-232-0707', '', 'b9c7617f9b1eb80665c2c73ed2edfafa:4c', '1', 0, '0', '', '');
    Zen's cusomter table with info:
    Code:
    DROP TABLE IF EXISTS `zen_customers`;
    CREATE TABLE `zen_customers` (
      `customers_id` int(11) NOT NULL auto_increment,
      `customers_gender` char(1) NOT NULL default '',
      `customers_firstname` varchar(32) NOT NULL default '',
      `customers_lastname` varchar(32) NOT NULL default '',
      `customers_dob` datetime NOT NULL default '0001-01-01 00:00:00',
      `customers_email_address` varchar(96) NOT NULL default '',
      `customers_nick` varchar(96) NOT NULL default '',
      `customers_default_address_id` int(11) NOT NULL default '0',
      `customers_telephone` varchar(32) NOT NULL default '',
      `customers_fax` varchar(32) default NULL,
      `customers_password` varchar(40) NOT NULL default '',
      `customers_newsletter` char(1) default NULL,
      `customers_group_pricing` int(11) NOT NULL default '0',
      `customers_email_format` varchar(4) NOT NULL default 'TEXT',
      `customers_authorization` int(1) NOT NULL default '0',
      `customers_referral` varchar(32) NOT NULL default '',
      `customers_paypal_payerid` varchar(20) NOT NULL default '',
      `customers_paypal_ec` tinyint(1) unsigned NOT NULL default '0',
      `customers_tax_exempt` varchar(32) default NULL,
      PRIMARY KEY  (`customers_id`),
      KEY `idx_email_address_zen` (`customers_email_address`),
      KEY `idx_referral_zen` (`customers_referral`(10)),
      KEY `idx_grp_pricing_zen` (`customers_group_pricing`),
      KEY `idx_nick_zen` (`customers_nick`),
      KEY `idx_newsletter_zen` (`customers_newsletter`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=256 ;
    
    
    INSERT INTO `zen_customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `customers_dob`, `customers_email_address`, `customers_nick`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `customers_password`, `customers_newsletter`, `customers_group_pricing`, `customers_email_format`, `customers_authorization`, `customers_referral`, `customers_paypal_payerid`, `customers_paypal_ec`, `customers_tax_exempt`) VALUES(20, 'm', 'Demo', 'Account', '1964-04-06 00:00:00', [email protected]', '', 20, '', '', '377bad57f53fb42e65077000be1e1c23:6b', '1', 0, 'HTML', 0, '', '', 0, NULL);
    What I did was take the following from the osc table:
    Code:
    INSERT INTO `customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `customers_dob`, `customers_email_address`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `customers_password`, `customers_newsletter`, `customers_group_id`, `customers_group_ra`, `customers_payment_allowed`, `customers_shipment_allowed`) VALUES(2, 'f', 'demo', 'Jones', '1975-03-11 00:00:00', '[email protected]', 2, '207-232-0707', '', 'b9c7617f9b1eb80665c2c73ed2edfafa:4c', '1', 0, '0', '', '');
    and paste it under the data from the zen table so it looked like this:
    Code:
    INSERT INTO `zen_customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `customers_dob`, `customers_email_address`, `customers_nick`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `customers_password`, `customers_newsletter`, `customers_group_pricing`, `customers_email_format`, `customers_authorization`, `customers_referral`, `customers_paypal_payerid`, `customers_paypal_ec`, `customers_tax_exempt`) VALUES(20, 'm', 'Demo', 'Account', '1964-04-06 00:00:00', [email protected]', '', 20, '', '', '377bad57f53fb42e65077000be1e1c23:6b', '1', 0, 'HTML', 0, '', '', 0, NULL);
    INSERT INTO `customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `customers_dob`, `customers_email_address`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `customers_password`, `customers_newsletter`, `customers_group_id`, `customers_group_ra`, `customers_payment_allowed`, `customers_shipment_allowed`) VALUES(2, 'f', 'demo', 'Jones', '1975-03-11 00:00:00', '[email protected]', 2, '207-232-0707', '', 'b9c7617f9b1eb80665c2c73ed2edfafa:4c', '1', 0, '0', '', '');
    I then modified the data from the osc to match the zen data just above it. Took me a few tries to get it to match. Then once it was done I uploaded that sql file. I dropped the customers table and rebuilt it and inserted all my new data, (customers).

    I had to do this on all the address book and customer tables. Took awhile, but in the end it all worked out.

    Hope this helps and good luck.
    Zen Cart: 1.3.8a
    PHP: 5.2.4
    MySQL: 5.0.45

    Pine Tree Candles

  3. #3
    Join Date
    May 2008
    Posts
    34
    Plugin Contributions
    0

    Default Re: Importing Customers

    Thanks a lot for posting this method. I used it to allow the customers to select their preferred contact method while creating a new account. Everything works well, but I would like to show their choice on the checkout confirmation page. Does anyone know the code to call the variable?

  4. #4
    Join Date
    May 2008
    Posts
    34
    Plugin Contributions
    0

    Default Re: Importing Customers

    Quote Originally Posted by jaydee98273 View Post
    Thanks a lot for posting this method. I used it to allow the customers to select their preferred contact method while creating a new account. Everything works well, but I would like to show their choice on the checkout confirmation page. Does anyone know the code to call the variable?
    Oops. I guess it helps if I post my question in the right thread.

 

 

Similar Threads

  1. importing customers and orders
    By volkswest in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 15 Feb 2010, 05:43 AM
  2. Importing Customers (sort of)
    By xiexiema in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 30 Apr 2008, 10:34 AM
  3. importing customers 1.2.6 -> 1.3.7
    By hbtrading in forum Upgrading from 1.3.x to 1.3.9
    Replies: 7
    Last Post: 11 Sep 2007, 08:43 PM
  4. Importing Customers from CSV
    By atracksler in forum Managing Customers and Orders
    Replies: 2
    Last Post: 15 Apr 2007, 02:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg