Making a copy of your customer and order data for Magento 1.9.2

If you have setup a new Magento installation to match your live website and want to move accross the old orders and your customer data then follow the following steps.

I prefer to import my database tables via shell rather than using PHPMyAdmin as it has a tendency to hang if you have a lot of data

Exporting the Tables from your live database

To export the correct tables simply export any tables which begin with sales_ and customers_:

You will want to export them with the ‘Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement’ checked.

Once you have exported these files from PHPMyAdmin you will need to open up the files and add the following line to the beginning of the file:

And this line to the very end of the file:

This disables the foreign key checks for the duration of the import, it might not be recommended normally but as the target database is “empty” it fine to do.

Importing via Shell

Upload your sql file to your server and then navigate to it in your shell panel, once there run the following command (replacing the place holders with your settings):

you will then be prompted for the password, enter it and hit return and the file will be imported into the database. Just to ensure everything comes in smoothly I recommend clearing the cache and then log out of your target Magento store and log back in and you should find your dashboard is now up to date with your latest orders and customers.

Published by

BlackRhino

I am a 80's child - the NES, N64 generation old enough to remember Boulder dash - young enough to play Call of Duty. I have been developing in PHP for over 10 years - I've been working in Unity 3D for the past 6 months as I expand my skills into Games Development - Magento development helps to pay the bills.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">