All day yesterday I was dealing with this issue, and just could not resolve it, so I come to you, oh great and mighty Magento experts.

The Goal:

We have a live site which contains thousands of customers with multiple addresses for many of them and extensive order history, and a development site. We are now ready to go live with our dev site and are looking to export all of the customer information from the live site and import it onto the dev site.

The Struggle:

**Method 1:** I know in a past experience, we we're simply able to copy over the SQL tables of the customers and their sales and it worked fine (probably not the best practice, but it worked) such as you see mentioned [here].

Unfortunately, what happens when we do this, is that the only fields filled when going to 'Manage Customers' are the name and group .. no address information whatsoever, and when you click on any particular customer, you get this error;

Code:
    a:5:{i:0;s:37:"Invalid website code requested: James";i:1;s:3128:"#0 /www/www/testing/app/code/core/Mage/Core/Model/App.php(955): Mage::exception('Mage_Core', 'Invalid website...')
    #1 /www/www/testing/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php(50): Mage_Core_Model_App->getWebsite('James') 
    #2 /www/www/testing/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion->_prepareLayout()
    #3 /www/www/testing/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
    #4 /www/www/testing/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/custo...', 'accordion')
    #5 /www/www/testing/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/custo...', 'accordion')
    #6 /www/www/testing/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
    #7 /www/www/testing/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
    #8 /www/www/testing/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
    #9 /www/www/testing/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
    #10 /www/www/testing/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
    #11 /www/www/testing/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
    #12 /www/www/testing/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
    #13 /www/www/testing/app/code/core/Mage/Adminhtml/controllers/CustomerController.php(98): Mage_Adminhtml_Controller_Action->loadLayout()
    #14 /www/www/testing/app/code/local/Carotechs/Audittrack/controllers/CustomerController.php(100): Mage_Adminhtml_CustomerController->editAction()
    #15 /www/www/testing/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Carotechs_Audittrack_CustomerController->editAction()
    #16 /www/www/testing/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
    #17 /www/www/testing/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
    #18 /www/www/testing/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
    #19 /www/www/testing/app/Mage.php(684): Mage_Core_Model_App->run(Array)
    #20 /home/onesource/www/www/testing/index.php(87): Mage::run('', 'store')
    #21 {main}";s:3:"url";s:84:"/testing/index.php/admin/customer/edit/id/5242/key/dd1f05bf722bdc3e783914bd1f67416d/";s:11:"script_name";s:18:"/testing/index.php";s:4:"skin";s:5:"admin";}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
So after this predicament, I went the natural method of just exporting and importing the customers and possibly worrying about the order history later.

This came along with new problems. As we know there are multiple ways of going about exporting customers. The most obvious would be inside the 'Manage Customers' tab, there is simply an export button right there. However, that comes with just the basic information, no additional addresses if they have them.

**Method 2:** Moving onto trying a Dataflow Profile inside the the 'Import/Export' tab. Selecting 'Export Customers' CSV and all fields, it comes out with all of the customers. The issues with this export is that it does not contain the entity_id's for each of the customers, and it does not retain their additional addresses they have saved, it only grabs their main billing and shipping address. However, it does import correctly.

**Method 3:** Taking just the 'Export' option inside the 'Import/Export' tab this time, selecting customer, and using all of the fields, we come with what I feel is my closest option to what I need. It comes with all the additional addresses (only method I've come to see do this) however it does not come with the entity_id's of each customer, thus I imagine that would become a major issue linking the customers to their previous order history. While trying to import this CSV via the 'Import' tab, It goes through the 'Check Data' attempting to 'Append Complex Data' prior to allowing you to Import, and comes up with a plethora of errors.

Code:
    Required attribute 'reward_update_notification' has an empty value in rows: 1, 2, 3, 4, 6, 9, 11, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 49, 50
    Required attribute 'reward_warning_notification' has an empty value in rows: 1, 2, 3, 4, 6, 9, 11, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 49, 50
    Required attribute '_address_firstname' has an empty value in rows: 6, 7, 18, 19, 20, 21, 22, 23, 28, 29, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51
    Required attribute '_address_lastname' has an empty value in rows: 6, 7, 18, 19, 20, 21, 22, 23, 28, 29, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51
    Invalid value for 'group_id' in rows: 4, 48, 49
Most of those errors deal with the areas where it transitions in the CSV from a normal account to where just under it are the extra additional addresses.

This is where I am stumped, running out of ideas and not sure where to look.


Note:

If it comes to any relevance, the current live site is Magento 1.8.1.0 and the dev site is 1.9.0.1

Little Background:

Full disclosure, I have little to no background in database or SQL knowledge, I am primarily the front end designer that has now grown to be the dependent on all aspects of the webstore, so bare with me and last but not least, THANK YOU for your time and patience

View more threads in the same category: