Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3761594
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:39:00+00:00 2026-05-19T10:39:00+00:00

I have more than 300,000 users on an old online store. Client switched to

  • 0

I have more than 300,000 users on an old online store. Client switched to Magento solution and now have to migrate all the users, addresses to Magento. So I have to write a custom script to import users and their address to the Magento system.

Are there any tutorials or similar sort of work already done. Please help me.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T10:39:01+00:00Added an answer on May 19, 2026 at 10:39 am

    Here’s an example of how I migrated users from OSC into Magento with the SOAP library. This script was run on the old server and needs to be run from the ssh command line (php execution time through the browser will not support this

        $proxy = new SoapClient('http://[your magento url]/api/soap/?wsdl=1');
        $sessionId = $proxy->login('admin', '[your password]');
    
        // connect to local db
    
        $link = mysql_connect('localhost', '[old ecommerce db]', '[old db pw]');
        if (!$link) {
            die('Could not connect: ' . mysql_error());
        }
    
        mysql_select_db('sbc_osc', $link);
    
        $sql = "SELECT * FROM customers";
    
        $customers = mysql_query($sql);
    
        // loop thyrough customers
        while ($customer = mysql_fetch_assoc($customers)) {
    
            set_time_limit(600);
    
            $newCustomer = array(
                'firstname'  => $customer['customers_firstname'],
                'lastname'   => $customer['customers_lastname'],
                'email'      => $customer['customers_email_address'],
                'password_hash' => $customer['customers_password'],
                'store_id'   => 2, // set the store you want to send to
                'website_id' => 2
            );
    
            $telephone = $customer['customers_telephone'];
            $fax = $customer['customers_fax'];
    
            try{
                $newCustomerId = $proxy->call($sessionId, 'customer.create', array($newCustomer));
            }
            catch (Exception $e) {
                echo "failed to create customer for: " . $customer['customers_firstname'] . " " . $customer['customers_lastname'] . "\n";
            }
    
            // grab the default address
            $sql = "SELECT ab.*, c.countries_iso_code_2, z.zone_name, z.zone_id
                    FROM address_book ab 
                    LEFT JOIN countries c ON ab.entry_country_id =  c.countries_id
                    LEFT JOIN zones z ON ab.entry_zone_id = z.zone_id
                    WHERE customers_id = {$customer['customers_id']} AND address_book_id = {$customer['customers_default_address_id']}";
    
            $addresses = mysql_query($sql);
    
            while ($address = mysql_fetch_assoc($addresses)) {
    
                $newCustomerAddress = array(
                    'firstname'  => $address['entry_firstname'],
                    'lastname'   => $address['entry_lastname'],
                    'company'    => $address['entry_company'],
                    'country_id' => $address['countries_iso_code_2'],
                    'region_id'  => $address['zone_id'],
                    'region'     => ($address['zone_name'] != "" ? $address['zone_name'] : $address['entry_state']),
                    'city'       => $address['entry_city'],
                    'street'     => array($address['entry_street_address']),
                    'telephone'  => $telephone,
                    'fax'        => $fax,
                    'postcode'   => $address['entry_postcode'],
                    'is_default_billing'  => true,
                    'is_default_shipping' => true,
                );
    
                try{
                    $newAddressId = $proxy->call($sessionId, 'customer_address.create', array($newCustomerId, $newCustomerAddress));
                }
                catch (Exception $e) {
                    echo "failed to add address for: " . $address['entry_firstname'] . " " . $address['entry_lastname'] . "\n";
                }
            }
    
            echo "migrated: " . $customer['customers_firstname'] . " " . $customer['customers_lastname'] . "\n";
    
        }
    
    
        mysql_close($link);
    

    One thing you need to watch out for is the passwords.. for this to work I had to set up Magento to use the same password hashing schema.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have site which uses $(selector).load(path) function in more than 300 pages. Now my
I have a table with more than 300,000 records, of size approximately 1.5 GB
I have a table with more than 300,000 rows (Total table size is 600mb+).
I have more than 100 million unique strings (VARCHAR(100) UNIQUE in MySQL database). Now
I have more than 400 000 id's in NOT IN statement. Whether it will
I have a datatable with more than 300 rows. I want each page to
i have a website (based on liferay) that produces more than 300 Feeds (one
I have an app with a lot of buttons (more than 300) i want
I have a master excel document with more than 300 worksheets inside. I want
I have more than one Event Listener that calls a specific function, and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.