2

What would be the easiest way to copy all products (including images) and categories from one installation of Magento to another one (completely empty and vanilla) on the same server? I don't need to keep orders, users, etc. but only the products. I don't mind, however, copying these too. I also don't need them to keep the same keys, as long as the association with the appropriate categories stays the same.

Exporting to CSV and importing seems particularly messy, while just duplicating the database simply won't work...

1
  • 1
    What went wrong with when you copied the database? This should be the fastest way to get it into a clean install (also don't forget to copy the media/catalog directory to get the images) Commented Aug 21, 2013 at 19:29

3 Answers 3

2

The easiest way to move a database is to backup and restore, you can choose to remove all your orders on the new install. The total time (Depending on the server) would be less than 10 minutes!

mysqldump -p'PASSWORD' -uuser -hyourhost database1 > mydumpfile.sql
mysql -p'PASSWORD' -uuser -hyourhost database2 < mydumpfile.sql

All you need to do now is change the url for the site: Something like

Here is an easy way to find them

select * from core_config_data where value like 'http%';

Find the config_id's for your secure and unsecure address

then

update core_config_data set value = 'http://my.newdomain.com/' where config_id in (You list of ids');
  • List of id's must be something like this (6,7) etc

I can post a delete orders script if you want - The entire process is quick and efficient.

1
  • what if I have a new theme installed in my new magento copy and that has content in the DB. How am I gonna manage then the products, categories, orders, etc. Commented Nov 20, 2015 at 4:57
3

Why don't you try to copy the entire database ? Then you only has to change all the old URL for the new ones. ( for example the old URL www.oldone.com/x to -> www.newone.com/x ).

What I do is to copy the old database, change the urls automatically and then upload to the new database.

Hope this can help you.

0

I have found the best approach to this is to use the export import profiles.

Create an export profile that gives you the information you are looking to migrate and then import that information into your new Magento.

There are a few required fields, make sure those fields are in your csv when importing, make sure you have table headings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.