Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Copying and importing products to another store - SQL?

Copying and importing products to another store - SQL?

Locked

Views: 1,273

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
11 Aug 2007, 6:56 AM
#1
kgmmusic avatar

kgmmusic

New Zenner

Join Date:
Nov 2005
Posts:
76
Plugin Contributions:
0

Copying and importing products to another store - SQL?

I need to copy all products, attributes, and categories from [Store A] to [Store B] without disrupting the existing products and categories on [Store B]. I think I figured out how to EXPORT the TABLES [from Store A] to a .sql file using phpMYadmin but I'm not sure how import them into the existing database [of Store B] without disturbing the existing data. Both stores are using ZenCart 1.3.7 and should have the same database structure.

CAN ANYONE HELP A SQL NEWBIE??? PLEASE!!!

Thank you in advance,
Kevin McGurk

13 Aug 2007, 2:15 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Copying and importing products to another store - SQL?

That is a bear and a half to do ...

You would need to set the 2nd site to have products_id and categories_id and orders_id and attributes_id and 27 other ids to higher than those in your 1st site ...

You are looking at about 20 tables here that need adjusting ...

One method is to practice this on a two copies of the databases and build a script carefully to up all the something_id to then same value plus 3000 or 5000 or 10000 or what ever it takes to avoid conflict ...

I would do this on a grouping basis such as orders_id + 900, products_id + 2500 etc.

Once you have the script built to do this, test importing the data with these changes ...

You are taking the existing database tables from site 1 to site 3 then from site 2 to site 4 ... then up the ids from site 3 plus the values needed to be higher than site 2 ... then import that data into site 4 ...

By doing it this way, you can get that script down to a clean and concise fix to the id values and test and test ... when you think you have it perfect, then you can set your Live site 1 and site 2 to Down for Maintenance and do it for real and run your script on site 3 and merge with site 4 ... then verify the results before backing up site 1 and overwritting with site 4 ...

Are you lost yet? :blink: